asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xi...@apache.org
Subject [1/2] asterixdb git commit: Fix ASTERIXDB-1875 UDF in SQL++
Date Mon, 10 Apr 2017 22:40:13 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master ab01c87e5 -> 96fd4026a


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/96fd4026/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpcds/query-ASTERIXDB-1591.plan
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpcds/query-ASTERIXDB-1591.plan
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpcds/query-ASTERIXDB-1591.plan
index 2ade8bb..90d7b02 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpcds/query-ASTERIXDB-1591.plan
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpcds/query-ASTERIXDB-1591.plan
@@ -4,76 +4,76 @@
       -- STREAM_PROJECT  |PARTITIONED|
         -- ASSIGN  |PARTITIONED|
           -- STREAM_PROJECT  |PARTITIONED|
-            -- SORT_MERGE_EXCHANGE [$$120(ASC) ]  |PARTITIONED|
+            -- SORT_MERGE_EXCHANGE [$$112(ASC) ]  |PARTITIONED|
               -- STREAM_LIMIT  |PARTITIONED|
                 -- STREAM_PROJECT  |PARTITIONED|
                   -- STREAM_SELECT  |PARTITIONED|
                     -- STREAM_PROJECT  |PARTITIONED|
                       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                        -- SORT_GROUP_BY[$$129, $$130]  |PARTITIONED|
+                        -- SORT_GROUP_BY[$$121, $$122]  |PARTITIONED|
                                 {
                                   -- AGGREGATE  |LOCAL|
                                     -- NESTED_TUPLE_SOURCE  |LOCAL|
                                 }
-                          -- HASH_PARTITION_EXCHANGE [$$129, $$130]  |PARTITIONED|
-                            -- PRE_CLUSTERED_GROUP_BY[$$117, $$118]  |PARTITIONED|
+                          -- HASH_PARTITION_EXCHANGE [$$121, $$122]  |PARTITIONED|
+                            -- PRE_CLUSTERED_GROUP_BY[$$109, $$110]  |PARTITIONED|
                                     {
                                       -- AGGREGATE  |LOCAL|
                                         -- STREAM_SELECT  |LOCAL|
                                           -- NESTED_TUPLE_SOURCE  |LOCAL|
                                     }
                               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                -- STABLE_SORT [$$117(ASC), $$118(ASC)]  |PARTITIONED|
+                                -- STABLE_SORT [$$109(ASC), $$110(ASC)]  |PARTITIONED|
                                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                     -- STREAM_PROJECT  |PARTITIONED|
                                       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                        -- HYBRID_HASH_JOIN [$$117][$$99]  |PARTITIONED|
-                                          -- HASH_PARTITION_EXCHANGE [$$117]  |PARTITIONED|
-                                            -- SORT_GROUP_BY[$$126, $$127]  |PARTITIONED|
+                                        -- HYBRID_HASH_JOIN [$$109][$$91]  |PARTITIONED|
+                                          -- HASH_PARTITION_EXCHANGE [$$109]  |PARTITIONED|
+                                            -- SORT_GROUP_BY[$$118, $$119]  |PARTITIONED|
                                                     {
                                                       -- AGGREGATE  |LOCAL|
                                                         -- NESTED_TUPLE_SOURCE  |LOCAL|
                                                     }
-                                              -- HASH_PARTITION_EXCHANGE [$$126, $$127] 
|PARTITIONED|
-                                                -- PRE_CLUSTERED_GROUP_BY[$$114, $$115] 
|PARTITIONED|
+                                              -- HASH_PARTITION_EXCHANGE [$$118, $$119] 
|PARTITIONED|
+                                                -- PRE_CLUSTERED_GROUP_BY[$$106, $$107] 
|PARTITIONED|
                                                         {
                                                           -- AGGREGATE  |LOCAL|
                                                             -- STREAM_SELECT  |LOCAL|
                                                               -- NESTED_TUPLE_SOURCE  |LOCAL|
                                                         }
                                                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                                    -- STABLE_SORT [$$114(ASC), $$115(ASC)]
 |PARTITIONED|
