fix error message for union with set semantics
Change-Id: I2b69ab843795221ef5c9a533839ed6d359b7c8e3
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1229
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/SqlppExpressionToPlanTranslator.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/SqlppExpressionToPlanTranslator.java
index f2ba140..2e79225 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/SqlppExpressionToPlanTranslator.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/SqlppExpressionToPlanTranslator.java
@@ -194,7 +194,7 @@
SetOpType setOpType = setOperationRight.getSetOpType();
if (setOpType != SetOpType.UNION || setOperationRight.isSetSemantics()) {
throw new AsterixException("Operation " + setOpType
- + (setOperationRight.isSetSemantics() ? "with set semantics" : "ALL") + " is not supported.");
+ + (setOperationRight.isSetSemantics() ? " with set semantics" : "ALL") + " is not supported.");
}
SetOperationInput rightInput = setOperationRight.getSetOperationRightInput();
inputExprs.add(rightInput.selectBlock()
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/union/union_negative_3/union_negative_3.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/union/union_negative_3/union_negative_3.1.query.sqlpp
new file mode 100644
index 0000000..297edd6
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/union/union_negative_3/union_negative_3.1.query.sqlpp
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+
+select value 1 union select value 1;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index 0aeca6c..2838f1f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -8134,6 +8134,12 @@
</compilation-unit>
</test-case>
<test-case FilePath="union">
+ <compilation-unit name="union_negative_3">
+ <output-dir compare="Text">union</output-dir>
+ <expected-error>Operation UNION with set semantics is not supported.</expected-error>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="union">
<compilation-unit name="union_orderby">
<output-dir compare="Text">union_orderby</output-dir>
</compilation-unit>