You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "ivandasch (via GitHub)" <gi...@apache.org> on 2024/06/14 13:18:47 UTC
[PR] IGNITE-21491 [calcite] Fix assertion error for multiline statements in thin client [ignite]
ivandasch opened a new pull request, #11394:
URL: https://github.com/apache/ignite/pull/11394
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
### The Contribution Checklist
- [ ] There is a single JIRA ticket related to the pull request.
- [ ] The web-link to the pull request is attached to the JIRA ticket.
- [ ] The JIRA ticket has the _Patch Available_ state.
- [ ] The pull request body describes changes that have been made.
The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
- [ ] The pull request title is treated as the final commit message.
The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
- [ ] A reviewer has been mentioned through the JIRA comments
(see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers))
- [ ] The pull request has been checked by the Teamcity Bot and
the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
### Notes
- [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
- [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
- [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
- [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-21491 SQL Calcite: Fix assertion error for multiline statements in thin client [ignite]
Posted by "alex-plekhanov (via GitHub)" <gi...@apache.org>.
alex-plekhanov commented on code in PR #11394:
URL: https://github.com/apache/ignite/pull/11394#discussion_r1642845384
##########
modules/calcite/src/test/java/org/apache/ignite/testsuites/IntegrationTestSuite.java:
##########
@@ -135,6 +136,7 @@
IndexWithSameNameCalciteTest.class,
AuthorizationIntegrationTest.class,
DdlTransactionCalciteSelfTest.class,
+ MultiLineQueryTest.class
Review Comment:
Add comma before EOL
##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/thin/MultiLineQueryTest.java:
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.query.calcite.thin;
+
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.cache.query.SqlFieldsQuery;
+import org.apache.ignite.calcite.CalciteQueryEngineConfiguration;
+import org.apache.ignite.client.IgniteClient;
+import org.apache.ignite.configuration.ClientConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.SqlConfiguration;
+import org.apache.ignite.indexing.IndexingQueryEngineConfiguration;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static org.apache.ignite.testframework.GridTestUtils.assertThrows;
+
+/**
+ * Tests proper exception is thrown when multiline expressions are executed on thin client on both engines.
+ */
+@RunWith(Parameterized.class)
+public class MultiLineQueryTest extends GridCommonAbstractTest {
+ /** */
+ private static final String H2_ENGINE = IndexingQueryEngineConfiguration.ENGINE_NAME;
+
+ /** */
+ private static final String CALCITE_ENGINE = CalciteQueryEngineConfiguration.ENGINE_NAME;
+
+ /** */
+ private IgniteClient cli;
+
+ /** */
+ @Parameterized.Parameter
+ public String queryEngine;
+
+ /** */
+ @Parameterized.Parameters(name = "engine={0}")
+ public static List<Object> parameters() {
+ return Stream.of(H2_ENGINE, CALCITE_ENGINE).collect(Collectors.toList());
Review Comment:
`F.asList` or `Arrays.asList`?
##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessor.java:
##########
@@ -500,8 +501,15 @@ private <T> List<T> parseAndProcessQuery(
parserMetrics.countCacheMiss();
+ QueryProperties qryProps = qryCtx != null ? qryCtx.unwrap(QueryProperties.class) : null;
+
SqlNodeList qryList = Commons.parse(sql, FRAMEWORK_CONFIG.getParserConfig());
+ if (qryList.size() > 1 && qryProps != null && qryProps.isFailOnMultipleStmts()) {
+ throw new IgniteSQLException("Multiple statements queries are not supported.",
+ IgniteQueryErrorCode.UNSUPPORTED_OPERATION);
Review Comment:
Wrong indent
##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/thin/MultiLineQueryTest.java:
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.ignite.internal.processors.query.calcite.thin;
+
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteException;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.cache.query.SqlFieldsQuery;
+import org.apache.ignite.calcite.CalciteQueryEngineConfiguration;
+import org.apache.ignite.client.IgniteClient;
+import org.apache.ignite.configuration.ClientConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.SqlConfiguration;
+import org.apache.ignite.indexing.IndexingQueryEngineConfiguration;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import static org.apache.ignite.testframework.GridTestUtils.assertThrows;
+
+/**
+ * Tests proper exception is thrown when multiline expressions are executed on thin client on both engines.
+ */
+@RunWith(Parameterized.class)
+public class MultiLineQueryTest extends GridCommonAbstractTest {
+ /** */
+ private static final String H2_ENGINE = IndexingQueryEngineConfiguration.ENGINE_NAME;
+
+ /** */
+ private static final String CALCITE_ENGINE = CalciteQueryEngineConfiguration.ENGINE_NAME;
+
+ /** */
+ private IgniteClient cli;
+
+ /** */
+ @Parameterized.Parameter
+ public String queryEngine;
+
+ /** */
+ @Parameterized.Parameters(name = "engine={0}")
+ public static List<Object> parameters() {
+ return Stream.of(H2_ENGINE, CALCITE_ENGINE).collect(Collectors.toList());
+ }
+
+ /** {@inheritDoc} */
+ @Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
+ return super.getConfiguration(igniteInstanceName).setSqlConfiguration(
+ new SqlConfiguration().setQueryEnginesConfiguration(
+ new IndexingQueryEngineConfiguration(),
+ new CalciteQueryEngineConfiguration()
+ )
Review Comment:
Wrong indent
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] IGNITE-21491 SQL Calcite: Fix assertion error for multiline statements in thin client [ignite]
Posted by "ivandasch (via GitHub)" <gi...@apache.org>.
ivandasch merged PR #11394:
URL: https://github.com/apache/ignite/pull/11394
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org