+                                                    -- STABLE_SORT [$$106(ASC), $$107(ASC)]
 |PARTITIONED|
                                                       -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                         -- STREAM_PROJECT  |PARTITIONED|
                                                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                                            -- HYBRID_HASH_JOIN [$$114][$$97]
 |PARTITIONED|
-                                                              -- HASH_PARTITION_EXCHANGE
[$$114]  |PARTITIONED|
+                                                            -- HYBRID_HASH_JOIN [$$106][$$89]
 |PARTITIONED|
+                                                              -- HASH_PARTITION_EXCHANGE
[$$106]  |PARTITIONED|
                                                                 -- STREAM_PROJECT  |PARTITIONED|
                                                                   -- STREAM_SELECT  |PARTITIONED|
                                                                     -- ONE_TO_ONE_EXCHANGE
 |PARTITIONED|
-                                                                      -- SORT_GROUP_BY[$$123,
$$124]  |PARTITIONED|
+                                                                      -- SORT_GROUP_BY[$$115,
$$116]  |PARTITIONED|
                                                                               {
                                                                                 -- AGGREGATE
 |LOCAL|
                                                                                   -- NESTED_TUPLE_SOURCE
 |LOCAL|
                                                                               }
-                                                                        -- HASH_PARTITION_EXCHANGE
[$$123, $$124]  |PARTITIONED|
-                                                                          -- PRE_CLUSTERED_GROUP_BY[$$78,
$$79]  |PARTITIONED|
+                                                                        -- HASH_PARTITION_EXCHANGE
[$$115, $$116]  |PARTITIONED|
+                                                                          -- PRE_CLUSTERED_GROUP_BY[$$70,
$$71]  |PARTITIONED|
                                                                                   {
                                                                                     -- AGGREGATE
 |LOCAL|
                                                                                       --
STREAM_SELECT  |LOCAL|
                                                                                         --
NESTED_TUPLE_SOURCE  |LOCAL|
                                                                                   }
                                                                             -- ONE_TO_ONE_EXCHANGE
 |PARTITIONED|
-                                                                              -- STABLE_SORT
[$$78(ASC), $$79(ASC)]  |PARTITIONED|
+                                                                              -- STABLE_SORT
[$$70(ASC), $$71(ASC)]  |PARTITIONED|
                                                                                 -- ONE_TO_ONE_EXCHANGE
 |PARTITIONED|
                                                                                   -- STREAM_PROJECT
 |PARTITIONED|
                                                                                     -- ONE_TO_ONE_EXCHANGE
 |PARTITIONED|
-                                                                                      --
HYBRID_HASH_JOIN [$$78][$$95]  |PARTITIONED|
-                                                                                        --
HASH_PARTITION_EXCHANGE [$$78]  |PARTITIONED|
+                                                                                      --
HYBRID_HASH_JOIN [$$70][$$87]  |PARTITIONED|
+                                                                                        --
HASH_PARTITION_EXCHANGE [$$70]  |PARTITIONED|
                                                                                         
 -- STREAM_PROJECT  |PARTITIONED|
                                                                                         
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                                                                        
     -- HYBRID_HASH_JOIN [$$89][$$79]  |PARTITIONED|
-                                                                                        
       -- HASH_PARTITION_EXCHANGE [$$89]  |PARTITIONED|
+                                                                                        
     -- HYBRID_HASH_JOIN [$$81][$$71]  |PARTITIONED|
+                                                                                        
       -- HASH_PARTITION_EXCHANGE [$$81]  |PARTITIONED|
                                                                                         
         -- ASSIGN  |PARTITIONED|
                                                                                         
           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                                         
             -- DATASOURCE_SCAN  |PARTITIONED|
