ASTERIXDB-1539: add function mapping for AQL.
- allow all SQL++/AQL functions to be "_"-based;
- still accept "-"-based functions.
Change-Id: I6ab87a02c8c270535059bdec8281c72801418551
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1210
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/tpch/q07_volume_shipping/q07_volume_shipping.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/tpch/q07_volume_shipping/q07_volume_shipping.3.query.aql
index 6471872..3c61193 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/tpch/q07_volume_shipping/q07_volume_shipping.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/tpch/q07_volume_shipping/q07_volume_shipping.3.query.aql
@@ -19,13 +19,13 @@
use dataverse tpch;
declare function q7_volume_shipping_tmp() {
- for $n1 in dataset('Nation')
+ for $n1 in dataset('Nation')
for $n2 in dataset('Nation')
- where $n2.n_name='GERMANY' or $n1.n_name='GERMANY'
+ where $n2.n_name='GERMANY' or $n1.n_name='GERMANY'
return {
- "supp_nation": $n1.n_name,
- "cust_nation": $n2.n_name,
- "s_nationkey": $n1.n_nationkey,
+ "supp_nation": $n1.n_name,
+ "cust_nation": $n2.n_name,
+ "s_nationkey": $n1.n_nationkey,
"c_nationkey": $n2.n_nationkey
}
}
@@ -35,47 +35,47 @@
for $lo in (
for $l in dataset('LineItem')
for $o in dataset('Orders')
- where $o.o_orderkey = $l.l_orderkey and $l.l_shipdate >= '1992-01-01'
+ where $o.o_orderkey = $l.l_orderkey and $l.l_shipdate >= '1992-01-01'
and $l.l_shipdate <= '1996-12-31'
return {
- "l_shipdate": $l.l_shipdate,
- "l_extendedprice": $l.l_extendedprice,
- "l_discount": $l.l_discount,
- "l_suppkey": $l.l_suppkey,
- "o_custkey": $o.o_custkey
+ "l_shipdate": $l.l_shipdate,
+ "l_extendedprice": $l.l_extendedprice,
+ "l_discount": $l.l_discount,
+ "l_suppkey": $l.l_suppkey,
+ "o_custkey": $o.o_custkey
}
)
for $c in dataset('Customer')
where $c.c_custkey = $lo.o_custkey
return {
- "l_shipdate": $lo.l_shipdate,
- "l_extendedprice": $lo.l_extendedprice,
- "l_discount": $lo.l_discount,
- "l_suppkey": $lo.l_suppkey,
- "c_nationkey": $c.c_nationkey
+ "l_shipdate": $lo.l_shipdate,
+ "l_extendedprice": $lo.l_extendedprice,
+ "l_discount": $lo.l_discount,
+ "l_suppkey": $lo.l_suppkey,
+ "c_nationkey": $c.c_nationkey
}
)
for $s in dataset('Supplier')
where $s.s_suppkey = $loc.l_suppkey
return {
- "l_shipdate": $loc.l_shipdate,
- "l_extendedprice": $loc.l_extendedprice,
- "l_discount": $loc.l_discount,
- "c_nationkey": $loc.c_nationkey,
+ "l_shipdate": $loc.l_shipdate,
+ "l_extendedprice": $loc.l_extendedprice,
+ "l_discount": $loc.l_discount,
+ "c_nationkey": $loc.c_nationkey,
"s_nationkey": $s.s_nationkey
}
)
for $t in q7_volume_shipping_tmp()
where $locs.c_nationkey = $t.c_nationkey
and $locs.s_nationkey = $t.s_nationkey
-let $l_year0 := get-year($locs.l_shipdate)
+let $l_year0 := get_year($locs.l_shipdate)
group by $supp_nation := $t.supp_nation, $cust_nation := $t.cust_nation, $l_year := $l_year0
with $locs
let $revenue := sum(for $i in $locs return $i.l_extendedprice * (1 - $i.l_discount))
order by $supp_nation, $cust_nation, $l_year
return {
- "supp_nation": $supp_nation,
- "cust_nation": $cust_nation,
+ "supp_nation": $supp_nation,
+ "cust_nation": $cust_nation,
"l_year": $l_year,
"revenue": $revenue
}
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/tpch/q08_national_market_share/q08_national_market_share.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/tpch/q08_national_market_share/q08_national_market_share.3.query.aql
index b8afdf4..bb57a0d 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/tpch/q08_national_market_share/q08_national_market_share.3.query.aql
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/tpch/q08_national_market_share/q08_national_market_share.3.query.aql
@@ -39,42 +39,42 @@
)
where $nrc.c_custkey = $o.o_custkey
return {
- "o_orderdate" : $o.o_orderdate,
- "o_orderkey": $o.o_orderkey
+ "o_orderdate" : $o.o_orderdate,
+ "o_orderkey": $o.o_orderkey
}
)
where $l.l_orderkey = $nrco.o_orderkey
- and $nrco.o_orderdate >= '1995-01-01'
+ and $nrco.o_orderdate >= '1995-01-01'
and $nrco.o_orderdate < '1996-12-31'
return {
- "o_orderdate": $nrco.o_orderdate,
- "l_partkey": $l.l_partkey,
- "l_discount": $l.l_discount,
- "l_extendedprice": $l.l_extendedprice,
+ "o_orderdate": $nrco.o_orderdate,
+ "l_partkey": $l.l_partkey,
+ "l_discount": $l.l_discount,
+ "l_extendedprice": $l.l_extendedprice,
"l_suppkey": $l.l_suppkey
}
)
for $p in dataset("Part")
where $p.p_partkey = $lnrco.l_partkey and $p.p_type = 'ECONOMY ANODIZED STEEL'
return {
- "o_orderdate": $lnrco.o_orderdate,
- "l_discount": $lnrco.l_discount,
- "l_extendedprice": $lnrco.l_extendedprice,
- "l_suppkey": $lnrco.l_suppkey
+ "o_orderdate": $lnrco.o_orderdate,
+ "l_discount": $lnrco.l_discount,
+ "l_extendedprice": $lnrco.l_extendedprice,
+ "l_suppkey": $lnrco.l_suppkey
}
)
where $s.s_suppkey = $lnrcop.l_suppkey
return {
- "o_orderdate": $lnrcop.o_orderdate,
- "l_discount": $lnrcop.l_discount,
- "l_extendedprice": $lnrcop.l_extendedprice,
- "l_suppkey": $lnrcop.l_suppkey,
+ "o_orderdate": $lnrcop.o_orderdate,
+ "l_discount": $lnrcop.l_discount,
+ "l_extendedprice": $lnrcop.l_extendedprice,
+ "l_suppkey": $lnrcop.l_suppkey,
"s_nationkey": $s.s_nationkey
}
)
for $n2 in dataset('Nation')
where $slnrcop.s_nationkey = $n2.n_nationkey
- let $o_year := get-year($slnrcop.o_orderdate)
+ let $o_year := GET_YEAR($slnrcop.o_orderdate)
return {
"year": $o_year,
"revenue": $slnrcop.l_extendedprice *(1-$slnrcop.l_discount),
@@ -85,7 +85,7 @@
order by $year
return {
"year": $year,
- "mkt_share": sum(for $i in $t return switch-case($i.s_name='BRAZIL', true, $i.revenue, false, 0.0))/
+ "mkt_share": sum(for $i in $t return switch-case($i.s_name='BRAZIL', true, $i.revenue, false, 0.0))/
sum(for $i in $t return $i.revenue)
}
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null/agg_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null/agg_null.3.query.sqlpp
index eef6201..882a615 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null/agg_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null/agg_null.3.query.sqlpp
@@ -22,4 +22,4 @@
* Date : Feb 7th 2014
*/
-{'sql-count1':`array_sql-count`([null]),'average1':`array_sql-avg`([null]),'sql-sum1':`array_sql-sum`([null]),'sql-min1':`array_sql-min`([null]),'sql-max1':`array_sql-max`([null]),'sql-count2':`array_sql-count`({{null,null}}),'average2':`array_sql-avg`({{null,null}}),'sql-sum2':`array_sql-sum`({{null,null}}),'sql-min2':`array_sql-min`({{null,null}}),'sql-max2':`array_sql-max`({{null,null}})};
+{'sql-count1':array_sql_count([null]),'average1':array_sql_avg([null]),'sql-sum1':array_sql_sum([null]),'sql-min1':array_sql_min([null]),'sql-max1':array_sql_max([null]),'sql-count2':array_sql_count({{null,null}}),'average2':array_sql_avg({{null,null}}),'sql-sum2':array_sql_sum({{null,null}}),'sql-min2':array_sql_min({{null,null}}),'sql-max2':array_sql_max({{null,null}})};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null_rec/agg_null_rec.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null_rec/agg_null_rec.3.query.sqlpp
index 7d20368..9993664 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null_rec/agg_null_rec.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null_rec/agg_null_rec.3.query.sqlpp
@@ -25,19 +25,19 @@
use test;
-{'sql-count':test.`array_sql-count`((
+{'sql-count':test.array_sql_count((
select element t.valplus
from Test as t
-)),'average':test.`array_sql-avg`((
+)),'average':test.array_sql_avg((
select element t.valplus
from Test as t
-)),'sql-sum':test.`array_sql-sum`((
+)),'sql-sum':test.array_sql_sum((
select element t.valplus
from Test as t
-)),'sql-min':test.`array_sql-min`((
+)),'sql-min':test.array_sql_min((
select element t.valplus
from Test as t
-)),'sql-max':test.`array_sql-max`((
+)),'sql-max':test.array_sql_max((
select element t.valplus
from Test as t
))};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null_rec_1/agg_null_rec_1.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null_rec_1/agg_null_rec_1.3.query.sqlpp
index b0c4f39..0a17057 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null_rec_1/agg_null_rec_1.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null_rec_1/agg_null_rec_1.3.query.sqlpp
@@ -25,28 +25,28 @@
use test;
-{'sql-count':test.`array_sql-count`((
+{'sql-count':test.array_sql_count((
select element t
from Test as t
-)),'average':test.`array_sql-avg`((
+)),'average':test.array_sql_avg((
select element i.val
from (
select element t
from Test as t
) as i
-)),'sql-sum':test.`array_sql-sum`((
+)),'sql-sum':test.array_sql_sum((
select element i.val
from (
select element t
from Test as t
) as i
-)),'sql-min':test.`array_sql-min`((
+)),'sql-min':test.array_sql_min((
select element i.valplus
from (
select element t
from Test as t
) as i
-)),'sql-max':test.`array_sql-max`((
+)),'sql-max':test.array_sql_max((
select element i.valplus
from (
select element t
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_number/agg_number.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_number/agg_number.3.query.sqlpp
index 407f237..a3308af 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_number/agg_number.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_number/agg_number.3.query.sqlpp
@@ -22,4 +22,4 @@
* Date : Feb 7th 2014
*/
-{'sql-count1':`array_sql-count`([float('2.0'),double('3.0'),93847382783847382,1]),'average1':`array_sql-avg`([float('2.0'),double('3.0'),93847382783847382,1]),'sql-sum1':`array_sql-sum`([float('2.0'),double('3.0'),93847382783847382,1]),'sql-min1':`array_sql-min`([float('2.0'),double('3.0'),93847382783847382,1]),'sql-max1':`array_sql-max`([float('2.0'),double('3.0'),93847382783847382,1]),'sql-count2':`array_sql-count`({{float('2.0'),double('3.0'),93847382783847382,1}}),'average2':`array_sql-avg`({{float('2.0'),double('3.0'),93847382783847382,1}}),'sql-sum2':`array_sql-sum`({{float('2.0'),double('3.0'),93847382783847382,1}}),'sql-min2':`array_sql-min`({{float('2.0'),double('3.0'),93847382783847382,1}}),'sql-max2':`array_sql-max`({{float('2.0'),double('3.0'),93847382783847382,1}})};
+{'sql-count1':array_sql_count([float('2.0'),double('3.0'),93847382783847382,1]),'average1':array_sql_avg([float('2.0'),double('3.0'),93847382783847382,1]),'sql-sum1':array_sql_sum([float('2.0'),double('3.0'),93847382783847382,1]),'sql-min1':array_sql_min([float('2.0'),double('3.0'),93847382783847382,1]),'sql-max1':array_sql_max([float('2.0'),double('3.0'),93847382783847382,1]),'sql-count2':array_sql_count({{float('2.0'),double('3.0'),93847382783847382,1}}),'average2':array_sql_avg({{float('2.0'),double('3.0'),93847382783847382,1}}),'sql-sum2':array_sql_sum({{float('2.0'),double('3.0'),93847382783847382,1}}),'sql-min2':array_sql_min({{float('2.0'),double('3.0'),93847382783847382,1}}),'sql-max2':array_sql_max({{float('2.0'),double('3.0'),93847382783847382,1}})};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_number_rec/agg_number_rec.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_number_rec/agg_number_rec.3.query.sqlpp
index 85fe388..bd70811 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_number_rec/agg_number_rec.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_number_rec/agg_number_rec.3.query.sqlpp
@@ -25,19 +25,19 @@
use test;
-{'sql-count':test.`array_sql-count`((
+{'sql-count':test.array_sql_count((
select element t.valplus
from Test as t
-)),'average':test.`array_sql-avg`((
+)),'average':test.array_sql_avg((
select element t.valplus
from Test as t
-)),'sql-sum':test.`array_sql-sum`((
+)),'sql-sum':test.array_sql_sum((
select element t.valplus
from Test as t
-)),'sql-min':test.`array_sql-min`((
+)),'sql-min':test.array_sql_min((
select element t.valplus
from Test as t
-)),'sql-max':test.`array_sql-max`((
+)),'sql-max':test.array_sql_max((
select element t.valplus
from Test as t
))};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_double/avg_double.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_double/avg_double.3.query.sqlpp
index 20f441e..6b2de79 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_double/avg_double.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_double/avg_double.3.query.sqlpp
@@ -17,7 +17,7 @@
* under the License.
*/
-select element `array_sql-avg`((
+select element array_sql_avg((
select element x
from [1.0,2.0,double('3.0')] as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_double_null/avg_double_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_double_null/avg_double_null.3.query.sqlpp
index 6b96901..b395904 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_double_null/avg_double_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_double_null/avg_double_null.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-{'average':test.`array_sql-avg`((
+{'average':test.array_sql_avg((
select element x.doubleField
from Numeric as x
))};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.3.query.sqlpp
index afde53e..05e4590 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.3.query.sqlpp
@@ -25,7 +25,7 @@
use test;
-select element test.`array_sql-avg`((
+select element test.array_sql_avg((
select element x
from [1,2,3] as x
where (x > 10)
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.3.query.sqlpp
index 9f72341..2a0b2dc 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.3.query.sqlpp
@@ -25,7 +25,7 @@
use test;
-select element test.`array_sql-avg`((
+select element test.array_sql_avg((
select element x.val
from Test as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_float/avg_float.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_float/avg_float.3.query.sqlpp
index cd83470..dfd8f57 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_float/avg_float.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_float/avg_float.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-avg`((
+select element test.array_sql_avg((
select element x
from [test.float('1'),test.float('2'),test.float('3')] as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_float_null/avg_float_nu.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_float_null/avg_float_nu.3.query.sqlpp
index b0c982e..0649826 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_float_null/avg_float_nu.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_float_null/avg_float_nu.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-{'average':test.`array_sql-avg`((
+{'average':test.array_sql_avg((
select element x.floatField
from Numeric as x
))};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int16/avg_int16.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int16/avg_int16.3.query.sqlpp
index 5e29f15..46ead9e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int16/avg_int16.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int16/avg_int16.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-avg`((
+select element test.array_sql_avg((
select element x
from [test.smallint('1'),test.smallint('2'),test.smallint('3')] as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int16_null/avg_int16_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int16_null/avg_int16_null.3.query.sqlpp
index 74174f4..ed6289c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int16_null/avg_int16_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int16_null/avg_int16_null.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-{'average':test.`array_sql-avg`((
+{'average':test.array_sql_avg((
select element x.int16Field
from Numeric as x
))};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int32/avg_int32.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int32/avg_int32.3.query.sqlpp
index f08fbad..17df72d 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int32/avg_int32.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int32/avg_int32.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-avg`((
+select element test.array_sql_avg((
select element x
from [test.integer('1'),test.integer('2'),test.integer('3')] as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int32_null/avg_int32_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int32_null/avg_int32_null.3.query.sqlpp
index 32f2405..9721836 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int32_null/avg_int32_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int32_null/avg_int32_null.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-{'average':test.`array_sql-avg`((
+{'average':test.array_sql_avg((
select element x.int32Field
from Numeric as x
))};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int64/avg_int64.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int64/avg_int64.3.query.sqlpp
index 1017a69..53a796f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int64/avg_int64.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int64/avg_int64.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-avg`((
+select element test.array_sql_avg((
select element x
from [test.bigint('1'),test.bigint('2'),test.bigint('3')] as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int64_null/avg_int64_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int64_null/avg_int64_null.3.query.sqlpp
index 48ac889..978180c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int64_null/avg_int64_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int64_null/avg_int64_null.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-{'average':test.`array_sql-avg`((
+{'average':test.array_sql_avg((
select element x.int64Field
from Numeric as x
))};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int8/avg_int8.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int8/avg_int8.3.query.sqlpp
index 60303ea..b74f96b 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int8/avg_int8.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int8/avg_int8.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-avg`((
+select element test.array_sql_avg((
select element x
from [test.tinyint('1'),test.tinyint('2'),test.tinyint('3')] as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int8_null/avg_int8_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int8_null/avg_int8_null.3.query.sqlpp
index 84894d0..20a5e70 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int8_null/avg_int8_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int8_null/avg_int8_null.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-{'average':test.`array_sql-avg`((
+{'average':test.array_sql_avg((
select element x.int8Field
from Numeric as x
))};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_mixed/avg_mixed.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_mixed/avg_mixed.3.query.sqlpp
index c930673..16a5fee 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_mixed/avg_mixed.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_mixed/avg_mixed.3.query.sqlpp
@@ -22,7 +22,7 @@
* Date : Feb 7th 2014
*/
-select element `array_sql-avg`((
+select element array_sql_avg((
select element x
from [float('2.0'),'hello world',93847382783847382,date('2013-01-01')] as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/count_01/count_01.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/count_01/count_01.3.query.sqlpp
index 65ed13e..5233bc8 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/count_01/count_01.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/count_01/count_01.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-count`((
+select element test.array_sql_count((
select element x
from [1,2,3] as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/count_empty_01/count_empty_01.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/count_empty_01/count_empty_01.3.query.sqlpp
index 924d044..508416e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/count_empty_01/count_empty_01.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/count_empty_01/count_empty_01.3.query.sqlpp
@@ -22,7 +22,7 @@
* Success : Yes
*/
-select element `array_sql-count`((
+select element array_sql_count((
select element x
from [1,2,3] as x
where (x > 10)
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/count_empty_02/count_empty_02.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/count_empty_02/count_empty_02.3.query.sqlpp
index 42efee1..b66d996 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/count_empty_02/count_empty_02.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/count_empty_02/count_empty_02.3.query.sqlpp
@@ -25,7 +25,7 @@
use test;
-select element test.`array_sql-count`((
+select element test.array_sql_count((
select element x.val
from Test as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/count_null/count_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/count_null/count_null.3.query.sqlpp
index 4ba13fe..e0ed488 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/count_null/count_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/count_null/count_null.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-{'sql-count':test.`array_sql-count`((
+{'sql-count':test.array_sql_count((
select element x.doubleField
from Numeric as x
))};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue395/issue395.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue395/issue395.3.query.sqlpp
index cabe2ad..e0d7476 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue395/issue395.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue395/issue395.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-count`((
+select element test.array_sql_count((
select element l.name
from Employee as l
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue412_0/issue412_0.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue412_0/issue412_0.3.query.sqlpp
index e739362..7130acd 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue412_0/issue412_0.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue412_0/issue412_0.3.query.sqlpp
@@ -17,4 +17,4 @@
* under the License.
*/
-`array_sql-count`(['ASTERIX','Hyracks',null]);
+array_sql_count(['ASTERIX','Hyracks',null]);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue412_1/issue412_1.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue412_1/issue412_1.3.query.sqlpp
index d69d8e6..468f62c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue412_1/issue412_1.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue412_1/issue412_1.3.query.sqlpp
@@ -17,4 +17,4 @@
* under the License.
*/
-{'sql-count':`array_sql-count`([1,60,null]),'average':`array_sql-avg`([1,60,null]),'sql-sum':`array_sql-sum`([1,60,null]),'sql-min':`array_sql-min`([1,60,null]),'sql-max':`array_sql-max`([1,60,null])};
+{'sql-count':array_sql_count([1,60,null]),'average':array_sql_avg([1,60,null]),'sql-sum':array_sql_sum([1,60,null]),'sql-min':array_sql_min([1,60,null]),'sql-max':array_sql_max([1,60,null])};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue425_min_hetero_list/issue425_min_hetero_list.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue425_min_hetero_list/issue425_min_hetero_list.3.query.sqlpp
index 3c65903..5c4ab77 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue425_min_hetero_list/issue425_min_hetero_list.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue425_min_hetero_list/issue425_min_hetero_list.3.query.sqlpp
@@ -17,4 +17,4 @@
* under the License.
*/
-`array_sql-min`([23,748374857483]);
+array_sql_min([23,748374857483]);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue425_min_hetero_list_1/issue425_min_hetero_list_1.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue425_min_hetero_list_1/issue425_min_hetero_list_1.3.query.sqlpp
index 1e90742..6f12e6c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue425_min_hetero_list_1/issue425_min_hetero_list_1.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue425_min_hetero_list_1/issue425_min_hetero_list_1.3.query.sqlpp
@@ -17,4 +17,4 @@
* under the License.
*/
-`array_sql-min`([748374857483,23,0.5]);
+array_sql_min([748374857483,23,0.5]);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue425_sum_hetero_list/issue425_sum_hetero_list.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue425_sum_hetero_list/issue425_sum_hetero_list.3.query.sqlpp
index 8dedad9..efea5db 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue425_sum_hetero_list/issue425_sum_hetero_list.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue425_sum_hetero_list/issue425_sum_hetero_list.3.query.sqlpp
@@ -17,4 +17,4 @@
* under the License.
*/
-`array_sql-sum`([23,748374857483]);
+array_sql_sum([23,748374857483]);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue425_sum_hetero_list_1/issue425_sum_hetero_list_1.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue425_sum_hetero_list_1/issue425_sum_hetero_list_1.3.query.sqlpp
index 1530a94..6a86473 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue425_sum_hetero_list_1/issue425_sum_hetero_list_1.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue425_sum_hetero_list_1/issue425_sum_hetero_list_1.3.query.sqlpp
@@ -17,4 +17,4 @@
* under the License.
*/
-`array_sql-sum`([748374857483,23,0.5]);
+array_sql_sum([748374857483,23,0.5]);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue531_string_min_max/issue531_string_min_max.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue531_string_min_max/issue531_string_min_max.3.query.sqlpp
index 9387a43..0913cf3 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue531_string_min_max/issue531_string_min_max.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/issue531_string_min_max/issue531_string_min_max.3.query.sqlpp
@@ -27,10 +27,10 @@
use test;
-select element {'sql-min':test.`array_sql-min`((
+select element {'sql-min':test.array_sql_min((
select element l.name
from t1 as l
- )),'sql-max':test.`array_sql-max`((
+ )),'sql-max':test.array_sql_max((
select element l.name
from t1 as l
))};
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/max_empty_01/max_empty_01.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/max_empty_01/max_empty_01.3.query.sqlpp
index ea844a9..788352c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/max_empty_01/max_empty_01.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/max_empty_01/max_empty_01.3.query.sqlpp
@@ -25,7 +25,7 @@
use test;
-select element test.`array_sql-max`((
+select element test.array_sql_max((
select element x
from [1,2,3] as x
where (x > 10)
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/max_empty_02/max_empty_02.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/max_empty_02/max_empty_02.3.query.sqlpp
index c0a6062..02b028f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/max_empty_02/max_empty_02.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/max_empty_02/max_empty_02.3.query.sqlpp
@@ -25,7 +25,7 @@
use test;
-select element test.`array_sql-max`((
+select element test.array_sql_max((
select element x.val
from Test as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/min_empty_01/min_empty_01.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/min_empty_01/min_empty_01.3.query.sqlpp
index 330bd4d..07a8b68 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/min_empty_01/min_empty_01.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/min_empty_01/min_empty_01.3.query.sqlpp
@@ -25,7 +25,7 @@
use test;
-select element test.`array_sql-min`((
+select element test.array_sql_min((
select element x
from [1,2,3] as x
where (x > 10)
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/min_empty_02/min_empty_02.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/min_empty_02/min_empty_02.3.query.sqlpp
index 8362863..885a01c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/min_empty_02/min_empty_02.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/min_empty_02/min_empty_02.3.query.sqlpp
@@ -25,7 +25,7 @@
use test;
-select element test.`array_sql-min`((
+select element test.array_sql_min((
select element x.val
from Test as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/min_mixed/min_mixed.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/min_mixed/min_mixed.3.query.sqlpp
index 36aea5e..9549c75 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/min_mixed/min_mixed.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/min_mixed/min_mixed.3.query.sqlpp
@@ -22,7 +22,7 @@
* Date : Feb 7th 2014
*/
-select element `array_sql-min`((
+select element array_sql_min((
select element x
from [float('2.0'),'hello world',93847382783847382,date('2013-01-01')] as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/query-issue400/query-issue400.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/query-issue400/query-issue400.3.query.sqlpp
index 044009b..ac63d3f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/query-issue400/query-issue400.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/query-issue400/query-issue400.3.query.sqlpp
@@ -17,6 +17,6 @@
* under the License.
*/
-`array_sql-count`((select element i
+array_sql_count((select element i
from [[1,2,3,4,5],[6,7,8,9]] as i
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_avg/scalar_avg.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_avg/scalar_avg.3.query.sqlpp
index db8740d..f4b35d7 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_avg/scalar_avg.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_avg/scalar_avg.3.query.sqlpp
@@ -24,12 +24,12 @@
use test;
-with i8 as test.`array_sql-avg`([test.tinyint('1'),test.tinyint('2'),test.tinyint('3')]),
- i16 as test.`array_sql-avg`([test.smallint('1'),test.smallint('2'),test.smallint('3')]),
- i32 as test.`array_sql-avg`([test.integer('1'),test.integer('2'),test.integer('3')]),
- i64 as test.`array_sql-avg`([test.bigint('1'),test.bigint('2'),test.bigint('3')]),
- f as test.`array_sql-avg`([test.float('1'),test.float('2'),test.float('3')]),
- d as test.`array_sql-avg`([test.double('1'),test.double('2'),test.double('3')])
+with i8 as test.array_sql_avg([test.tinyint('1'),test.tinyint('2'),test.tinyint('3')]),
+ i16 as test.array_sql_avg([test.smallint('1'),test.smallint('2'),test.smallint('3')]),
+ i32 as test.array_sql_avg([test.integer('1'),test.integer('2'),test.integer('3')]),
+ i64 as test.array_sql_avg([test.bigint('1'),test.bigint('2'),test.bigint('3')]),
+ f as test.array_sql_avg([test.float('1'),test.float('2'),test.float('3')]),
+ d as test.array_sql_avg([test.double('1'),test.double('2'),test.double('3')])
select element i
from [i8,i16,i32,i64,f,d] as i
;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_avg_empty/scalar_avg_empty.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_avg_empty/scalar_avg_empty.3.query.sqlpp
index dfbd07b..d2378c8 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_avg_empty/scalar_avg_empty.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_avg_empty/scalar_avg_empty.3.query.sqlpp
@@ -21,4 +21,4 @@
* Success : Yes
*/
-select element `array_sql-avg`([]);
+select element array_sql_avg([]);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_avg_null/scalar_avg_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_avg_null/scalar_avg_null.3.query.sqlpp
index 5cac403..d22c356 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_avg_null/scalar_avg_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_avg_null/scalar_avg_null.3.query.sqlpp
@@ -24,12 +24,12 @@
use test;
-with i8 as test.`array_sql-avg`([test.tinyint('1'),test.tinyint('2'),test.tinyint('3'),null]),
- i16 as test.`array_sql-avg`([test.smallint('1'),test.smallint('2'),test.smallint('3'),null]),
- i32 as test.`array_sql-avg`([test.integer('1'),test.integer('2'),test.integer('3'),null]),
- i64 as test.`array_sql-avg`([test.bigint('1'),test.bigint('2'),test.bigint('3'),null]),
- f as test.`array_sql-avg`([test.float('1'),test.float('2'),test.float('3'),null]),
- d as test.`array_sql-avg`([test.double('1'),test.double('2'),test.double('3'),null])
+with i8 as test.array_sql_avg([test.tinyint('1'),test.tinyint('2'),test.tinyint('3'),null]),
+ i16 as test.array_sql_avg([test.smallint('1'),test.smallint('2'),test.smallint('3'),null]),
+ i32 as test.array_sql_avg([test.integer('1'),test.integer('2'),test.integer('3'),null]),
+ i64 as test.array_sql_avg([test.bigint('1'),test.bigint('2'),test.bigint('3'),null]),
+ f as test.array_sql_avg([test.float('1'),test.float('2'),test.float('3'),null]),
+ d as test.array_sql_avg([test.double('1'),test.double('2'),test.double('3'),null])
select element i
from [i8,i16,i32,i64,f,d] as i
;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_count/scalar_count.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_count/scalar_count.3.query.sqlpp
index b47850b..caae087 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_count/scalar_count.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_count/scalar_count.3.query.sqlpp
@@ -24,13 +24,13 @@
use test;
-with i8 as test.`array_sql-count`([test.tinyint('1'),test.tinyint('2'),test.tinyint('3')]),
- i16 as test.`array_sql-count`([test.smallint('1'),test.smallint('2'),test.smallint('3')]),
- i32 as test.`array_sql-count`([test.integer('1'),test.integer('2'),test.integer('3')]),
- i64 as test.`array_sql-count`([test.bigint('1'),test.bigint('2'),test.bigint('3')]),
- f as test.`array_sql-count`([test.float('1'),test.float('2'),test.float('3')]),
- d as test.`array_sql-count`([test.double('1'),test.double('2'),test.double('3')]),
- s as test.`array_sql-count`(['a','b','c'])
+with i8 as test.array_sql_count([test.tinyint('1'),test.tinyint('2'),test.tinyint('3')]),
+ i16 as test.array_sql_count([test.smallint('1'),test.smallint('2'),test.smallint('3')]),
+ i32 as test.array_sql_count([test.integer('1'),test.integer('2'),test.integer('3')]),
+ i64 as test.array_sql_count([test.bigint('1'),test.bigint('2'),test.bigint('3')]),
+ f as test.array_sql_count([test.float('1'),test.float('2'),test.float('3')]),
+ d as test.array_sql_count([test.double('1'),test.double('2'),test.double('3')]),
+ s as test.array_sql_count(['a','b','c'])
select element i
from [i8,i16,i32,i64,f,d,s] as i
;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_count_empty/scalar_count_empty.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_count_empty/scalar_count_empty.3.query.sqlpp
index 2bcc954..3a0d1e9 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_count_empty/scalar_count_empty.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_count_empty/scalar_count_empty.3.query.sqlpp
@@ -24,4 +24,4 @@
use test;
-select element test.`array_sql-count`([]);
+select element test.array_sql_count([]);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_count_null/scalar_count_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_count_null/scalar_count_null.3.query.sqlpp
index 0c910aa..820c503 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_count_null/scalar_count_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_count_null/scalar_count_null.3.query.sqlpp
@@ -24,13 +24,13 @@
use test;
-with i8 as test.`array_sql-count`([test.tinyint('1'),test.tinyint('2'),test.tinyint('3'),null]),
- i16 as test.`array_sql-count`([test.smallint('1'),test.smallint('2'),test.smallint('3'),null]),
- i32 as test.`array_sql-count`([test.integer('1'),test.integer('2'),test.integer('3'),null]),
- i64 as test.`array_sql-count`([test.bigint('1'),test.bigint('2'),test.bigint('3'),null]),
- f as test.`array_sql-count`([test.float('1'),test.float('2'),test.float('3'),null]),
- d as test.`array_sql-count`([test.double('1'),test.double('2'),test.double('3'),null]),
- s as test.`array_sql-count`(['a','b','c',null])
+with i8 as test.array_sql_count([test.tinyint('1'),test.tinyint('2'),test.tinyint('3'),null]),
+ i16 as test.array_sql_count([test.smallint('1'),test.smallint('2'),test.smallint('3'),null]),
+ i32 as test.array_sql_count([test.integer('1'),test.integer('2'),test.integer('3'),null]),
+ i64 as test.array_sql_count([test.bigint('1'),test.bigint('2'),test.bigint('3'),null]),
+ f as test.array_sql_count([test.float('1'),test.float('2'),test.float('3'),null]),
+ d as test.array_sql_count([test.double('1'),test.double('2'),test.double('3'),null]),
+ s as test.array_sql_count(['a','b','c',null])
select element i
from [i8,i16,i32,i64,f,d,s] as i
;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_max/scalar_max.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_max/scalar_max.3.query.sqlpp
index 5a7f1ab..8b47d5f 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_max/scalar_max.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_max/scalar_max.3.query.sqlpp
@@ -24,14 +24,14 @@
use test;
-with i8 as test.`array_sql-max`([test.tinyint('1'),test.tinyint('2'),test.tinyint('3')]),
- i16 as test.`array_sql-max`([test.smallint('1'),test.smallint('2'),test.smallint('3')]),
- i32 as test.`array_sql-max`([test.integer('1'),test.integer('2'),test.integer('3')]),
- i64 as test.`array_sql-max`([test.bigint('1'),test.bigint('2'),test.bigint('3')]),
- f as test.`array_sql-max`([test.float('1'),test.float('2'),test.float('3')]),
- d as test.`array_sql-max`([test.double('1'),test.double('2'),test.double('3')]),
- s as test.`array_sql-max`(['foo','bar','world']),
- dt as test.`array_sql-max`([test.datetime('2012-03-01T00:00:00Z'),test.datetime('2012-01-01T00:00:00Z'),test.datetime('2012-02-01T00:00:00Z')])
+with i8 as test.array_sql_max([test.tinyint('1'),test.tinyint('2'),test.tinyint('3')]),
+ i16 as test.array_sql_max([test.smallint('1'),test.smallint('2'),test.smallint('3')]),
+ i32 as test.array_sql_max([test.integer('1'),test.integer('2'),test.integer('3')]),
+ i64 as test.array_sql_max([test.bigint('1'),test.bigint('2'),test.bigint('3')]),
+ f as test.array_sql_max([test.float('1'),test.float('2'),test.float('3')]),
+ d as test.array_sql_max([test.double('1'),test.double('2'),test.double('3')]),
+ s as test.array_sql_max(['foo','bar','world']),
+ dt as test.array_sql_max([test.datetime('2012-03-01T00:00:00Z'),test.datetime('2012-01-01T00:00:00Z'),test.datetime('2012-02-01T00:00:00Z')])
select element i
from [i8,i16,i32,i64,f,d,s,dt] as i
;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_max_empty/scalar_max_empty.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_max_empty/scalar_max_empty.3.query.sqlpp
index 16d2409..00e54f5 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_max_empty/scalar_max_empty.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_max_empty/scalar_max_empty.3.query.sqlpp
@@ -24,4 +24,4 @@
use test;
-select element test.`array_sql-max`([]);
+select element test.array_sql_max([]);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_max_null/scalar_max_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_max_null/scalar_max_null.3.query.sqlpp
index 8eb40d8..5150934 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_max_null/scalar_max_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_max_null/scalar_max_null.3.query.sqlpp
@@ -24,14 +24,14 @@
use test;
-with i8 as test.`array_sql-max`([test.tinyint('1'),test.tinyint('2'),test.tinyint('3'),null]),
- i16 as test.`array_sql-max`([test.smallint('1'),test.smallint('2'),test.smallint('3'),null]),
- i32 as test.`array_sql-max`([test.integer('1'),test.integer('2'),test.integer('3'),null]),
- i64 as test.`array_sql-max`([test.bigint('1'),test.bigint('2'),test.bigint('3'),null]),
- f as test.`array_sql-max`([test.float('1'),test.float('2'),test.float('3'),null]),
- d as test.`array_sql-max`([test.double('1'),test.double('2'),test.double('3'),null]),
- s as test.`array_sql-max`(['foo','bar','world',null]),
- dt as test.`array_sql-max`([test.datetime('2012-03-01T00:00:00Z'),test.datetime('2012-01-01T00:00:00Z'),test.datetime('2012-02-01T00:00:00Z'),null])
+with i8 as test.array_sql_max([test.tinyint('1'),test.tinyint('2'),test.tinyint('3'),null]),
+ i16 as test.array_sql_max([test.smallint('1'),test.smallint('2'),test.smallint('3'),null]),
+ i32 as test.array_sql_max([test.integer('1'),test.integer('2'),test.integer('3'),null]),
+ i64 as test.array_sql_max([test.bigint('1'),test.bigint('2'),test.bigint('3'),null]),
+ f as test.array_sql_max([test.float('1'),test.float('2'),test.float('3'),null]),
+ d as test.array_sql_max([test.double('1'),test.double('2'),test.double('3'),null]),
+ s as test.array_sql_max(['foo','bar','world',null]),
+ dt as test.array_sql_max([test.datetime('2012-03-01T00:00:00Z'),test.datetime('2012-01-01T00:00:00Z'),test.datetime('2012-02-01T00:00:00Z'),null])
select element i
from [i8,i16,i32,i64,f,d,s,dt] as i
;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_min/scalar_min.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_min/scalar_min.3.query.sqlpp
index 91491b6..c2157b3 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_min/scalar_min.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_min/scalar_min.3.query.sqlpp
@@ -24,14 +24,14 @@
use test;
-with i8 as test.`array_sql-min`([test.tinyint('1'),test.tinyint('2'),test.tinyint('3')]),
- i16 as test.`array_sql-min`([test.smallint('1'),test.smallint('2'),test.smallint('3')]),
- i32 as test.`array_sql-min`([test.integer('1'),test.integer('2'),test.integer('3')]),
- i64 as test.`array_sql-min`([test.bigint('1'),test.bigint('2'),test.bigint('3')]),
- f as test.`array_sql-min`([test.float('1'),test.float('2'),test.float('3')]),
- d as test.`array_sql-min`([test.double('1'),test.double('2'),test.double('3')]),
- s as test.`array_sql-min`(['foo','bar','world']),
- dt as test.`array_sql-min`([test.datetime('2012-03-01T00:00:00Z'),test.datetime('2012-01-01T00:00:00Z'),test.datetime('2012-02-01T00:00:00Z')])
+with i8 as test.array_sql_min([test.tinyint('1'),test.tinyint('2'),test.tinyint('3')]),
+ i16 as test.array_sql_min([test.smallint('1'),test.smallint('2'),test.smallint('3')]),
+ i32 as test.array_sql_min([test.integer('1'),test.integer('2'),test.integer('3')]),
+ i64 as test.array_sql_min([test.bigint('1'),test.bigint('2'),test.bigint('3')]),
+ f as test.array_sql_min([test.float('1'),test.float('2'),test.float('3')]),
+ d as test.array_sql_min([test.double('1'),test.double('2'),test.double('3')]),
+ s as test.array_sql_min(['foo','bar','world']),
+ dt as test.array_sql_min([test.datetime('2012-03-01T00:00:00Z'),test.datetime('2012-01-01T00:00:00Z'),test.datetime('2012-02-01T00:00:00Z')])
select element i
from [i8,i16,i32,i64,f,d,s,dt] as i
;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_min_empty/scalar_min_empty.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_min_empty/scalar_min_empty.3.query.sqlpp
index 54765c2..8a7049a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_min_empty/scalar_min_empty.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_min_empty/scalar_min_empty.3.query.sqlpp
@@ -24,4 +24,4 @@
use test;
-select element test.`array_sql-min`([]);
+select element test.array_sql_min([]);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_min_null/scalar_min_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_min_null/scalar_min_null.3.query.sqlpp
index 88804c6..24403c2 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_min_null/scalar_min_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_min_null/scalar_min_null.3.query.sqlpp
@@ -24,14 +24,14 @@
use test;
-with i8 as test.`array_sql-min`([test.tinyint('1'),test.tinyint('2'),test.tinyint('3'),null]),
- i16 as test.`array_sql-min`([test.smallint('1'),test.smallint('2'),test.smallint('3'),null]),
- i32 as test.`array_sql-min`([test.integer('1'),test.integer('2'),test.integer('3'),null]),
- i64 as test.`array_sql-min`([test.bigint('1'),test.bigint('2'),test.bigint('3'),null]),
- f as test.`array_sql-min`([test.float('1'),test.float('2'),test.float('3'),null]),
- d as test.`array_sql-min`([test.double('1'),test.double('2'),test.double('3'),null]),
- s as test.`array_sql-min`(['foo','bar','world',null]),
- dt as test.`array_sql-min`([test.datetime('2012-03-01T00:00:00Z'),test.datetime('2012-01-01T00:00:00Z'),test.datetime('2012-02-01T00:00:00Z'),null])
+with i8 as test.array_sql_min([test.tinyint('1'),test.tinyint('2'),test.tinyint('3'),null]),
+ i16 as test.array_sql_min([test.smallint('1'),test.smallint('2'),test.smallint('3'),null]),
+ i32 as test.array_sql_min([test.integer('1'),test.integer('2'),test.integer('3'),null]),
+ i64 as test.array_sql_min([test.bigint('1'),test.bigint('2'),test.bigint('3'),null]),
+ f as test.array_sql_min([test.float('1'),test.float('2'),test.float('3'),null]),
+ d as test.array_sql_min([test.double('1'),test.double('2'),test.double('3'),null]),
+ s as test.array_sql_min(['foo','bar','world',null]),
+ dt as test.array_sql_min([test.datetime('2012-03-01T00:00:00Z'),test.datetime('2012-01-01T00:00:00Z'),test.datetime('2012-02-01T00:00:00Z'),null])
select element i
from [i8,i16,i32,i64,f,d,s,dt] as i
;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_sum/scalar_sum.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_sum/scalar_sum.3.query.sqlpp
index 46675c4..6fee4af 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_sum/scalar_sum.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_sum/scalar_sum.3.query.sqlpp
@@ -24,12 +24,12 @@
use test;
-with i8 as test.`array_sql-sum`([test.tinyint('1'),test.tinyint('2'),test.tinyint('3')]),
- i16 as test.`array_sql-sum`([test.smallint('1'),test.smallint('2'),test.smallint('3')]),
- i32 as test.`array_sql-sum`([test.integer('1'),test.integer('2'),test.integer('3')]),
- i64 as test.`array_sql-sum`([test.bigint('1'),test.bigint('2'),test.bigint('3')]),
- f as test.`array_sql-sum`([test.float('1'),test.float('2'),test.float('3')]),
- d as test.`array_sql-sum`([test.double('1'),test.double('2'),test.double('3')])
+with i8 as test.array_sql_sum([test.tinyint('1'),test.tinyint('2'),test.tinyint('3')]),
+ i16 as test.array_sql_sum([test.smallint('1'),test.smallint('2'),test.smallint('3')]),
+ i32 as test.array_sql_sum([test.integer('1'),test.integer('2'),test.integer('3')]),
+ i64 as test.array_sql_sum([test.bigint('1'),test.bigint('2'),test.bigint('3')]),
+ f as test.array_sql_sum([test.float('1'),test.float('2'),test.float('3')]),
+ d as test.array_sql_sum([test.double('1'),test.double('2'),test.double('3')])
select element i
from [i8,i16,i32,i64,f,d] as i
;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_sum_empty/scalar_sum_empty.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_sum_empty/scalar_sum_empty.3.query.sqlpp
index 0317b33..a595c57 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_sum_empty/scalar_sum_empty.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_sum_empty/scalar_sum_empty.3.query.sqlpp
@@ -24,4 +24,4 @@
use test;
-select element test.`array_sql-sum`([]);
+select element test.array_sql_sum([]);
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_sum_null/scalar_sum_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_sum_null/scalar_sum_null.3.query.sqlpp
index 64c32fe..418d7cf 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_sum_null/scalar_sum_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/scalar_sum_null/scalar_sum_null.3.query.sqlpp
@@ -24,12 +24,12 @@
use test;
-with i8 as test.`array_sql-sum`([test.tinyint('1'),test.tinyint('2'),test.tinyint('3'),null]),
- i16 as test.`array_sql-sum`([test.smallint('1'),test.smallint('2'),test.smallint('3'),null]),
- i32 as test.`array_sql-sum`([test.integer('1'),test.integer('2'),test.integer('3'),null]),
- i64 as test.`array_sql-sum`([test.bigint('1'),test.bigint('2'),test.bigint('3'),null]),
- f as test.`array_sql-sum`([test.float('1'),test.float('2'),test.float('3'),null]),
- d as test.`array_sql-sum`([test.double('1'),test.double('2'),test.double('3'),null])
+with i8 as test.array_sql_sum([test.tinyint('1'),test.tinyint('2'),test.tinyint('3'),null]),
+ i16 as test.array_sql_sum([test.smallint('1'),test.smallint('2'),test.smallint('3'),null]),
+ i32 as test.array_sql_sum([test.integer('1'),test.integer('2'),test.integer('3'),null]),
+ i64 as test.array_sql_sum([test.bigint('1'),test.bigint('2'),test.bigint('3'),null]),
+ f as test.array_sql_sum([test.float('1'),test.float('2'),test.float('3'),null]),
+ d as test.array_sql_sum([test.double('1'),test.double('2'),test.double('3'),null])
select element i
from [i8,i16,i32,i64,f,d] as i
;
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_double/sum_double.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_double/sum_double.3.query.sqlpp
index f7463a0..e9915a5 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_double/sum_double.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_double/sum_double.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-sum`((
+select element test.array_sql_sum((
select element x
from [1.0,2.0,3.0] as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_double_null/sum_double_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_double_null/sum_double_null.3.query.sqlpp
index c0e45e0..cec8ca6 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_double_null/sum_double_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_double_null/sum_double_null.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-sum`((
+select element test.array_sql_sum((
select element x.doubleField
from Numeric as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_empty_01/sum_empty_01.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_empty_01/sum_empty_01.3.query.sqlpp
index 4241dc0..f26d615 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_empty_01/sum_empty_01.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_empty_01/sum_empty_01.3.query.sqlpp
@@ -25,7 +25,7 @@
use test;
-select element test.`array_sql-sum`((
+select element test.array_sql_sum((
select element x
from [1,2,3] as x
where (x > 10)
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_empty_02/sum_empty_02.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_empty_02/sum_empty_02.3.query.sqlpp
index 482174e..46eb3d5 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_empty_02/sum_empty_02.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_empty_02/sum_empty_02.3.query.sqlpp
@@ -25,7 +25,7 @@
use test;
-select element test.`array_sql-sum`((
+select element test.array_sql_sum((
select element x.val
from Test as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_float/sum_float.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_float/sum_float.3.query.sqlpp
index 9e72462..0efa33e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_float/sum_float.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_float/sum_float.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-sum`((
+select element test.array_sql_sum((
select element x
from [test.float('1'),test.float('2'),test.float('3')] as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_float_null/sum_float_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_float_null/sum_float_null.3.query.sqlpp
index f28aae1..0e31530 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_float_null/sum_float_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_float_null/sum_float_null.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-sum`((
+select element test.array_sql_sum((
select element x.floatField
from Numeric as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int16/sum_int16.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int16/sum_int16.3.query.sqlpp
index b37b86c..799066a 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int16/sum_int16.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int16/sum_int16.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-sum`((
+select element test.array_sql_sum((
select element x
from [test.smallint('1'),test.smallint('2'),test.smallint('3')] as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int16_null/sum_int16_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int16_null/sum_int16_null.3.query.sqlpp
index e351f2f..a18eb9e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int16_null/sum_int16_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int16_null/sum_int16_null.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-sum`((
+select element test.array_sql_sum((
select element x.int16Field
from Numeric as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int32/sum_int32.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int32/sum_int32.3.query.sqlpp
index 3ffa0dc..929b4b6 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int32/sum_int32.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int32/sum_int32.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-sum`((
+select element test.array_sql_sum((
select element x
from [test.integer('1'),test.integer('2'),test.integer('3')] as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int32_null/sum_int32_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int32_null/sum_int32_null.3.query.sqlpp
index 88e43ed..3ca1fef 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int32_null/sum_int32_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int32_null/sum_int32_null.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-sum`((
+select element test.array_sql_sum((
select element x.int32Field
from Numeric as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int64/sum_int64.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int64/sum_int64.3.query.sqlpp
index 41dd76d..b0c2163 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int64/sum_int64.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int64/sum_int64.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-sum`((
+select element test.array_sql_sum((
select element x
from [test.bigint('1'),test.bigint('2'),test.bigint('3')] as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int64_null/sum_int64_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int64_null/sum_int64_null.3.query.sqlpp
index 8fab46d..3aa468e 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int64_null/sum_int64_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int64_null/sum_int64_null.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-sum`((
+select element test.array_sql_sum((
select element x.int64Field
from Numeric as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int8/sum_int8.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int8/sum_int8.3.query.sqlpp
index bd133e9..c790588 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int8/sum_int8.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int8/sum_int8.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-sum`((
+select element test.array_sql_sum((
select element x
from [test.tinyint('1'),test.tinyint('2'),test.tinyint('3')] as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int8_null/sum_int8_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int8_null/sum_int8_null.3.query.sqlpp
index 4062509..9603bc9 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int8_null/sum_int8_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_int8_null/sum_int8_null.3.query.sqlpp
@@ -20,7 +20,7 @@
use test;
-select element test.`array_sql-sum`((
+select element test.array_sql_sum((
select element x.int8Field
from Numeric as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_mixed/sum_mixed.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_mixed/sum_mixed.3.query.sqlpp
index 12752ce..8c3a56c 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_mixed/sum_mixed.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_mixed/sum_mixed.3.query.sqlpp
@@ -22,7 +22,7 @@
* Date : Feb 7th 2014
*/
-select element `array_sql-sum`((
+select element array_sql_sum((
select element x
from [float('2.0'),'hello world',93847382783847382,date('2013-01-01')] as x
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_null-with-pred/sum_null-with-pred.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_null-with-pred/sum_null-with-pred.3.query.sqlpp
index 3f70708..cecd293 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_null-with-pred/sum_null-with-pred.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_null-with-pred/sum_null-with-pred.3.query.sqlpp
@@ -25,7 +25,7 @@
use test;
-select element test.`array_sql-sum`((
+select element test.array_sql_sum((
select element l.sal
from tdst as l
where l.sal IS NOT NULL
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_numeric_null/sum_numeric_null.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_numeric_null/sum_numeric_null.3.query.sqlpp
index 19ca018..5ea84eb 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_numeric_null/sum_numeric_null.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/sum_numeric_null/sum_numeric_null.3.query.sqlpp
@@ -25,7 +25,7 @@
use test;
-select element test.`array_sql-sum`((
+select element test.array_sql_sum((
select element l.sal
from tdst as l
));
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/q07_volume_shipping/q07_volume_shipping.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/q07_volume_shipping/q07_volume_shipping.3.query.sqlpp
index 5a707cd..0016fad 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/q07_volume_shipping/q07_volume_shipping.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/q07_volume_shipping/q07_volume_shipping.3.query.sqlpp
@@ -35,7 +35,7 @@
FROM
(
SELECT supp_nation, cust_nation,
- `get-year`(l_shipdate) AS l_year,
+ get_year(l_shipdate) AS l_year,
l_extendedprice * (1 - l_discount) AS volume
FROM
q7_volume_shipping_tmp t JOIN
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/q08_national_market_share/q08_national_market_share.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/q08_national_market_share/q08_national_market_share.3.query.sqlpp
index 3c69b1c..ce91102 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/q08_national_market_share/q08_national_market_share.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/q08_national_market_share/q08_national_market_share.3.query.sqlpp
@@ -58,7 +58,7 @@
WHERE s_suppkey = l_suppkey
) AS slnrcop,
Nation
- LET o_year = `get-year`(o_orderdate)
+ LET o_year = GET_YEAR(o_orderdate)
WHERE s_nationkey = n_nationkey
) as t
GROUP BY year
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/q09_product_type_profit_nt/q09_product_type_profit_nt.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/q09_product_type_profit_nt/q09_product_type_profit_nt.3.query.sqlpp
index 5ff8aeb..bcb3687 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/q09_product_type_profit_nt/q09_product_type_profit_nt.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/q09_product_type_profit_nt/q09_product_type_profit_nt.3.query.sqlpp
@@ -24,7 +24,7 @@
FROM
(
SELECT n_name AS nation,
- `get-year`(o_orderdate) AS o_year,
+ get_year(o_orderdate) AS o_year,
l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount
FROM
Orders JOIN
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/query-issue638/query-issue638.3.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/query-issue638/query-issue638.3.query.sqlpp
index 5dcfead..5854816 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/query-issue638/query-issue638.3.query.sqlpp
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/tpch-sql-sugar/query-issue638/query-issue638.3.query.sqlpp
@@ -30,7 +30,7 @@
FROM
(
SELECT n_name AS nation,
- `get-year`(o_orderdate) AS o_year,
+ GET_YEAR(o_orderdate) AS o_year,
l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount
FROM
Orders o JOIN
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/AqlQueryRewriter.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/AqlQueryRewriter.java
index 4568309..e460316 100644
--- a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/AqlQueryRewriter.java
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/AqlQueryRewriter.java
@@ -30,6 +30,8 @@
import org.apache.asterix.lang.aql.expression.UnionExpr;
import org.apache.asterix.lang.aql.parser.AQLParserFactory;
import org.apache.asterix.lang.aql.parser.FunctionParser;
+import org.apache.asterix.lang.aql.rewrites.visitor.AqlBuiltinFunctionRewriteVisitor;
+import org.apache.asterix.lang.common.util.CommonFunctionMapUtil;
import org.apache.asterix.lang.aql.visitor.AQLInlineUdfsVisitor;
import org.apache.asterix.lang.aql.visitor.base.IAQLVisitor;
import org.apache.asterix.lang.common.base.Clause;
@@ -72,6 +74,7 @@
wrapInLets();
}
inlineDeclaredUdfs();
+ rewriteFunctionName();
topExpr.setVarCounter(context.getVarCounter());
}
@@ -93,6 +96,14 @@
}
}
+ private void rewriteFunctionName() throws AsterixException {
+ if (topExpr == null) {
+ return;
+ }
+ AqlBuiltinFunctionRewriteVisitor visitor = new AqlBuiltinFunctionRewriteVisitor();
+ topExpr.accept(visitor, null);
+ }
+
private void inlineDeclaredUdfs() throws AsterixException {
if (topExpr == null) {
return;
@@ -104,7 +115,8 @@
List<FunctionDecl> storedFunctionDecls = FunctionUtil.retrieveUsedStoredFunctions(metadataProvider,
topExpr.getBody(), funIds, null,
- expr -> getFunctionCalls(expr), func -> functionParser.getFunctionDecl(func), null);
+ expr -> getFunctionCalls(expr), func -> functionParser.getFunctionDecl(func),
+ signature -> CommonFunctionMapUtil.normalizeBuiltinFunctionSignature(signature));
declaredFunctions.addAll(storedFunctionDecls);
if (!declaredFunctions.isEmpty()) {
AQLInlineUdfsVisitor visitor =
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/visitor/AqlBuiltinFunctionRewriteVisitor.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/visitor/AqlBuiltinFunctionRewriteVisitor.java
new file mode 100644
index 0000000..4c9a615
--- /dev/null
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/rewrites/visitor/AqlBuiltinFunctionRewriteVisitor.java
@@ -0,0 +1,47 @@
+/*
+ * 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.asterix.lang.aql.rewrites.visitor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.functions.FunctionSignature;
+import org.apache.asterix.lang.common.util.CommonFunctionMapUtil;
+import org.apache.asterix.lang.aql.visitor.base.AbstractAqlSimpleExpressionVisitor;
+import org.apache.asterix.lang.common.base.Expression;
+import org.apache.asterix.lang.common.base.ILangExpression;
+import org.apache.asterix.lang.common.expression.CallExpr;
+
+public class AqlBuiltinFunctionRewriteVisitor extends AbstractAqlSimpleExpressionVisitor {
+
+ @Override
+ public Expression visit(CallExpr callExpr, ILangExpression arg) throws AsterixException {
+ FunctionSignature functionSignature = callExpr.getFunctionSignature();
+ callExpr.setFunctionSignature(CommonFunctionMapUtil.normalizeBuiltinFunctionSignature(functionSignature));
+ List<Expression> newExprList = new ArrayList<>();
+ for (Expression expr : callExpr.getExprList()) {
+ newExprList.add(expr.accept(this, arg));
+ }
+ callExpr.setExprList(newExprList);
+ return callExpr;
+ }
+
+}
diff --git a/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/AbstractAqlSimpleExpressionVisitor.java b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/AbstractAqlSimpleExpressionVisitor.java
new file mode 100644
index 0000000..2b71202
--- /dev/null
+++ b/asterixdb/asterix-lang-aql/src/main/java/org/apache/asterix/lang/aql/visitor/base/AbstractAqlSimpleExpressionVisitor.java
@@ -0,0 +1,225 @@
+/*
+ * 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.asterix.lang.aql.visitor.base;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.lang.aql.clause.DistinctClause;
+import org.apache.asterix.lang.aql.clause.ForClause;
+import org.apache.asterix.lang.aql.expression.FLWOGRExpression;
+import org.apache.asterix.lang.aql.expression.UnionExpr;
+import org.apache.asterix.lang.common.base.Clause;
+import org.apache.asterix.lang.common.base.Expression;
+import org.apache.asterix.lang.common.base.ILangExpression;
+import org.apache.asterix.lang.common.clause.GroupbyClause;
+import org.apache.asterix.lang.common.clause.LetClause;
+import org.apache.asterix.lang.common.clause.LimitClause;
+import org.apache.asterix.lang.common.clause.OrderbyClause;
+import org.apache.asterix.lang.common.clause.WhereClause;
+import org.apache.asterix.lang.common.expression.CallExpr;
+import org.apache.asterix.lang.common.expression.FieldAccessor;
+import org.apache.asterix.lang.common.expression.FieldBinding;
+import org.apache.asterix.lang.common.expression.GbyVariableExpressionPair;
+import org.apache.asterix.lang.common.expression.IfExpr;
+import org.apache.asterix.lang.common.expression.IndexAccessor;
+import org.apache.asterix.lang.common.expression.ListConstructor;
+import org.apache.asterix.lang.common.expression.LiteralExpr;
+import org.apache.asterix.lang.common.expression.OperatorExpr;
+import org.apache.asterix.lang.common.expression.QuantifiedExpression;
+import org.apache.asterix.lang.common.expression.RecordConstructor;
+import org.apache.asterix.lang.common.expression.UnaryExpr;
+import org.apache.asterix.lang.common.expression.VariableExpr;
+import org.apache.asterix.lang.common.statement.FunctionDecl;
+import org.apache.asterix.lang.common.statement.Query;
+import org.apache.asterix.lang.common.struct.QuantifiedPair;
+
+public class AbstractAqlSimpleExpressionVisitor extends AbstractAqlQueryExpressionVisitor<Expression, ILangExpression> {
+
+ @Override
+ public Expression visit(FLWOGRExpression flwogreExpr, ILangExpression arg) throws AsterixException {
+ for (Clause clause : flwogreExpr.getClauseList()) {
+ clause.accept(this, arg);
+ }
+ flwogreExpr.setReturnExpr(flwogreExpr.getReturnExpr().accept(this, arg));
+ return flwogreExpr;
+ }
+
+ @Override
+ public Expression visit(UnionExpr u, ILangExpression arg) throws AsterixException {
+ u.setExprs(visit(u.getExprs(), arg));
+ return u;
+ }
+
+ @Override
+ public Expression visit(ForClause forClause, ILangExpression arg) throws AsterixException {
+ forClause.setInExpr(forClause.getInExpr().accept(this, arg));
+ return null;
+ }
+
+ @Override
+ public Expression visit(DistinctClause distinctClause, ILangExpression arg) throws AsterixException {
+ distinctClause.setDistinctByExpr(visit(distinctClause.getDistinctByExpr(), arg));
+ return null;
+ }
+
+ @Override
+ public Expression visit(Query q, ILangExpression arg) throws AsterixException {
+ q.setBody(visit(q.getBody(), q));
+ return null;
+ }
+
+ @Override
+ public Expression visit(FunctionDecl fd, ILangExpression arg) throws AsterixException {
+ fd.setFuncBody(visit(fd.getFuncBody(), fd));
+ return null;
+ }
+
+ @Override
+ public Expression visit(WhereClause whereClause, ILangExpression arg) throws AsterixException {
+ whereClause.setWhereExpr(visit(whereClause.getWhereExpr(), whereClause));
+ return null;
+ }
+
+ @Override
+ public Expression visit(OrderbyClause oc, ILangExpression arg) throws AsterixException {
+ oc.setOrderbyList(visit(oc.getOrderbyList(), arg));
+ return null;
+ }
+
+ @Override
+ public Expression visit(GroupbyClause gc, ILangExpression arg) throws AsterixException {
+ for (GbyVariableExpressionPair gbyVarExpr : gc.getGbyPairList()) {
+ gbyVarExpr.setExpr(visit(gbyVarExpr.getExpr(), gc));
+ }
+ return null;
+ }
+
+ @Override
+ public Expression visit(LimitClause limitClause, ILangExpression arg) throws AsterixException {
+ limitClause.setLimitExpr(visit(limitClause.getLimitExpr(), limitClause));
+ if (limitClause.hasOffset()) {
+ limitClause.setOffset(visit(limitClause.getOffset(), limitClause));
+ }
+ return null;
+ }
+
+ @Override
+ public Expression visit(LetClause letClause, ILangExpression arg) throws AsterixException {
+ letClause.setBindingExpr(visit(letClause.getBindingExpr(), letClause));
+ return null;
+ }
+
+ @Override
+ public Expression visit(LiteralExpr l, ILangExpression arg) throws AsterixException {
+ return l;
+ }
+
+ @Override
+ public Expression visit(ListConstructor lc, ILangExpression arg) throws AsterixException {
+ lc.setExprList(visit(lc.getExprList(), arg));
+ return lc;
+ }
+
+ @Override
+ public Expression visit(RecordConstructor rc, ILangExpression arg) throws AsterixException {
+ for (FieldBinding binding : rc.getFbList()) {
+ binding.setLeftExpr(visit(binding.getLeftExpr(), rc));
+ binding.setRightExpr(visit(binding.getRightExpr(), rc));
+ }
+ return rc;
+ }
+
+ @Override
+ public Expression visit(OperatorExpr operatorExpr, ILangExpression arg) throws AsterixException {
+ operatorExpr.setExprList(visit(operatorExpr.getExprList(), arg));
+ return operatorExpr;
+ }
+
+ @Override
+ public Expression visit(IfExpr ifExpr, ILangExpression arg) throws AsterixException {
+ ifExpr.setCondExpr(visit(ifExpr.getCondExpr(), ifExpr));
+ ifExpr.setThenExpr(visit(ifExpr.getThenExpr(), ifExpr));
+ ifExpr.setElseExpr(visit(ifExpr.getElseExpr(), ifExpr));
+ return ifExpr;
+ }
+
+ @Override
+ public Expression visit(QuantifiedExpression qe, ILangExpression arg) throws AsterixException {
+ for (QuantifiedPair pair : qe.getQuantifiedList()) {
+ pair.setExpr(visit(pair.getExpr(), qe));
+ }
+ qe.setSatisfiesExpr(visit(qe.getSatisfiesExpr(), qe));
+ return qe;
+ }
+
+ @Override
+ public Expression visit(CallExpr callExpr, ILangExpression arg) throws AsterixException {
+ callExpr.setExprList(visit(callExpr.getExprList(), arg));
+ return callExpr;
+ }
+
+ @Override
+ public Expression visit(VariableExpr varExpr, ILangExpression arg) throws AsterixException {
+ return varExpr;
+ }
+
+ @Override
+ public Expression visit(UnaryExpr u, ILangExpression arg) throws AsterixException {
+ u.setExpr(visit(u.getExpr(), u));
+ return u;
+ }
+
+ @Override
+ public Expression visit(FieldAccessor fa, ILangExpression arg) throws AsterixException {
+ fa.setExpr(visit(fa.getExpr(), fa));
+ return fa;
+ }
+
+ @Override
+ public Expression visit(IndexAccessor ia, ILangExpression arg) throws AsterixException {
+ ia.setExpr(visit(ia.getExpr(), ia));
+ if (ia.getIndexExpr() != null) {
+ ia.setIndexExpr(visit(ia.getIndexExpr(), arg));
+ }
+ return ia;
+ }
+
+ protected Expression visit(Expression expr, ILangExpression arg) throws AsterixException {
+ return postVisit(preVisit(expr).accept(this, arg));
+ }
+
+ protected Expression preVisit(Expression expr) throws AsterixException {
+ return expr;
+ }
+
+ protected Expression postVisit(Expression expr) throws AsterixException {
+ return expr;
+ }
+
+ private List<Expression> visit(List<Expression> exprs, ILangExpression arg) throws AsterixException {
+ List<Expression> newExprList = new ArrayList<>();
+ for (Expression expr : exprs) {
+ newExprList.add(visit(expr, arg));
+ }
+ return newExprList;
+ }
+}
diff --git a/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/CommonFunctionMapUtil.java b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/CommonFunctionMapUtil.java
new file mode 100644
index 0000000..1f7e4b0
--- /dev/null
+++ b/asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/util/CommonFunctionMapUtil.java
@@ -0,0 +1,76 @@
+/*
+ * 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.asterix.lang.common.util;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.asterix.common.exceptions.AsterixException;
+import org.apache.asterix.common.functions.FunctionSignature;
+import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
+
+public class CommonFunctionMapUtil {
+
+ // Maps from a function name to an another internal function name (i.e., AsterixDB internal name).
+ private static final Map<String, String> FUNCTION_NAME_MAP = new HashMap<>();
+
+ static {
+ FUNCTION_NAME_MAP.put("ceil", "ceiling"); //ceil, internal: ceiling
+ FUNCTION_NAME_MAP.put("length", "string-length"); // length, internal: string-length
+ FUNCTION_NAME_MAP.put("lower", "lowercase"); // lower, internal: lowercase
+ FUNCTION_NAME_MAP.put("substr", "substring"); // substr, internal: substring
+ FUNCTION_NAME_MAP.put("upper", "uppercase"); // upper, internal: uppercase
+ FUNCTION_NAME_MAP.put("title", "initcap"); // title, internal: initcap
+ FUNCTION_NAME_MAP.put("regexp_contains", "matches"); // regexp_contains, internal: matches
+ FUNCTION_NAME_MAP.put("regexp_replace", "replace"); //regexp_replace, internal: replace
+ FUNCTION_NAME_MAP.put("power", "caret"); //pow, internal: caret
+ FUNCTION_NAME_MAP.put("int", "integer"); // int, internal: integer
+
+ // The "mapped-to" names are to be deprecated.
+ FUNCTION_NAME_MAP.put("tinyint", "int8"); // tinyint, internal: int8
+ FUNCTION_NAME_MAP.put("smallint", "int16"); // smallint, internal: int16
+ FUNCTION_NAME_MAP.put("integer", "int32"); // integer, internal: int32
+ FUNCTION_NAME_MAP.put("bigint", "int64"); // bigint, internal: int64
+ }
+
+ private CommonFunctionMapUtil() {
+
+ }
+
+ /**
+ * Maps a user invoked function signature to a builtin internal function signature if possible.
+ *
+ * @param fs,
+ * the signature of an user typed function.
+ * @return the corresponding system internal function signature if it exists, otherwise
+ * the input function synature.
+ */
+ public static FunctionSignature normalizeBuiltinFunctionSignature(FunctionSignature fs) throws AsterixException {
+ String name = fs.getName();
+ String lowerCaseName = name.toLowerCase();
+ String mappedName = FUNCTION_NAME_MAP.get(lowerCaseName);
+ if (mappedName != null) {
+ return new FunctionSignature(fs.getNamespace(), mappedName, fs.getArity());
+ }
+ String understoreName = lowerCaseName.replace('_', '-');
+ FunctionSignature newFs = new FunctionSignature(fs.getNamespace(), understoreName, fs.getArity());
+ return AsterixBuiltinFunctions.isBuiltinCompilerFunction(newFs, true) ? newFs : fs;
+ }
+}
diff --git a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/util/FunctionMapUtil.java b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/util/FunctionMapUtil.java
index 36e43de..22ed4fc 100644
--- a/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/util/FunctionMapUtil.java
+++ b/asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/util/FunctionMapUtil.java
@@ -28,6 +28,7 @@
import org.apache.asterix.common.functions.FunctionSignature;
import org.apache.asterix.lang.common.expression.CallExpr;
import org.apache.asterix.lang.common.expression.ListConstructor;
+import org.apache.asterix.lang.common.util.CommonFunctionMapUtil;
import org.apache.asterix.lang.common.util.FunctionUtil;
import org.apache.asterix.om.functions.AsterixBuiltinFunctions;
import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
@@ -38,25 +39,6 @@
private final static String CORE_AGGREGATE_PREFIX = "array_";
private final static String SQL_PREFIX = "sql-";
- // Maps from a SQL function name to an AQL function name (i.e., AsterixDB internal name).
- private static final Map<String, String> FUNCTION_NAME_MAP = new HashMap<>();
-
- static {
- FUNCTION_NAME_MAP.put("ceil", "ceiling"); //SQL: ceil, AQL: ceiling
- FUNCTION_NAME_MAP.put("length", "string-length"); // SQL: length, AQL: string-length
- FUNCTION_NAME_MAP.put("lower", "lowercase"); // SQL: lower, AQL: lowercase
- FUNCTION_NAME_MAP.put("substr", "substring"); // SQL: substr, AQL: substring
- FUNCTION_NAME_MAP.put("upper", "uppercase"); //SQL: upper, AQL: uppercase
- FUNCTION_NAME_MAP.put("title", "initcap"); //SQL: title, SQL/AQL: initcap
- FUNCTION_NAME_MAP.put("regexp_contains", "matches"); //SQL: regexp_contains, AQL: matches
- FUNCTION_NAME_MAP.put("regexp_replace", "replace"); //SQL: regexp_replace, AQL: replace
- FUNCTION_NAME_MAP.put("power", "caret"); //SQL: pow, AQL: caret
- FUNCTION_NAME_MAP.put("tinyint", "int8"); //SQL: tinyint, AQL: int8
- FUNCTION_NAME_MAP.put("smallint", "int16"); //SQL: smallint, AQL: int16
- FUNCTION_NAME_MAP.put("integer", "int32"); //SQL: integer, AQL: int32
- FUNCTION_NAME_MAP.put("bigint", "int64"); //SQL: bigint, AQL: int64
- }
-
// Maps from a variable-arg SQL function names to an internal list-arg function name.
private static final Map<String, String> LIST_INPUT_FUNCTION_MAP = new HashMap<>();
@@ -98,7 +80,7 @@
return false;
}
IFunctionInfo finfo = FunctionUtil.getFunctionInfo(new FunctionIdentifier(FunctionConstants.ASTERIX_NS,
- name.substring(CORE_AGGREGATE_PREFIX.length()), fs.getArity()));
+ name.substring(CORE_AGGREGATE_PREFIX.length()).replace('_', '-'), fs.getArity()));
if (finfo == null) {
return false;
}
@@ -130,14 +112,14 @@
*/
public static FunctionSignature normalizeBuiltinFunctionSignature(FunctionSignature fs, boolean checkSql92Aggregate)
throws AsterixException {
- String mappedName = internalizeBuiltinScalarFunctionName(fs.getName());
if (isCoreAggregateFunction(fs)) {
- mappedName = internalizeCoreAggregateFunctionName(mappedName);
+ return internalizeCoreAggregateFunctionName(fs);
} else if (checkSql92Aggregate && isSql92AggregateFunction(fs)) {
throw new AsterixException(fs.getName()
+ " is a SQL-92 aggregate function. The SQL++ core aggregate function " + CORE_AGGREGATE_PREFIX
+ fs.getName().toLowerCase() + " could potentially express the intent.");
}
+ String mappedName = CommonFunctionMapUtil.normalizeBuiltinFunctionSignature(fs).getName();
return new FunctionSignature(fs.getNamespace(), mappedName, fs.getArity());
}
@@ -161,33 +143,19 @@
}
/**
- * Removes the "coll_" prefix for user-facing SQL++ core aggregate function names.
+ * Removes the "array_" prefix for user-facing SQL++ core aggregate function names.
*
- * @param name,
- * the name of a user-facing SQL++ core aggregate function name.
- * @return the AsterixDB internal function name for the aggregate function.
+ * @param fs,
+ * a user-facing SQL++ core aggregate function signature.
+ * @return the AsterixDB internal function signature for the aggregate function.
* @throws AsterixException
*/
- private static String internalizeCoreAggregateFunctionName(String name) throws AsterixException {
- String lowerCaseName = name.toLowerCase();
- return lowerCaseName.substring(CORE_AGGREGATE_PREFIX.length());
+ private static FunctionSignature internalizeCoreAggregateFunctionName(FunctionSignature fs)
+ throws AsterixException {
+ String name = fs.getName();
+ String lowerCaseName = name.toLowerCase().substring(CORE_AGGREGATE_PREFIX.length());
+ String hyphenName = lowerCaseName.replace('_', '-');
+ return new FunctionSignature(fs.getNamespace(), hyphenName, fs.getArity());
}
- /**
- * Note: function name normalization can ONLY be called
- * after all user-defined functions (by either "DECLARE FUNCTION" or "CREATE FUNCTION")
- * are inlined, because user-defined function names are case-sensitive.
- *
- * @param name
- * the user-input function name in the query.
- * @return the mapped internal name.
- */
- private static String internalizeBuiltinScalarFunctionName(String name) {
- String lowerCaseName = name.toLowerCase();
- String mappedName = FUNCTION_NAME_MAP.get(lowerCaseName);
- if (mappedName != null) {
- return mappedName;
- }
- return lowerCaseName.replace('_', '-');
- }
}