You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@asterixdb.apache.org by mh...@apache.org on 2019/04/21 19:59:32 UTC

[asterixdb] branch master updated: [ASTERIXDB-2553][SQL] Make DIV and MOD Operators Case Insensitive

This is an automated email from the ASF dual-hosted git repository.

mhubail pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 29f6391  [ASTERIXDB-2553][SQL] Make DIV and MOD Operators Case Insensitive
29f6391 is described below

commit 29f6391f9d27d28d3acfa8dd683db6072f54286a
Author: Murtadha Hubail <mh...@apache.org>
AuthorDate: Sun Apr 21 14:23:57 2019 +0300

    [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 <je...@fulliautomatix.ics.uci.edu>
    Sonar-Qube: Jenkins <je...@fulliautomatix.ics.uci.edu>
    Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
    Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
    Reviewed-by: Ali Alsuliman <al...@gmail.com>
---
 .../div_mod_case_insensitive.1.query.sqlpp            | 19 +++++++++++++++++++
 .../div_mod_case_insensitive.1.adm                    |  1 +
 .../src/test/resources/runtimets/testsuite_sqlpp.xml  |  5 +++++
 asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj |  4 ++--
 .../RangePartitionMergeExchangePOperator.java         |  2 +-
 5 files changed, 28 insertions(+), 3 deletions(-)

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 @@ TOKEN [IGNORE_CASE]:
   | <DESC : "desc">
   | <DISCONNECT : "disconnect">
   | <DISTINCT : "distinct">
+  | <DIV : "div">
   | <DROP : "drop">
   | <ELEMENT : "element">
   | <EXPLAIN : "explain">
@@ -3647,6 +3648,7 @@ TOKEN [IGNORE_CASE]:
   | <LIKE : "like">
   | <LIMIT : "limit">
   | <LOAD : "load">
+  | <MOD : "mod">
   | <NODEGROUP : "nodegroup">
   | <NGRAM : "ngram">
   | <NOT : "not">
@@ -3700,9 +3702,7 @@ TOKEN :
     <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.IPartitioningRequir
 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;