@@ -83,12 +83,12 @@
                                                                                         
         -- DATASOURCE_SCAN  |PARTITIONED|
                                                                                         
           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                                         
             -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
-                                                                                        --
HASH_PARTITION_EXCHANGE [$$95]  |PARTITIONED|
+                                                                                        --
HASH_PARTITION_EXCHANGE [$$87]  |PARTITIONED|
                                                                                         
 -- ASSIGN  |PARTITIONED|
                                                                                         
   -- STREAM_PROJECT  |PARTITIONED|
                                                                                         
     -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                                                                        
       -- HYBRID_HASH_JOIN [$$100][$$82]  |PARTITIONED|
-                                                                                        
         -- HASH_PARTITION_EXCHANGE [$$100]  |PARTITIONED|
+                                                                                        
       -- HYBRID_HASH_JOIN [$$92][$$74]  |PARTITIONED|
+                                                                                        
         -- HASH_PARTITION_EXCHANGE [$$92]  |PARTITIONED|
                                                                                         
           -- ASSIGN  |PARTITIONED|
                                                                                         
             -- STREAM_PROJECT  |PARTITIONED|
                                                                                         
               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
@@ -103,12 +103,12 @@
                                                                                         
                   -- DATASOURCE_SCAN  |PARTITIONED|
                                                                                         
                     -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                                         
                       -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
-                                                              -- HASH_PARTITION_EXCHANGE
[$$97]  |PARTITIONED|
+                                                              -- HASH_PARTITION_EXCHANGE
[$$89]  |PARTITIONED|
                                                                 -- ASSIGN  |PARTITIONED|
                                                                   -- STREAM_PROJECT  |PARTITIONED|
                                                                     -- ONE_TO_ONE_EXCHANGE
 |PARTITIONED|
-                                                                      -- HYBRID_HASH_JOIN
[$$102][$$85]  |PARTITIONED|
-                                                                        -- HASH_PARTITION_EXCHANGE
[$$102]  |PARTITIONED|
+                                                                      -- HYBRID_HASH_JOIN
[$$94][$$77]  |PARTITIONED|
+                                                                        -- HASH_PARTITION_EXCHANGE
[$$94]  |PARTITIONED|
                                                                           -- ASSIGN  |PARTITIONED|
                                                                             -- STREAM_PROJECT
 |PARTITIONED|
                                                                               -- ONE_TO_ONE_EXCHANGE
 |PARTITIONED|
@@ -126,12 +126,12 @@
                                                                                         --
DATASOURCE_SCAN  |PARTITIONED|
                                                                                         
 -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                                                                         
   -- EMPTY_TUPLE_SOURCE  |PARTITIONED|
-                                          -- HASH_PARTITION_EXCHANGE [$$99]  |PARTITIONED|
+                                          -- HASH_PARTITION_EXCHANGE [$$91]  |PARTITIONED|
                                             -- ASSIGN  |PARTITIONED|
                                               -- STREAM_PROJECT  |PARTITIONED|
                                                 -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                                                  -- HYBRID_HASH_JOIN [$$104][$$88]  |PARTITIONED|
-                                                    -- HASH_PARTITION_EXCHANGE [$$104]  |PARTITIONED|
+                                                  -- HYBRID_HASH_JOIN [$$96][$$80]  |PARTITIONED|
+                                                    -- HASH_PARTITION_EXCHANGE [$$96]  |PARTITIONED|
                                                       -- ASSIGN  |PARTITIONED|
                                                         -- STREAM_PROJECT  |PARTITIONED|
                                                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/96fd4026/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpcds/query-ASTERIXDB-1596.plan
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpcds/query-ASTERIXDB-1596.plan
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpcds/query-ASTERIXDB-1596.plan
index 7c28d7d..442d1ec 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpcds/query-ASTERIXDB-1596.plan
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpcds/query-ASTERIXDB-1596.plan
@@ -3,16 +3,16 @@
     -- STREAM_PROJECT  |PARTITIONED|
       -- ASSIGN  |PARTITIONED|
         -- STREAM_PROJECT  |PARTITIONED|
