Murtadha Hubail has submitted this change and it was merged. ( 
https://asterix-gerrit.ics.uci.edu/3354 )

Change subject: [ASTERIXDB-2553][SQL] Make DIV and MOD Operators Case 
Insensitive
......................................................................

[ASTERIXDB-2553][SQL] Make DIV and MOD Operators Case Insensitive

- user model changes: yes
- storage format changes: no
- interface changes: no

Details:
- Make DIV and MOD operators case insensitive.
- Fix imports order.
- Add test case.

Change-Id: I3f28a8324aeedcb05bef628751f1ff8e33ee08a0
Reviewed-on: https://asterix-gerrit.ics.uci.edu/3354
Contrib: Jenkins <[email protected]>
Sonar-Qube: Jenkins <[email protected]>
Integration-Tests: Jenkins <[email protected]>
Tested-by: Jenkins <[email protected]>
Reviewed-by: Ali Alsuliman <[email protected]>
---
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/numeric/div_mod_case_insensitive/div_mod_case_insensitive.1.query.sqlpp
A 
asterixdb/asterix-app/src/test/resources/runtimets/results/numeric/div_mod_case_insensitive/div_mod_case_insensitive.1.adm
M asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
M asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
M 
hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/RangePartitionMergeExchangePOperator.java
5 files changed, 28 insertions(+), 3 deletions(-)

Approvals:
  Jenkins: Verified; No violations found; ; Verified
  Anon. E. Moose (1000171):
  Ali Alsuliman: Looks good to me, approved



diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/numeric/div_mod_case_insensitive/div_mod_case_insensitive.1.query.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/numeric/div_mod_case_insensitive/div_mod_case_insensitive.1.query.sqlpp
new file mode 100644
index 0000000..4e4ff57
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/numeric/div_mod_case_insensitive/div_mod_case_insensitive.1.query.sqlpp
@@ -0,0 +1,19 @@
+/*
+ * 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 10 DIV 1 MOD 1 div 10 mod 1;
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/results/numeric/div_mod_case_insensitive/div_mod_case_insensitive.1.adm
 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/numeric/div_mod_case_insensitive/div_mod_case_insensitive.1.adm
new file mode 100644
index 0000000..c227083
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/results/numeric/div_mod_case_insensitive/div_mod_case_insensitive.1.adm
@@ -0,0 +1 @@
+0
\ No newline at end of file
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 5bb25f8..50793df 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -6849,6 +6849,11 @@
       </compilation-unit>
     </test-case>
     <test-case FilePath="numeric">
+      <compilation-unit name="div_mod_case_insensitive">
+        <output-dir compare="Text">div_mod_case_insensitive</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="numeric">
       <compilation-unit name="floor0">
         <output-dir compare="Text">floor0</output-dir>
       </compilation-unit>
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj 
b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
index 765e97b..f817f17 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
+++ b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
@@ -3606,6 +3606,7 @@
   | <DESC : "desc">
   | <DISCONNECT : "disconnect">
   | <DISTINCT : "distinct">
+  | <DIV : "div">
   | <DROP : "drop">
   | <ELEMENT : "element">
   | <EXPLAIN : "explain">
@@ -3647,6 +3648,7 @@
   | <LIKE : "like">
   | <LIMIT : "limit">
   | <LOAD : "load">
+  | <MOD : "mod">
   | <NODEGROUP : "nodegroup">
   | <NGRAM : "ngram">
   | <NOT : "not">
@@ -3700,9 +3702,7 @@
     <CARET : "^">
   | <CONCAT : "||">
   | <DIVIDE : "/">
-  | <DIV : "div">
   | <MINUS : "-">
-  | <MOD : "mod">
   | <MUL : "*">
   | <PLUS : "+">

diff --git 
a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/RangePartitionMergeExchangePOperator.java
 
b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/RangePartitionMergeExchangePOperator.java
index ee43f3f..922cdd3 100644
--- 
a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/RangePartitionMergeExchangePOperator.java
+++ 
b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/RangePartitionMergeExchangePOperator.java
@@ -41,9 +41,9 @@
 import 
org.apache.hyracks.algebricks.core.algebra.properties.IPhysicalPropertiesVector;
 import 
org.apache.hyracks.algebricks.core.algebra.properties.LocalOrderProperty;
 import org.apache.hyracks.algebricks.core.algebra.properties.OrderColumn;
+import 
org.apache.hyracks.algebricks.core.algebra.properties.OrderedPartitionedProperty;
 import 
org.apache.hyracks.algebricks.core.algebra.properties.PhysicalRequirements;
 import 
org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector;
-import 
org.apache.hyracks.algebricks.core.algebra.properties.OrderedPartitionedProperty;
 import org.apache.hyracks.algebricks.core.jobgen.impl.JobGenContext;
 import org.apache.hyracks.algebricks.data.IBinaryComparatorFactoryProvider;
 import 
org.apache.hyracks.algebricks.data.INormalizedKeyComputerFactoryProvider;

--
To view, visit https://asterix-gerrit.ics.uci.edu/3354
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I3f28a8324aeedcb05bef628751f1ff8e33ee08a0
Gerrit-Change-Number: 3354
Gerrit-PatchSet: 4
Gerrit-Owner: Murtadha Hubail <[email protected]>
Gerrit-Reviewer: Ali Alsuliman <[email protected]>
Gerrit-Reviewer: Anon. E. Moose (1000171)
Gerrit-Reviewer: Dmitry Lychagin <[email protected]>
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Reviewer: Murtadha Hubail <[email protected]>

Reply via email to