-          -- SORT_MERGE_EXCHANGE [$$26(ASC), $$27(ASC) ]  |PARTITIONED|
-            -- STABLE_SORT [$$26(ASC), $$27(ASC)]  |PARTITIONED|
+          -- SORT_MERGE_EXCHANGE [$$23(ASC), $$24(ASC) ]  |PARTITIONED|
+            -- STABLE_SORT [$$23(ASC), $$24(ASC)]  |PARTITIONED|
               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                 -- STREAM_PROJECT  |PARTITIONED|
                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                    -- HYBRID_HASH_JOIN [$$26][$$30]  |PARTITIONED|
-                      -- HASH_PARTITION_EXCHANGE [$$26]  |PARTITIONED|
+                    -- HYBRID_HASH_JOIN [$$23][$$27]  |PARTITIONED|
+                      -- HASH_PARTITION_EXCHANGE [$$23]  |PARTITIONED|
                         -- STREAM_PROJECT  |PARTITIONED|
                           -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                            -- HYBRID_HASH_JOIN [$$27, $$26][$$29, $$28]  |PARTITIONED|
+                            -- HYBRID_HASH_JOIN [$$24, $$23][$$26, $$25]  |PARTITIONED|
                               -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                 -- DATASOURCE_SCAN  |PARTITIONED|
                                   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/96fd4026/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpch/q12_shipping.plan
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpch/q12_shipping.plan
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpch/q12_shipping.plan
index 83fb064..cbcce5d 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpch/q12_shipping.plan
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpch/q12_shipping.plan
@@ -2,14 +2,14 @@
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
     -- STREAM_PROJECT  |PARTITIONED|
       -- ASSIGN  |PARTITIONED|
-        -- SORT_MERGE_EXCHANGE [$$12(ASC) ]  |PARTITIONED|
-          -- SORT_GROUP_BY[$$104]  |PARTITIONED|
+        -- SORT_MERGE_EXCHANGE [$$3(ASC) ]  |PARTITIONED|
+          -- SORT_GROUP_BY[$$95]  |PARTITIONED|
                   {
                     -- AGGREGATE  |LOCAL|
                       -- NESTED_TUPLE_SOURCE  |LOCAL|
                   }
-            -- HASH_PARTITION_EXCHANGE [$$104]  |PARTITIONED|
-              -- SORT_GROUP_BY[$$86]  |PARTITIONED|
+            -- HASH_PARTITION_EXCHANGE [$$95]  |PARTITIONED|
+              -- SORT_GROUP_BY[$$77]  |PARTITIONED|
                       {
                         -- AGGREGATE  |LOCAL|
                           -- NESTED_TUPLE_SOURCE  |LOCAL|
@@ -17,12 +17,12 @@
                 -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                   -- STREAM_PROJECT  |PARTITIONED|
                     -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                      -- HYBRID_HASH_JOIN [$$86][$$93]  |PARTITIONED|
+                      -- HYBRID_HASH_JOIN [$$77][$$84]  |PARTITIONED|
                         -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                           -- STREAM_PROJECT  |PARTITIONED|
                             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                              -- HYBRID_HASH_JOIN [$$95][$$90]  |PARTITIONED|
-                                -- HASH_PARTITION_EXCHANGE [$$95]  |PARTITIONED|
+                              -- HYBRID_HASH_JOIN [$$86][$$81]  |PARTITIONED|
+                                -- HASH_PARTITION_EXCHANGE [$$86]  |PARTITIONED|
                                   -- STREAM_PROJECT  |PARTITIONED|
                                     -- STREAM_SELECT  |PARTITIONED|
                                       -- ASSIGN  |PARTITIONED|

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/96fd4026/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpch/q12_shipping_broadcast.plan
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpch/q12_shipping_broadcast.plan
b/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpch/q12_shipping_broadcast.plan
index 87bf5bf..cd7e6da 100644
--- a/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpch/q12_shipping_broadcast.plan
+++ b/asterixdb/asterix-app/src/test/resources/optimizerts/results/tpch/q12_shipping_broadcast.plan
@@ -2,14 +2,14 @@
   -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
     -- STREAM_PROJECT  |PARTITIONED|
       -- ASSIGN  |PARTITIONED|
-        -- SORT_MERGE_EXCHANGE [$$12(ASC) ]  |PARTITIONED|
-          -- SORT_GROUP_BY[$$104]  |PARTITIONED|
+        -- SORT_MERGE_EXCHANGE [$$3(ASC) ]  |PARTITIONED|
+          -- SORT_GROUP_BY[$$95]  |PARTITIONED|
                   {
                     -- AGGREGATE  |LOCAL|
                       -- NESTED_TUPLE_SOURCE  |LOCAL|
                   }
-            -- HASH_PARTITION_EXCHANGE [$$104]  |PARTITIONED|
-              -- SORT_GROUP_BY[$$86]  |PARTITIONED|
+            -- HASH_PARTITION_EXCHANGE [$$95]  |PARTITIONED|
+              -- SORT_GROUP_BY[$$77]  |PARTITIONED|
                       {
                         -- AGGREGATE  |LOCAL|
                           -- NESTED_TUPLE_SOURCE  |LOCAL|
@@ -17,11 +17,11 @@
                 -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                   -- STREAM_PROJECT  |PARTITIONED|
                     -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                      -- HYBRID_HASH_JOIN [$$86][$$93]  |PARTITIONED|
+                      -- HYBRID_HASH_JOIN [$$77][$$84]  |PARTITIONED|
                         -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                           -- STREAM_PROJECT  |PARTITIONED|
                             -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
-                              -- HYBRID_HASH_JOIN [$$94][$$90]  |PARTITIONED|
+                              -- HYBRID_HASH_JOIN [$$85][$$81]  |PARTITIONED|
                                 -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
                                   -- STREAM_PROJECT  |PARTITIONED|
                                     -- STREAM_SELECT  |PARTITIONED|

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/96fd4026/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/user-defined-functions/query-ASTERIXDB-1875/query-ASTERIXDB-1298.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/user-defined-functions/query-ASTERIXDB-1875/query-ASTERIXDB-1298.1.ddl.sqlpp
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/user-defined-functions/query-ASTERIXDB-1875/query-ASTERIXDB-1298.1.ddl.sqlpp
new file mode 100644
index 0000000..6821a8a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/user-defined-functions/query-ASTERIXDB-1875/query-ASTERIXDB-1298.1.ddl.sqlpp
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+
+
+drop dataverse channels if exists;
+create dataverse channels;
+
+use channels;
+create function cat(str1,str2)
+{ concat(str1,str2) }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/96fd4026/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/user-defined-functions/query-ASTERIXDB-1875/query-ASTERIXDB-1298.2.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/user-defined-functions/query-ASTERIXDB-1875/query-ASTERIXDB-1298.2.query.sqlpp
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/user-defined-functions/query-ASTERIXDB-1875/query-ASTERIXDB-1298.2.query.sqlpp
new file mode 100644
index 0000000..b29a195
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/user-defined-functions/query-ASTERIXDB-1875/query-ASTERIXDB-1298.2.query.sqlpp
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+USE channels;
+
+with result as cat("Asterix","DB")
+select value result;
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/96fd4026/asterixdb/asterix-app/src/test/resources/runtimets/results/user-defined-functions/query-ASTERIXDB-1875/query-ASTERIXDB-1875.1.adm
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/user-defined-functions/query-ASTERIXDB-1875/query-ASTERIXDB-1875.1.adm
b/asterixdb/asterix-app/src/test/resources/runtimets/results/user-defined-functions/query-ASTERIXDB-1875/query-ASTERIXDB-1875.1.adm
new file mode 100644
index 0000000..4efc5cb
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/user-defined-functions/query-ASTERIXDB-1875/query-ASTERIXDB-1875.1.adm
@@ -0,0 +1 @@
+"AsterixDB"

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/96fd4026/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/SqlppQueryRewriter.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/SqlppQueryRewriter.java
b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/SqlppQueryRewriter.java
index f303a6c..fb5a6fb 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/SqlppQueryRewriter.java
+++ b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/SqlppQueryRewriter.java
@@ -120,6 +120,10 @@ class SqlppQueryRewriter implements IQueryRewriter {
         // Generate ids for variables (considering scopes) and replace global variable access
with the dataset function.
         variableCheckAndRewrite(true);
 
+        // Inlines WITH expressions after variableCheckAndRewrite(...) so that the variable
scoping for WITH
+        // expression is correct.
+        inlineWithExpressions();
+
         // Rewrites several variable-arg functions into their corresponding internal list-input
functions.
         rewriteListInputFunctions();
 
@@ -139,10 +143,6 @@ class SqlppQueryRewriter implements IQueryRewriter {
         // Replace global variable access with the dataset function for inlined expressions.
         variableCheckAndRewrite(true);
 
-        // Inlines WITH expressions after variableCheckAndRewrite(...) so that the variable
scoping for WITH
-        // expression is correct.
-        inlineWithExpressions();
-
         // Sets the var counter of the query.
         topStatement.setVarCounter(context.getVarCounter());
     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/96fd4026/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppSimpleExpressionVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppSimpleExpressionVisitor.java
b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppSimpleExpressionVisitor.java
index d754702..a2e43a2 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppSimpleExpressionVisitor.java
+++ b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppSimpleExpressionVisitor.java
@@ -216,6 +216,9 @@ public class AbstractSqlppSimpleExpressionVisitor
         for (GbyVariableExpressionPair gbyVarExpr : gc.getGbyPairList()) {
             gbyVarExpr.setExpr(visit(gbyVarExpr.getExpr(), gc));
         }
+        for (GbyVariableExpressionPair decVarExpr : gc.getDecorPairList()) {
+            decVarExpr.setExpr(visit(decVarExpr.getExpr(), gc));
+        }
         return null;
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/96fd4026/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
index e6a2951..67c742a 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
+++ b/asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
@@ -162,8 +162,8 @@ import org.apache.asterix.lang.sqlpp.optype.SetOpType;
 import org.apache.asterix.lang.sqlpp.struct.SetOperationInput;
 import org.apache.asterix.lang.sqlpp.struct.SetOperationRight;
 import org.apache.asterix.lang.sqlpp.util.ExpressionToVariableUtil;
+import org.apache.asterix.lang.sqlpp.util.FunctionMapUtil;
 import org.apache.asterix.lang.sqlpp.util.SqlppVariableUtil;
-import org.apache.asterix.metadata.utils.MetadataConstants;
 import org.apache.hyracks.algebricks.common.utils.Pair;
 import org.apache.hyracks.algebricks.common.utils.Triple;
 import org.apache.hyracks.algebricks.core.algebra.expressions.IExpressionAnnotation;
@@ -2514,7 +2514,7 @@ Expression FunctionCallExpr() throws ParseException:
       if (signature == null) {
         signature = new FunctionSignature(funcName.dataverse, fqFunctionName, arity);
       }
-      callExpr = new CallExpr(signature,argList);
+      callExpr = FunctionMapUtil.normalizedListInputFunctions(new CallExpr(signature,argList));
       if (hint != null) {
         if (hint.startsWith(INDEXED_NESTED_LOOP_JOIN_HINT)) {
           callExpr.addHint(IndexedNLJoinExpressionAnnotation.INSTANCE);


Mime
View raw message