asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From buyin...@apache.org
Subject [10/10] incubator-asterixdb git commit: Rewrite SQL++ functions.
Date Tue, 05 Apr 2016 03:40:49 GMT
Rewrite SQL++ functions.

-Maps SQL function names to internal names.
-Allows SQL++ builtin functions to be case-insensitive.
-Rewrites SQL-92 global aggregates.
-Refactors SQL++ AST visitors.
-Cleans up semantics of COLL_AGG and SQL-92 AGG.

Change-Id: Idb5a7c6780669b27065b0928bec7e4700cfb53a9
Reviewed-on: https://asterix-gerrit.ics.uci.edu/759
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/commit/3dd80ec4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/tree/3dd80ec4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/diff/3dd80ec4

Branch: refs/heads/master
Commit: 3dd80ec4a84d38ab232bad628494c64a9286182f
Parents: a371978
Author: Yingyi Bu <yingyi@couchbase.com>
Authored: Fri Apr 1 10:31:53 2016 -0700
Committer: Yingyi Bu <buyingyi@gmail.com>
Committed: Mon Apr 4 20:34:28 2016 -0700

----------------------------------------------------------------------
 .../LangExpressionToPlanTranslator.java         | 112 ++--
 .../asterix/test/sqlpp/ParserTestExecutor.java  |   1 +
 .../queries_sqlpp/count-tweets.sqlpp            |   2 +-
 .../queries_sqlpp/denorm-cust-order.sqlpp       |   4 +-
 .../queries_sqlpp/distinct_aggregate.sqlpp      |   4 +-
 .../optimizerts/queries_sqlpp/fj-phase1.sqlpp   |   2 +-
 .../queries_sqlpp/fj-phase2-with-hints.sqlpp    |   2 +-
 .../inlined_q18_large_volume_customer.sqlpp     |   4 +-
 .../queries_sqlpp/nest_aggregate.sqlpp          |   2 +-
 .../queries_sqlpp/orders-aggreg.sqlpp           |   6 +-
 .../q01_pricing_summary_report_nt.sqlpp         |  16 +-
 .../queries_sqlpp/q03_shipping_priority.sqlpp   |   2 +-
 .../q05_local_supplier_volume.sqlpp             |   2 +-
 .../optimizerts/queries_sqlpp/q2.sqlpp          |   4 +-
 .../queries_sqlpp/query-issue562.sqlpp          |   6 +-
 .../queries_sqlpp/query-issue601.sqlpp          |   2 +-
 .../queries_sqlpp/query-issue697.sqlpp          |   2 +-
 .../queries_sqlpp/query-issue785.sqlpp          |   2 +-
 .../queries_sqlpp/query-issue810-2.sqlpp        |   2 +-
 .../queries_sqlpp/query-issue810.sqlpp          |   2 +-
 .../queries_sqlpp/query-issue827-2.sqlpp        |  16 +-
 .../split-materialization-above-join.sqlpp      |   4 +-
 .../queries_sqlpp/split-materialization.sqlpp   |   4 +-
 .../agg_null/agg_null.3.query.sqlpp             |   2 +-
 .../agg_null_rec/agg_null_rec.3.query.sqlpp     |  10 +-
 .../agg_null_rec_1/agg_null_rec_1.3.query.sqlpp |  10 +-
 .../agg_number/agg_number.3.query.sqlpp         |   2 +-
 .../agg_number_rec/agg_number_rec.3.query.sqlpp |  10 +-
 .../avg_double/avg_double.3.query.sqlpp         |   2 +-
 .../avg_double_null.3.query.sqlpp               |   2 +-
 .../avg_empty_01/avg_empty_01.1.ddl.sqlpp       |   2 +-
 .../avg_empty_01/avg_empty_01.2.update.sqlpp    |   2 +-
 .../avg_empty_01/avg_empty_01.3.query.sqlpp     |   4 +-
 .../avg_empty_02/avg_empty_02.1.ddl.sqlpp       |   2 +-
 .../avg_empty_02/avg_empty_02.2.update.sqlpp    |   2 +-
 .../avg_empty_02/avg_empty_02.3.query.sqlpp     |   4 +-
 .../avg_float/avg_float.3.query.sqlpp           |   2 +-
 .../avg_float_null/avg_float_nu.3.query.sqlpp   |   2 +-
 .../avg_int16/avg_int16.3.query.sqlpp           |   2 +-
 .../avg_int16_null/avg_int16_null.3.query.sqlpp |   2 +-
 .../avg_int32/avg_int32.3.query.sqlpp           |   2 +-
 .../avg_int32_null/avg_int32_null.3.query.sqlpp |   2 +-
 .../avg_int64/avg_int64.3.query.sqlpp           |   2 +-
 .../avg_int64_null/avg_int64_null.3.query.sqlpp |   2 +-
 .../avg_int8/avg_int8.3.query.sqlpp             |   2 +-
 .../avg_int8_null/avg_int8_null.3.query.sqlpp   |   2 +-
 .../avg_mixed/avg_mixed.1.ddl.sqlpp             |   2 +-
 .../avg_mixed/avg_mixed.3.query.sqlpp           |   4 +-
 .../count_01/count_01.3.query.sqlpp             |   2 +-
 .../count_empty_01/count_empty_01.1.ddl.sqlpp   |   2 +-
 .../count_empty_01.2.update.sqlpp               |   2 +-
 .../count_empty_01/count_empty_01.3.query.sqlpp |   4 +-
 .../count_empty_02/count_empty_02.1.ddl.sqlpp   |   2 +-
 .../count_empty_02.2.update.sqlpp               |   2 +-
 .../count_empty_02/count_empty_02.3.query.sqlpp |   4 +-
 .../count_null/count_null.3.query.sqlpp         |   2 +-
 .../issue395/issue395.3.query.sqlpp             |   2 +-
 .../issue412_0/issue412_0.3.query.sqlpp         |   2 +-
 .../issue412_1/issue412_1.3.query.sqlpp         |   2 +-
 .../issue425_min_hetero_list.3.query.sqlpp      |   2 +-
 .../issue425_min_hetero_list_1.3.query.sqlpp    |   2 +-
 .../issue425_sum_hetero_list.3.query.sqlpp      |   2 +-
 .../issue425_sum_hetero_list_1.3.query.sqlpp    |   2 +-
 .../issue531_string_min_max.1.ddl.sqlpp         |   4 +-
 .../issue531_string_min_max.2.update.sqlpp      |   4 +-
 .../issue531_string_min_max.3.query.sqlpp       |   8 +-
 .../max_empty_01/max_empty_01.1.ddl.sqlpp       |   2 +-
 .../max_empty_01/max_empty_01.2.update.sqlpp    |   2 +-
 .../max_empty_01/max_empty_01.3.query.sqlpp     |   4 +-
 .../max_empty_02/max_empty_02.1.ddl.sqlpp       |   2 +-
 .../max_empty_02/max_empty_02.2.update.sqlpp    |   2 +-
 .../max_empty_02/max_empty_02.3.query.sqlpp     |   4 +-
 .../min_empty_01/min_empty_01.1.ddl.sqlpp       |   2 +-
 .../min_empty_01/min_empty_01.2.update.sqlpp    |   2 +-
 .../min_empty_01/min_empty_01.3.query.sqlpp     |   4 +-
 .../min_empty_02/min_empty_02.1.ddl.sqlpp       |   2 +-
 .../min_empty_02/min_empty_02.2.update.sqlpp    |   2 +-
 .../min_empty_02/min_empty_02.3.query.sqlpp     |   4 +-
 .../min_mixed/min_mixed.1.ddl.sqlpp             |   2 +-
 .../min_mixed/min_mixed.3.query.sqlpp           |   4 +-
 .../query-issue400/query-issue400.3.query.sqlpp |   2 +-
 .../scalar_avg/scalar_avg.1.ddl.sqlpp           |   2 +-
 .../scalar_avg/scalar_avg.2.update.sqlpp        |   2 +-
 .../scalar_avg/scalar_avg.3.query.sqlpp         |  14 +-
 .../scalar_avg_empty.1.ddl.sqlpp                |   2 +-
 .../scalar_avg_empty.2.update.sqlpp             |   2 +-
 .../scalar_avg_empty.3.query.sqlpp              |   4 +-
 .../scalar_avg_null/scalar_avg_null.1.ddl.sqlpp |   2 +-
 .../scalar_avg_null.2.update.sqlpp              |   2 +-
 .../scalar_avg_null.3.query.sqlpp               |  14 +-
 .../scalar_count/scalar_count.1.ddl.sqlpp       |   2 +-
 .../scalar_count/scalar_count.2.update.sqlpp    |   2 +-
 .../scalar_count/scalar_count.3.query.sqlpp     |  16 +-
 .../scalar_count_empty.1.ddl.sqlpp              |   2 +-
 .../scalar_count_empty.2.update.sqlpp           |   2 +-
 .../scalar_count_empty.3.query.sqlpp            |   4 +-
 .../scalar_count_null.1.ddl.sqlpp               |   2 +-
 .../scalar_count_null.2.update.sqlpp            |   2 +-
 .../scalar_count_null.3.query.sqlpp             |  16 +-
 .../scalar_max/scalar_max.1.ddl.sqlpp           |   2 +-
 .../scalar_max/scalar_max.2.update.sqlpp        |   2 +-
 .../scalar_max/scalar_max.3.query.sqlpp         |  18 +-
 .../scalar_max_empty.1.ddl.sqlpp                |   2 +-
 .../scalar_max_empty.2.update.sqlpp             |   2 +-
 .../scalar_max_empty.3.query.sqlpp              |   4 +-
 .../scalar_max_null/scalar_max_null.1.ddl.sqlpp |   2 +-
 .../scalar_max_null.2.update.sqlpp              |   2 +-
 .../scalar_max_null.3.query.sqlpp               |  18 +-
 .../scalar_min/scalar_min.1.ddl.sqlpp           |   2 +-
 .../scalar_min/scalar_min.2.update.sqlpp        |   2 +-
 .../scalar_min/scalar_min.3.query.sqlpp         |  18 +-
 .../scalar_min_empty.1.ddl.sqlpp                |   2 +-
 .../scalar_min_empty.2.update.sqlpp             |   2 +-
 .../scalar_min_empty.3.query.sqlpp              |   4 +-
 .../scalar_min_null/scalar_min_null.1.ddl.sqlpp |   2 +-
 .../scalar_min_null.2.update.sqlpp              |   2 +-
 .../scalar_min_null.3.query.sqlpp               |  18 +-
 .../scalar_sum/scalar_sum.1.ddl.sqlpp           |   2 +-
 .../scalar_sum/scalar_sum.2.update.sqlpp        |   2 +-
 .../scalar_sum/scalar_sum.3.query.sqlpp         |  14 +-
 .../scalar_sum_empty.1.ddl.sqlpp                |   2 +-
 .../scalar_sum_empty.2.update.sqlpp             |   2 +-
 .../scalar_sum_empty.3.query.sqlpp              |   4 +-
 .../scalar_sum_null/scalar_sum_null.1.ddl.sqlpp |   2 +-
 .../scalar_sum_null.2.update.sqlpp              |   2 +-
 .../scalar_sum_null.3.query.sqlpp               |  14 +-
 .../sum_double/sum_double.3.query.sqlpp         |   2 +-
 .../sum_double_null.3.query.sqlpp               |   2 +-
 .../sum_empty_01/sum_empty_01.1.ddl.sqlpp       |   2 +-
 .../sum_empty_01/sum_empty_01.2.update.sqlpp    |   2 +-
 .../sum_empty_01/sum_empty_01.3.query.sqlpp     |   4 +-
 .../sum_empty_02/sum_empty_02.1.ddl.sqlpp       |   2 +-
 .../sum_empty_02/sum_empty_02.2.update.sqlpp    |   2 +-
 .../sum_empty_02/sum_empty_02.3.query.sqlpp     |   4 +-
 .../sum_float/sum_float.3.query.sqlpp           |   2 +-
 .../sum_float_null/sum_float_null.3.query.sqlpp |   2 +-
 .../sum_int16/sum_int16.3.query.sqlpp           |   2 +-
 .../sum_int16_null/sum_int16_null.3.query.sqlpp |   2 +-
 .../sum_int32/sum_int32.3.query.sqlpp           |   2 +-
 .../sum_int32_null/sum_int32_null.3.query.sqlpp |   2 +-
 .../sum_int64/sum_int64.3.query.sqlpp           |   2 +-
 .../sum_int64_null/sum_int64_null.3.query.sqlpp |   2 +-
 .../sum_int8/sum_int8.3.query.sqlpp             |   2 +-
 .../sum_int8_null/sum_int8_null.3.query.sqlpp   |   2 +-
 .../sum_mixed/sum_mixed.1.ddl.sqlpp             |   2 +-
 .../sum_mixed/sum_mixed.3.query.sqlpp           |   4 +-
 .../sum_null-with-pred.1.ddl.sqlpp              |   4 +-
 .../sum_null-with-pred.2.update.sqlpp           |   4 +-
 .../sum_null-with-pred.3.query.sqlpp            |   6 +-
 .../sum_numeric_null.1.ddl.sqlpp                |   2 +-
 .../sum_numeric_null.2.update.sqlpp             |   2 +-
 .../sum_numeric_null.3.query.sqlpp              |   4 +-
 .../aggregate/agg_null/agg_null.3.query.sqlpp   |   2 +-
 .../agg_null_rec/agg_null_rec.3.query.sqlpp     |  10 +-
 .../agg_null_rec_1/agg_null_rec_1.3.query.sqlpp |  10 +-
 .../agg_number/agg_number.3.query.sqlpp         |   2 +-
 .../agg_number_rec/agg_number_rec.3.query.sqlpp |  10 +-
 .../avg_double/avg_double.3.query.sqlpp         |   2 +-
 .../avg_double_null.3.query.sqlpp               |   2 +-
 .../avg_empty_01/avg_empty_01.3.query.sqlpp     |   2 +-
 .../avg_empty_02/avg_empty_02.3.query.sqlpp     |   2 +-
 .../aggregate/avg_float/avg_float.3.query.sqlpp |   2 +-
 .../avg_float_null/avg_float_nu.3.query.sqlpp   |   2 +-
 .../aggregate/avg_int16/avg_int16.3.query.sqlpp |   2 +-
 .../avg_int16_null/avg_int16_null.3.query.sqlpp |   2 +-
 .../aggregate/avg_int32/avg_int32.3.query.sqlpp |   2 +-
 .../avg_int32_null/avg_int32_null.3.query.sqlpp |   2 +-
 .../aggregate/avg_int64/avg_int64.3.query.sqlpp |   2 +-
 .../avg_int64_null/avg_int64_null.3.query.sqlpp |   2 +-
 .../aggregate/avg_int8/avg_int8.3.query.sqlpp   |   2 +-
 .../avg_int8_null/avg_int8_null.3.query.sqlpp   |   2 +-
 .../aggregate/avg_mixed/avg_mixed.3.query.sqlpp |   2 +-
 .../aggregate/count_01/count_01.3.query.sqlpp   |   2 +-
 .../count_empty_01/count_empty_01.3.query.sqlpp |   2 +-
 .../count_empty_02/count_empty_02.3.query.sqlpp |   2 +-
 .../count_null/count_null.3.query.sqlpp         |   2 +-
 .../aggregate/issue395/issue395.3.query.sqlpp   |   2 +-
 .../issue412_0/issue412_0.3.query.sqlpp         |   2 +-
 .../issue412_1/issue412_1.3.query.sqlpp         |   2 +-
 .../issue425_min_hetero_list.3.query.sqlpp      |   2 +-
 .../issue425_min_hetero_list_1.3.query.sqlpp    |   2 +-
 .../issue425_sum_hetero_list.3.query.sqlpp      |   2 +-
 .../issue425_sum_hetero_list_1.3.query.sqlpp    |   2 +-
 .../issue531_string_min_max.3.query.sqlpp       |   4 +-
 .../max_empty_01/max_empty_01.3.query.sqlpp     |   2 +-
 .../max_empty_02/max_empty_02.3.query.sqlpp     |   2 +-
 .../min_empty_01/min_empty_01.3.query.sqlpp     |   2 +-
 .../min_empty_02/min_empty_02.3.query.sqlpp     |   2 +-
 .../aggregate/min_mixed/min_mixed.3.query.sqlpp |   2 +-
 .../query-issue400/query-issue400.3.query.sqlpp |   2 +-
 .../scalar_avg/scalar_avg.3.query.sqlpp         |  12 +-
 .../scalar_avg_empty.3.query.sqlpp              |   2 +-
 .../scalar_avg_null.3.query.sqlpp               |  12 +-
 .../scalar_count/scalar_count.3.query.sqlpp     |  14 +-
 .../scalar_count_empty.3.query.sqlpp            |   2 +-
 .../scalar_count_null.3.query.sqlpp             |  14 +-
 .../scalar_max/scalar_max.3.query.sqlpp         |  16 +-
 .../scalar_max_empty.3.query.sqlpp              |   2 +-
 .../scalar_max_null.3.query.sqlpp               |  16 +-
 .../scalar_min/scalar_min.3.query.sqlpp         |  16 +-
 .../scalar_min_empty.3.query.sqlpp              |   2 +-
 .../scalar_min_null.3.query.sqlpp               |  16 +-
 .../scalar_sum/scalar_sum.3.query.sqlpp         |  12 +-
 .../scalar_sum_empty.3.query.sqlpp              |   2 +-
 .../scalar_sum_null.3.query.sqlpp               |  12 +-
 .../sum_double/sum_double.3.query.sqlpp         |   2 +-
 .../sum_double_null.3.query.sqlpp               |   2 +-
 .../sum_empty_01/sum_empty_01.3.query.sqlpp     |   2 +-
 .../sum_empty_02/sum_empty_02.3.query.sqlpp     |   2 +-
 .../aggregate/sum_float/sum_float.3.query.sqlpp |   2 +-
 .../sum_float_null/sum_float_null.3.query.sqlpp |   2 +-
 .../aggregate/sum_int16/sum_int16.3.query.sqlpp |   2 +-
 .../sum_int16_null/sum_int16_null.3.query.sqlpp |   2 +-
 .../aggregate/sum_int32/sum_int32.3.query.sqlpp |   2 +-
 .../sum_int32_null/sum_int32_null.3.query.sqlpp |   2 +-
 .../aggregate/sum_int64/sum_int64.3.query.sqlpp |   2 +-
 .../sum_int64_null/sum_int64_null.3.query.sqlpp |   2 +-
 .../aggregate/sum_int8/sum_int8.3.query.sqlpp   |   2 +-
 .../sum_int8_null/sum_int8_null.3.query.sqlpp   |   2 +-
 .../aggregate/sum_mixed/sum_mixed.3.query.sqlpp |   2 +-
 .../sum_null-with-pred.1.ddl.sqlpp              |   2 +-
 .../sum_null-with-pred.2.update.sqlpp           |   2 +-
 .../sum_null-with-pred.3.query.sqlpp            |   4 +-
 .../sum_numeric_null.1.ddl.sqlpp                |   2 +-
 .../sum_numeric_null.2.update.sqlpp             |   2 +-
 .../sum_numeric_null.3.query.sqlpp              |   4 +-
 .../cross-dv03/cross-dv03.3.query.sqlpp         |   2 +-
 .../custord/freq-clerk/freq-clerk.3.query.sqlpp |   2 +-
 .../custord/join_q_06/join_q_06.3.query.sqlpp   |   2 +-
 .../custord/join_q_07/join_q_07.3.query.sqlpp   |   2 +-
 .../queries_sqlpp/dapd/q2/q2.3.query.sqlpp      |   4 +-
 .../query-issue382/query-issue382.3.query.sqlpp |   2 +-
 ...pricing_summary_report_failure.3.query.sqlpp |  16 +-
 .../feeds/feeds_05/feeds_05.3.query.sqlpp       |   2 +-
 .../feeds/feeds_07/feeds_07.3.query.sqlpp       |   2 +-
 .../feeds/feeds_08/feeds_08.3.query.sqlpp       |   2 +-
 .../feeds/feeds_09/feeds_09.3.query.sqlpp       |   2 +-
 .../feeds/feeds_10/feeds_10.3.query.sqlpp       |   2 +-
 .../flwor/grpby01/grpby01.3.query.sqlpp         |   2 +-
 .../flwor/grpby02/grpby02.3.query.sqlpp         |   2 +-
 .../fuzzyjoin/dblp-1_1/dblp-1_1.3.query.sqlpp   |   2 +-
 .../dblp-2_5.3/dblp-2_5.3.3.query.sqlpp         |   2 +-
 .../global-aggregate/q01/q01.1.ddl.sqlpp        |  51 ++
 .../global-aggregate/q01/q01.2.update.sqlpp     |  30 ++
 .../global-aggregate/q01/q01.3.query.sqlpp      |  23 +
 .../global-aggregate/q02/q02.1.ddl.sqlpp        |  51 ++
 .../global-aggregate/q02/q02.2.update.sqlpp     |  30 ++
 .../global-aggregate/q02/q02.3.query.sqlpp      |  23 +
 .../global-aggregate/q03/q03.1.ddl.sqlpp        |  51 ++
 .../global-aggregate/q03/q03.2.update.sqlpp     |  30 ++
 .../global-aggregate/q03/q03.3.query.sqlpp      |  23 +
 .../global-aggregate/q04/q04.1.ddl.sqlpp        |  51 ++
 .../global-aggregate/q04/q04.2.update.sqlpp     |  30 ++
 .../global-aggregate/q04/q04.3.query.sqlpp      |  23 +
 .../q05_error/q05_error.1.ddl.sqlpp             |  51 ++
 .../q05_error/q05_error.2.update.sqlpp          |  30 ++
 .../q05_error/q05_error.3.query.sqlpp           |  23 +
 .../q06_error/q06_error.1.ddl.sqlpp             |  51 ++
 .../q06_error/q06_error.2.update.sqlpp          |  30 ++
 .../q06_error/q06_error.3.query.sqlpp           |  23 +
 .../q07_error/q07_error.1.ddl.sqlpp             |  51 ++
 .../q07_error/q07_error.2.update.sqlpp          |  30 ++
 .../q07_error/q07_error.3.query.sqlpp           |  26 +
 .../global-aggregate/q08/q08.1.ddl.sqlpp        |  51 ++
 .../global-aggregate/q08/q08.2.update.sqlpp     |  30 ++
 .../global-aggregate/q08/q08.3.query.sqlpp      |  23 +
 .../group-by/core-01/core-01.3.query.sqlpp      |   2 +-
 .../group-by/core-02/core-02.3.query.sqlpp      |   2 +-
 .../group-by/core-03/core-02.3.query.sqlpp      |   2 +-
 .../group-by/core-05/core-05.3.query.sqlpp      |   2 +-
 .../group-by/sugar-01/sugar-01.3.query.sqlpp    |   2 +-
 .../group-by/sugar-02/sugar-02.3.query.sqlpp    |   2 +-
 .../group-by/sugar-03/sugar-03.3.query.sqlpp    |   2 +-
 .../group-by/sugar-05/sugar-05.3.query.sqlpp    |   2 +-
 .../hdfs/hdfs_02/hdfs_02.3.query.sqlpp          |   2 +-
 .../hdfs/hdfs_03/hdfs_03.3.query.sqlpp          |   2 +-
 .../hdfs_shortcircuit.3.query.sqlpp             |   2 +-
 .../issue_251_dataset_hint_6.3.query.sqlpp      |   2 +-
 .../list/listify_03/listify_03.3.query.sqlpp    |   4 +-
 .../issue289_query/issue289_query.3.query.sqlpp |   2 +-
 .../assign-reuse/assign-reuse.3.query.sqlpp     |   4 +-
 .../groupby-orderby-count.3.query.sqlpp         |   4 +-
 .../query-issue258.2.update.sqlpp               |   2 +-
 .../everysat_03/everysat_03.3.query.sqlpp       |   2 +-
 .../somesat_03/somesat_03.3.query.sqlpp         |   2 +-
 .../somesat_04/somesat_04.3.query.sqlpp         |   2 +-
 .../count-nullable/count-nullable.3.query.sqlpp |   2 +-
 ...ell-aggregation-with-filtering.3.query.sqlpp |   2 +-
 .../cell-aggregation.3.query.sqlpp              |   2 +-
 .../q01_pricing_summary_report_nt.3.query.sqlpp |  16 +-
 .../temporal/agg_max/agg_max.3.query.sqlpp      |  10 +-
 .../temporal/agg_min/agg_min.3.query.sqlpp      |  10 +-
 .../overlap_bins_gby_1.3.query.sqlpp            |   2 +-
 .../overlap_bins_gby_3.3.query.sqlpp            |   4 +-
 .../query-ASTERIXDB-1331.25.query.sqlpp         |   4 +-
 .../tinysocial-suite.14.query.sqlpp             |   2 +-
 .../tinysocial-suite.22.query.sqlpp             |   2 +-
 .../tinysocial-suite.14.query.sqlpp             |   2 +-
 .../tinysocial-suite.22.query.sqlpp             |   2 +-
 .../tinysocial-suite.25.query.sqlpp             |   4 +-
 .../q01_pricing_summary_report_nt.3.query.sqlpp |  16 +-
 .../q02_minimum_cost_supplier.3.query.sqlpp     |   2 +-
 .../q03_shipping_priority_nt.3.query.sqlpp      |   2 +-
 .../q04_order_priority.3.query.sqlpp            |   2 +-
 .../q05_local_supplier_volume.3.query.sqlpp     |   2 +-
 .../q06_forecast_revenue_change.3.query.sqlpp   |   2 +-
 .../q07_volume_shipping.3.query.sqlpp           |   2 +-
 .../q08_national_market_share.3.query.sqlpp     |   4 +-
 .../q09_product_type_profit_nt.3.query.sqlpp    |   2 +-
 .../q10_returned_item.3.query.sqlpp             |   2 +-
 .../q10_returned_item_int64.3.query.sqlpp       |   2 +-
 .../q11_important_stock.3.query.sqlpp           |   4 +-
 .../q12_shipping/q12_shipping.3.query.sqlpp     |   4 +-
 .../q13_customer_distribution.3.query.sqlpp     |   4 +-
 .../q14_promotion_effect.3.query.sqlpp          |   6 +-
 .../q15_top_supplier.3.query.sqlpp              |   4 +-
 ...16_parts_supplier_relationship.3.query.sqlpp |   6 +-
 .../q17_large_gby_variant.3.query.sqlpp         |  20 +-
 ...7_small_quantity_order_revenue.3.query.sqlpp |   4 +-
 .../q18_large_volume_customer.3.query.sqlpp     |   4 +-
 .../q19_discounted_revenue.3.query.sqlpp        |   2 +-
 .../q20_potential_part_promotion.3.query.sqlpp  |   2 +-
 ...pliers_who_kept_orders_waiting.3.query.sqlpp |  10 +-
 .../q22_global_sales_opportunity.3.query.sqlpp  |   6 +-
 .../query-issue601/query-issue601.3.query.sqlpp |   2 +-
 .../query-issue638/query-issue638.3.query.sqlpp |   4 +-
 .../query-issue785-2.3.query.sqlpp              |   2 +-
 .../query-issue785/query-issue785.3.query.sqlpp |   4 +-
 .../query-issue786/query-issue786.3.query.sqlpp |   2 +-
 .../q06_forecast_revenue_change.3.query.sqlpp   |   7 +-
 .../q11_important_stock.3.query.sqlpp           |   8 +-
 .../q13_customer_distribution.3.query.sqlpp     |   2 +-
 .../q15_top_supplier.3.query.sqlpp              |   7 +-
 ...7_small_quantity_order_revenue.3.query.sqlpp |   9 +-
 .../q19_discounted_revenue.3.query.sqlpp        |  13 +-
 .../q22_global_sales_opportunity.3.query.sqlpp  |   6 +-
 .../query-issue562/query-issue562.3.query.sqlpp |   2 +-
 .../query-issue810-2.3.query.sqlpp              |   2 +-
 .../query-issue810-3.3.query.sqlpp              |   4 +-
 .../query-issue810/query-issue810.3.query.sqlpp |   4 +-
 .../nest_aggregate/nest_aggregate.3.query.sqlpp |   2 +-
 .../nest_aggregate2.3.query.sqlpp               |   2 +-
 .../q01_pricing_summary_report_nt.3.query.sqlpp |  14 +-
 .../q02_minimum_cost_supplier.3.query.sqlpp     |   2 +-
 .../q03_shipping_priority_nt.3.query.sqlpp      |   2 +-
 .../q05_local_supplier_volume.3.query.sqlpp     |   2 +-
 .../q06_forecast_revenue_change.3.query.sqlpp   |   2 +-
 .../q07_volume_shipping.3.query.sqlpp           |   2 +-
 .../q08_national_market_share.3.query.sqlpp     |   4 +-
 .../q09_product_type_profit_nt.3.query.sqlpp    |   2 +-
 .../q10_returned_item.3.query.sqlpp             |   2 +-
 .../q10_returned_item_int64.3.query.sqlpp       |   2 +-
 .../q11_important_stock.3.query.sqlpp           |   4 +-
 .../q12_shipping/q12_shipping.3.query.sqlpp     |   4 +-
 .../q13_customer_distribution.3.query.sqlpp     |   4 +-
 .../q14_promotion_effect.3.query.sqlpp          |   4 +-
 .../q15_top_supplier.3.query.sqlpp              |   4 +-
 ...16_parts_supplier_relationship.3.query.sqlpp |   2 +-
 .../q17_large_gby_variant.3.query.sqlpp         |  20 +-
 ...7_small_quantity_order_revenue.3.query.sqlpp |   4 +-
 .../q18_large_volume_customer.3.query.sqlpp     |   4 +-
 .../q19_discounted_revenue.3.query.sqlpp        |   2 +-
 .../q20_potential_part_promotion.3.query.sqlpp  |   2 +-
 ...pliers_who_kept_orders_waiting.3.query.sqlpp |   8 +-
 .../q22_global_sales_opportunity.3.query.sqlpp  |   4 +-
 .../query-issue562/query-issue562.3.query.sqlpp |   6 +-
 .../query-issue785-2.3.query.sqlpp              |   2 +-
 .../query-issue785/query-issue785.3.query.sqlpp |   4 +-
 .../query-issue786/query-issue786.3.query.sqlpp |   2 +-
 .../query-issue810-2.3.query.sqlpp              |   2 +-
 .../query-issue810-3.3.query.sqlpp              |   2 +-
 .../query-issue810/query-issue810.3.query.sqlpp |   2 +-
 .../query-issue827-2.3.query.sqlpp              |  16 +-
 .../query-issue827/query-issue827.3.query.sqlpp |   4 +-
 .../nest_aggregate/nest_aggregate.3.query.sqlpp |   2 +-
 .../nest_aggregate2.3.query.sqlpp               |   2 +-
 .../q01_pricing_summary_report_nt.3.query.sqlpp |  14 +-
 .../q02_minimum_cost_supplier.3.query.sqlpp     |   2 +-
 .../q03_shipping_priority_nt.3.query.sqlpp      |   2 +-
 .../q05_local_supplier_volume.3.query.sqlpp     |   2 +-
 .../q06_forecast_revenue_change.3.query.sqlpp   |  10 +-
 .../q06_forecast_revenue_change.4.query.sqlpp   |  27 +
 .../q07_volume_shipping.3.query.sqlpp           |   2 +-
 .../q08_national_market_share.3.query.sqlpp     |   4 +-
 .../q09_product_type_profit_nt.3.query.sqlpp    |   2 +-
 .../q10_returned_item.3.query.sqlpp             |   2 +-
 .../q10_returned_item_int64.3.query.sqlpp       |   2 +-
 .../q11_important_stock.3.query.sqlpp           |   4 +-
 .../q12_shipping/q12_shipping.3.query.sqlpp     |   4 +-
 .../q13_customer_distribution.3.query.sqlpp     |   4 +-
 .../q14_promotion_effect.3.query.sqlpp          |   4 +-
 .../q15_top_supplier.3.query.sqlpp              |   4 +-
 ...16_parts_supplier_relationship.3.query.sqlpp |   2 +-
 .../q17_large_gby_variant.3.query.sqlpp         |  20 +-
 ...7_small_quantity_order_revenue.3.query.sqlpp |   4 +-
 .../q18_large_volume_customer.3.query.sqlpp     |   4 +-
 .../q19_discounted_revenue.3.query.sqlpp        |   2 +-
 .../q20_potential_part_promotion.3.query.sqlpp  |   2 +-
 ...pliers_who_kept_orders_waiting.3.query.sqlpp |   8 +-
 .../q22_global_sales_opportunity.3.query.sqlpp  |   4 +-
 .../query-issue562/query-issue562.3.query.sqlpp |   6 +-
 .../query-issue638/query-issue638.3.query.sqlpp |   2 +-
 .../query-issue785-2.3.query.sqlpp              |   2 +-
 .../query-issue785/query-issue785.3.query.sqlpp |   4 +-
 .../query-issue786/query-issue786.3.query.sqlpp |   2 +-
 .../query-issue810-2.3.query.sqlpp              |   2 +-
 .../query-issue810-3.3.query.sqlpp              |   2 +-
 .../query-issue810/query-issue810.3.query.sqlpp |   2 +-
 .../query-issue827-2.3.query.sqlpp              |  16 +-
 .../query-issue827/query-issue827.3.query.sqlpp |   4 +-
 .../query-issue489/query-issue489.2.query.sqlpp |   2 +-
 .../query-issue489/query-issue489.4.query.sqlpp |   2 +-
 .../results/global-aggregate/q01/q01.1.adm      |   1 +
 .../results/global-aggregate/q02/q02.1.adm      |   1 +
 .../results/global-aggregate/q08/q08.1.adm      |  10 +
 .../q06_forecast_revenue_change.2.adm           |   1 +
 .../q06_forecast_revenue_change.3.ast           | 148 +++---
 .../q06_forecast_revenue_change.4.ast           |  73 +++
 .../resources/runtimets/testsuite_sqlpp.xml     |  45 ++
 .../lang/common/clause/GroupbyClause.java       |  12 +
 .../asterix/lang/common/clause/LimitClause.java |   4 +
 .../lang/common/expression/CallExpr.java        |   6 +-
 .../lang/common/expression/OperatorExpr.java    |  39 +-
 .../asterix/lang/common/statement/Query.java    |  12 +
 .../CloneAndSubstituteVariablesVisitor.java     |   8 +-
 .../asterix/lang/sqlpp/clause/SelectBlock.java  |   4 +
 .../rewrites/SqlppFunctionBodyRewriter.java     |   3 +
 .../lang/sqlpp/rewrites/SqlppQueryRewriter.java |  41 +-
 .../visitor/InlineColumnAliasVisitor.java       | 450 +++++++++++++++++
 .../SqlppBuiltinFunctionRewriteVisitor.java     |  46 ++
 .../SqlppGlobalAggregationSugarVisitor.java     |  67 +++
 .../visitor/SqlppGroupBySugarVisitor.java       | 123 +++++
 .../rewrites/visitor/SqlppGroupByVisitor.java   | 168 ++++++
 .../visitor/SqlppInlineUdfsVisitor.java         | 237 +++++++++
 .../visitor/VariableCheckAndRewriteVisitor.java | 102 ++++
 .../lang/sqlpp/util/FunctionMapUtil.java        | 150 ++++++
 .../lang/sqlpp/util/SqlppRewriteUtil.java       |  19 +-
 .../lang/sqlpp/util/SqlppVariableUtil.java      |  84 +++
 .../visitor/CheckSql92AggregateVisitor.java     | 265 ++++++++++
 .../lang/sqlpp/visitor/DeepCopyVisitor.java     | 415 +++++++++++++++
 .../lang/sqlpp/visitor/FreeVariableVisitor.java | 471 +++++++++++++++++
 .../sqlpp/visitor/InlineColumnAliasVisitor.java | 447 ----------------
 .../sqlpp/visitor/SqlppAstPrintVisitor.java     |  24 +
 .../visitor/SqlppDeleteRewriteVisitor.java      |   2 +-
 .../sqlpp/visitor/SqlppGroupBySugarVisitor.java | 127 -----
 .../lang/sqlpp/visitor/SqlppGroupByVisitor.java | 170 -------
 .../sqlpp/visitor/SqlppInlineUdfsVisitor.java   | 236 ---------
 .../SqlppSubstituteVariablesVisitor.java        |   7 +-
 .../lang/sqlpp/visitor/UsedVariableVisitor.java | 362 -------------
 .../visitor/VariableCheckAndRewriteVisitor.java | 505 -------------------
 .../AbstractSqlppExpressionScopingVisitor.java  | 284 +++++++++++
 .../AbstractSqlppSimpleExpressionVisitor.java   | 347 +++++++++++++
 452 files changed, 5247 insertions(+), 2762 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java
----------------------------------------------------------------------
diff --git a/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java b/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java
index 49e9399..9cbc88a 100644
--- a/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java
+++ b/asterix-algebra/src/main/java/org/apache/asterix/translator/LangExpressionToPlanTranslator.java
@@ -725,33 +725,7 @@ class LangExpressionToPlanTranslator
     @Override
     public Pair<ILogicalOperator, LogicalVariable> visit(GroupbyClause gc, Mutable<ILogicalOperator> tupSource)
             throws AsterixException {
-        GroupByOperator gOp = new GroupByOperator();
         Mutable<ILogicalOperator> topOp = tupSource;
-        for (GbyVariableExpressionPair ve : gc.getGbyPairList()) {
-            LogicalVariable v;
-            VariableExpr vexpr = ve.getVar();
-            if (vexpr != null) {
-                v = context.newVar(vexpr);
-            } else {
-                v = context.newVar();
-            }
-            Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = langExprToAlgExpression(ve.getExpr(), topOp);
-            gOp.addGbyExpression(v, eo.first);
-            topOp = eo.second;
-        }
-        for (GbyVariableExpressionPair ve : gc.getDecorPairList()) {
-            LogicalVariable v;
-            VariableExpr vexpr = ve.getVar();
-            if (vexpr != null) {
-                v = context.newVar(vexpr);
-            } else {
-                v = context.newVar();
-            }
-            Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = langExprToAlgExpression(ve.getExpr(), topOp);
-            gOp.addDecorExpression(v, eo.first);
-            topOp = eo.second;
-        }
-
         if (gc.hasGroupVar()) {
             List<Pair<Expression, Identifier>> groupFieldList = gc.getGroupFieldList();
             List<Mutable<ILogicalExpression>> groupRecordConstructorArgList = new ArrayList<>();
@@ -770,29 +744,75 @@ class LangExpressionToPlanTranslator
             groupVarAssignOp.getInputs().add(topOp);
             topOp = new MutableObject<ILogicalOperator>(groupVarAssignOp);
         }
+        if (gc.isGroupAll()) {
+            List<LogicalVariable> aggVars = new ArrayList<>();
+            List<Mutable<ILogicalExpression>> aggFuncs = new ArrayList<>();
+            for (VariableExpr var : gc.getWithVarList()) {
+                LogicalVariable aggVar = context.newVar();
+                LogicalVariable oldVar = context.getVar(var);
+                List<Mutable<ILogicalExpression>> flArgs = new ArrayList<Mutable<ILogicalExpression>>();
+                flArgs.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(oldVar)));
+                AggregateFunctionCallExpression fListify = AsterixBuiltinFunctions
+                        .makeAggregateFunctionExpression(AsterixBuiltinFunctions.LISTIFY, flArgs);
+                aggVars.add(aggVar);
+                aggFuncs.add(new MutableObject<ILogicalExpression>(fListify));
+                // Hide the variable that was part of the "with", replacing it with
+                // the one bound by the aggregation op.
+                context.setVar(var, aggVar);
+            }
+            AggregateOperator aggOp = new AggregateOperator(aggVars, aggFuncs);
+            aggOp.getInputs().add(topOp);
+            return new Pair<ILogicalOperator, LogicalVariable>(aggOp, null);
+        } else {
+            GroupByOperator gOp = new GroupByOperator();
+            for (GbyVariableExpressionPair ve : gc.getGbyPairList()) {
+                LogicalVariable v;
+                VariableExpr vexpr = ve.getVar();
+                if (vexpr != null) {
+                    v = context.newVar(vexpr);
+                } else {
+                    v = context.newVar();
+                }
+                Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = langExprToAlgExpression(ve.getExpr(), topOp);
+                gOp.addGbyExpression(v, eo.first);
+                topOp = eo.second;
+            }
+            for (GbyVariableExpressionPair ve : gc.getDecorPairList()) {
+                LogicalVariable v;
+                VariableExpr vexpr = ve.getVar();
+                if (vexpr != null) {
+                    v = context.newVar(vexpr);
+                } else {
+                    v = context.newVar();
+                }
+                Pair<ILogicalExpression, Mutable<ILogicalOperator>> eo = langExprToAlgExpression(ve.getExpr(), topOp);
+                gOp.addDecorExpression(v, eo.first);
+                topOp = eo.second;
+            }
 
-        gOp.getInputs().add(topOp);
-        for (VariableExpr var : gc.getWithVarList()) {
-            LogicalVariable aggVar = context.newVar();
-            LogicalVariable oldVar = context.getVar(var);
-            List<Mutable<ILogicalExpression>> flArgs = new ArrayList<Mutable<ILogicalExpression>>(1);
-            flArgs.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(oldVar)));
-            AggregateFunctionCallExpression fListify = AsterixBuiltinFunctions
-                    .makeAggregateFunctionExpression(AsterixBuiltinFunctions.LISTIFY, flArgs);
-            AggregateOperator agg = new AggregateOperator(mkSingletonArrayList(aggVar),
-                    (List) mkSingletonArrayList(new MutableObject<ILogicalExpression>(fListify)));
-
-            agg.getInputs().add(new MutableObject<ILogicalOperator>(
-                    new NestedTupleSourceOperator(new MutableObject<ILogicalOperator>(gOp))));
-            ILogicalPlan plan = new ALogicalPlanImpl(new MutableObject<ILogicalOperator>(agg));
-            gOp.getNestedPlans().add(plan);
-            // Hide the variable that was part of the "with", replacing it with
-            // the one bound by the aggregation op.
-            context.setVar(var, aggVar);
+            gOp.getInputs().add(topOp);
+            for (VariableExpr var : gc.getWithVarList()) {
+                LogicalVariable aggVar = context.newVar();
+                LogicalVariable oldVar = context.getVar(var);
+                List<Mutable<ILogicalExpression>> flArgs = new ArrayList<Mutable<ILogicalExpression>>(1);
+                flArgs.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(oldVar)));
+                AggregateFunctionCallExpression fListify = AsterixBuiltinFunctions
+                        .makeAggregateFunctionExpression(AsterixBuiltinFunctions.LISTIFY, flArgs);
+                AggregateOperator agg = new AggregateOperator(mkSingletonArrayList(aggVar),
+                        (List) mkSingletonArrayList(new MutableObject<ILogicalExpression>(fListify)));
+
+                agg.getInputs().add(new MutableObject<ILogicalOperator>(
+                        new NestedTupleSourceOperator(new MutableObject<ILogicalOperator>(gOp))));
+                ILogicalPlan plan = new ALogicalPlanImpl(new MutableObject<ILogicalOperator>(agg));
+                gOp.getNestedPlans().add(plan);
+                // Hide the variable that was part of the "with", replacing it with
+                // the one bound by the aggregation op.
+                context.setVar(var, aggVar);
+            }
+            gOp.getAnnotations().put(OperatorAnnotations.USE_HASH_GROUP_BY, gc.hasHashGroupByHint());
+            return new Pair<ILogicalOperator, LogicalVariable>(gOp, null);
         }
 
-        gOp.getAnnotations().put(OperatorAnnotations.USE_HASH_GROUP_BY, gc.hasHashGroupByHint());
-        return new Pair<ILogicalOperator, LogicalVariable>(gOp, null);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestExecutor.java
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestExecutor.java b/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestExecutor.java
index d6cf231..7f7fbb4 100644
--- a/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestExecutor.java
+++ b/asterix-app/src/test/java/org/apache/asterix/test/sqlpp/ParserTestExecutor.java
@@ -174,6 +174,7 @@ public class ParserTestExecutor extends TestExecutor {
                         + "org.apache.asterix.lang.common.rewrites.LangRewritingContext)",
                 declaredFunctions, topExpr, metadataProvider, context);
         PA.invokeMethod(rewriter, "inlineColumnAlias()");
+        PA.invokeMethod(rewriter, "rewriteGlobalAggregations()");
         PA.invokeMethod(rewriter, "rewriteGroupBys()");
         PA.invokeMethod(rewriter, "variableCheckAndRewrite(boolean)", Boolean.TRUE);
     }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/count-tweets.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/count-tweets.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/count-tweets.sqlpp
index a2ddf4b..0bea252 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/count-tweets.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/count-tweets.sqlpp
@@ -35,7 +35,7 @@ create type twitter.Tweet as
 create external  table TwitterData(Tweet) using localfs(("path"="asterix_nc1://data/twitter/smalltweets.txt"),("format"="adm"));
 
 write output to asterix_nc1:"/tmp/count-tweets.adm"
-select element {'word':tok,'count':twitter.count(token)}
+select element {'word':tok,'count':count(token)}
 from  TwitterData as t,
       tokens as token
 with  tokens as twitter."word-tokens"(t.text)

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/denorm-cust-order.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/denorm-cust-order.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/denorm-cust-order.sqlpp
index b5fc4ea..d8e2b7a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/denorm-cust-order.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/denorm-cust-order.sqlpp
@@ -53,7 +53,7 @@ create type custorder.OrderType as
   total : float
 }
 
-create  nodegroup group1 if not exists  on 
+create  nodegroup group1 if not exists  on
     asterix_nc1,
     asterix_nc2
 ;
@@ -62,7 +62,7 @@ create  table Customers(CustomerType) primary key cid on group1;
 create  table Orders(OrderType) primary key oid on group1;
 
 write output to asterix_nc1:"/tmp/custorder.adm"
-select element {'cid':cid,'cust':cust,'cnt-orders':custorder.count(o),'orders':o}
+select element {'cid':cid,'cust':cust,'cnt-orders':count(o),'orders':o}
 from  Customers as c,
       Orders as o
 where (c.cid = o.cid)

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/distinct_aggregate.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/distinct_aggregate.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/distinct_aggregate.sqlpp
index 877bb0f..6b95c9c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/distinct_aggregate.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/distinct_aggregate.sqlpp
@@ -43,14 +43,14 @@ create type tpch.LineItemType as
   l_comment : string
 }
 
-create  nodegroup group1 if not exists  on 
+create  nodegroup group1 if not exists  on
     asterix_nc1,
     asterix_nc2
 ;
 create  table LineItems_q1(LineItemType) primary key l_orderkey,l_linenumber on group1;
 
 write output to asterix_nc1:"rttest/tpch_q1_pricing_summary_report_nt.adm"
-select element {'l_returnflag':l_returnflag,'l_linestatus':l_linestatus,'count_suppkey':tpch.count(g)}
+select element {'l_returnflag':l_returnflag,'l_linestatus':l_linestatus,'count_suppkey':count(g)}
 from  (
     select element {'l_returnflag':l_returnflag,'l_linestatus':l_linestatus,'l_suppkey':l_suppkey}
     from  LineItems_q1 as l

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/fj-phase1.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/fj-phase1.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/fj-phase1.sqlpp
index 4e274e5..f1d5086 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/fj-phase1.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/fj-phase1.sqlpp
@@ -56,7 +56,7 @@ with  tokens as (
           from  Users as user,
                 user.lottery_numbers as lottery_number
           group by lottery_number as item
-          with  count as rares03.count(user)
+          with  count as count(user)
           order by count desc
       ) as token at i
       where (lottery_number = token)

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/fj-phase2-with-hints.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/fj-phase2-with-hints.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/fj-phase2-with-hints.sqlpp
index 7850337..c82f62c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/fj-phase2-with-hints.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/fj-phase2-with-hints.sqlpp
@@ -51,7 +51,7 @@ with  unrankedTokensDBLP as fuzzyjoin_078."counthashed-word-tokens"(paperDBLP.ti
                 fuzzyjoin_078."counthashed-word-tokens"(paper.title) as token
           /* +hash */
           group by token as tokenGroupped
-          order by fuzzyjoin_078.count(paper),tokenGroupped
+          order by count(paper),tokenGroupped
       ) as tokenRanked at i
       where (token = tokenRanked)
       order by i

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/inlined_q18_large_volume_customer.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/inlined_q18_large_volume_customer.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/inlined_q18_large_volume_customer.sqlpp
index 10bf154..91680fe 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/inlined_q18_large_volume_customer.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/inlined_q18_large_volume_customer.sqlpp
@@ -79,14 +79,14 @@ create  table Orders(OrderType) primary key o_orderkey on group1;
 create  table Customers(CustomerType) primary key c_custkey on group1;
 
 write output to asterix_nc1:"/tmp/inlined_q18_large_volume_customer.adm"
-select element {'c_name':c_name,'c_custkey':c_custkey,'o_orderkey':o_orderkey,'o_orderdate':o_orderdate,'o_totalprice':o_totalprice,'sum_quantity':inlined_q18_large_volume_customer.sum((
+select element {'c_name':c_name,'c_custkey':c_custkey,'o_orderkey':o_orderkey,'o_orderdate':o_orderdate,'o_totalprice':o_totalprice,'sum_quantity':inlined_q18_large_volume_customer.coll_sum((
         select element j.l_quantity
         from  l as j
     ))}
 from  Customers as c,
       Orders as o,
       (
-    select element {'l_orderkey':l_orderkey,'t_sum_quantity':inlined_q18_large_volume_customer.sum((
+    select element {'l_orderkey':l_orderkey,'t_sum_quantity':inlined_q18_large_volume_customer.coll_sum((
             select element i.l_quantity
             from  l as i
         ))}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nest_aggregate.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nest_aggregate.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nest_aggregate.sqlpp
index 2b67f09..80fb9bc 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nest_aggregate.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/nest_aggregate.sqlpp
@@ -124,7 +124,7 @@ select element {'nation_key':nation.n_nationkey,'name':nation.n_name,'aggregates
               Customer as customer
         where ((orders.o_custkey = customer.c_custkey) and (customer.c_nationkey = nation.n_nationkey))
         group by orders.o_orderdate as orderdate
-        with  sum as tpch.sum((
+        with  sum as tpch.coll_sum((
               select element o.o_totalprice
               from  orders as o
           ))

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/orders-aggreg.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/orders-aggreg.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/orders-aggreg.sqlpp
index 4a6203a..c216c66 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/orders-aggreg.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/orders-aggreg.sqlpp
@@ -33,17 +33,17 @@ create type "orders-aggreg".OrderType as
   total : float
 }
 
-create  nodegroup group1 if not exists  on 
+create  nodegroup group1 if not exists  on
     asterix_nc1,
     asterix_nc2
 ;
 create  table Orders(OrderType) primary key oid on group1;
 
 write output to asterix_nc1:"/tmp/orders-aggreg.adm"
-select element {'cid':cid,'ordpercust':"orders-aggreg".count(o),'totalcust':"orders-aggreg".sum((
+select element {'cid':cid,'ordpercust':"orders-aggreg".coll_count(o),'totalcust':"orders-aggreg".coll_sum((
         select element i.total
         from  o as i
-    )),'avgcust':"orders-aggreg".avg((
+    )),'avgcust':"orders-aggreg".coll_avg((
         select element i.total
         from  o as i
     ))}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q01_pricing_summary_report_nt.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q01_pricing_summary_report_nt.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q01_pricing_summary_report_nt.sqlpp
index c6c79b9..9642265 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q01_pricing_summary_report_nt.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q01_pricing_summary_report_nt.sqlpp
@@ -48,28 +48,28 @@ create  table LineItem(LineItemType) primary key l_orderkey,l_linenumber;
 load  table LineItem using localfs (("path"="asterix_nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
 
 write output to asterix_nc1:"rttest/tpch_q1_pricing_summary_report_nt.adm"
-select element {'l_returnflag':l_returnflag,'l_linestatus':l_linestatus,'sum_qty':tpch.sum((
+select element {'l_returnflag':l_returnflag,'l_linestatus':l_linestatus,'sum_qty':tpch.coll_sum((
         select element i.l_quantity
         from  l as i
-    )),'sum_base_price':tpch.sum((
+    )),'sum_base_price':tpch.coll_sum((
         select element i.l_extendedprice
         from  l as i
-    )),'sum_disc_price':tpch.sum((
+    )),'sum_disc_price':tpch.coll_sum((
         select element (i.l_extendedprice * (1 - i.l_discount))
         from  l as i
-    )),'sum_charge':tpch.sum((
+    )),'sum_charge':tpch.coll_sum((
         select element (i.l_extendedprice * (1 - i.l_discount) * (1 + i.l_tax))
         from  l as i
-    )),'ave_qty':tpch.avg((
+    )),'ave_qty':tpch.coll_avg((
         select element i.l_quantity
         from  l as i
-    )),'ave_price':tpch.avg((
+    )),'ave_price':tpch.coll_avg((
         select element i.l_extendedprice
         from  l as i
-    )),'ave_disc':tpch.avg((
+    )),'ave_disc':tpch.coll_avg((
         select element i.l_discount
         from  l as i
-    )),'count_order':tpch.count(l)}
+    )),'count_order':tpch.coll_count(l)}
 from  LineItem as l
 where (l.l_shipdate <= '1998-09-02')
 /* +hash */

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q03_shipping_priority.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q03_shipping_priority.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q03_shipping_priority.sqlpp
index 7c05feb..6980bdd 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q03_shipping_priority.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q03_shipping_priority.sqlpp
@@ -86,7 +86,7 @@ from  Customers as c,
 where (((c.c_mktsegment = 'BUILDING') and (c.c_custkey = o.o_custkey)) and ((l.l_orderkey = o.o_orderkey) and (o.o_orderdate < '1995-03-15') and (l.l_shipdate > '1995-03-15')))
 /* +hash */
 group by l.l_orderkey as l_orderkey,o.o_orderdate as o_orderdate,o.o_shippriority as o_shippriority
-with  revenue as q3_shipping_priority.sum((
+with  revenue as q3_shipping_priority.coll_sum((
       select element (i.l_extendedprice * (1 - i.l_discount))
       from  l as i
   ))

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q05_local_supplier_volume.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q05_local_supplier_volume.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q05_local_supplier_volume.sqlpp
index 58093e0..df9b375 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q05_local_supplier_volume.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q05_local_supplier_volume.sqlpp
@@ -137,7 +137,7 @@ from  Customers as c,
 where ((c.c_nationkey = o1.s_nationkey) and (c.c_custkey = o1.o_custkey))
 /* +hash */
 group by o1.n_name as n_name
-with  revenue as q5_local_supplier.sum((
+with  revenue as q5_local_supplier.coll_sum((
       select element (i.l_extendedprice * (1 - i.l_discount))
       from  o1 as i
   ))

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q2.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q2.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q2.sqlpp
index 74a8f59..5472ad0 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q2.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/q2.sqlpp
@@ -62,9 +62,9 @@ from  Event as event,
       event.sponsoring_sigs as sponsor
 with  es as {'event':event,'sponsor':sponsor}
 group by sponsor.sig_name as sig_name
-with  sig_sponsorship_count as events.count(es),
+with  sig_sponsorship_count as count(es),
       by_chapter as (
-      select element {'chapter_name':chapter_name,'escount':events.count(e)}
+      select element {'chapter_name':chapter_name,'escount':count(e)}
       from  es as e
       group by e.sponsor.chapter_name as chapter_name
   )

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue562.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue562.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue562.sqlpp
index 5fb9440..c87d0d0 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue562.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue562.sqlpp
@@ -86,18 +86,18 @@ declare function q22_customer_tmp() {
     where ((phone_substr = '13') or (phone_substr = '31') or (phone_substr = '23') or (phone_substr = '29') or (phone_substr = '30') or (phone_substr = '18') or (phone_substr = '17'))
 )
 };
-with  avg as tpch.avg((
+with  avg as tpch.coll_avg((
       select element c.c_acctbal
       from  Customer as c
       with  phone_substr as tpch.substring(c.c_phone,1,2)
       where ((c.c_acctbal > 0.0) and ((phone_substr = '13') or (phone_substr = '31') or (phone_substr = '23') or (phone_substr = '29') or (phone_substr = '30') or (phone_substr = '18') or (phone_substr = '17')))
   ))
-select element {'cntrycode':cntrycode,'numcust':tpch.count(ct),'totacctbal':tpch.sum((
+select element {'cntrycode':cntrycode,'numcust':tpch.coll_count(ct),'totacctbal':tpch.coll_sum((
         select element i.c_acctbal
         from  ct as i
     ))}
 from  tpch.q22_customer_tmp() as ct
-where (tpch.count((
+where (tpch.coll_count((
     select element o
     from  Orders as o
     where (ct.c_custkey = o.o_custkey)

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue601.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue601.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue601.sqlpp
index 5f60eb0..1c68428 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue601.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue601.sqlpp
@@ -51,7 +51,7 @@ create type tpch.LineItemType as
 
 create  table LineItem(LineItemType) primary key l_orderkey,l_linenumber;
 
-select element {'l_linenumber':l_linenumber,'count_order':tpch.count(l)}
+select element {'l_linenumber':l_linenumber,'count_order':count(l)}
 from  LineItem as l
 group by l.l_linenumber as l_linenumber
 ;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue697.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue697.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue697.sqlpp
index 5d23126..813109a 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue697.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue697.sqlpp
@@ -37,7 +37,7 @@ create type test.TestType as
 
 create  table test(TestType) primary key key1;
 
-select element {'gid':aid,'avg':test.avg((
+select element {'gid':aid,'avg':test.coll_avg((
         select element j."value"
         from  i as j
         where test.not(test."is-null"(j."value"))

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue785.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue785.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue785.sqlpp
index aecafb4..09bd754 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue785.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue785.sqlpp
@@ -105,7 +105,7 @@ with  t as (
             Orders as orders
       where ((orders.o_custkey = customer.c_custkey) and (customer.c_nationkey = n.n_nationkey))
       group by orders.o_orderdate as orderdate,n.n_nationkey as nation_key
-      with  sum as tpch.sum((
+      with  sum as tpch.coll_sum((
             select element o.o_totalprice
             from  orders as o
         ))

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue810-2.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue810-2.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue810-2.sqlpp
index b2e4121..16655ff 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue810-2.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue810-2.sqlpp
@@ -51,7 +51,7 @@ create type tpch.LineItemType as
 
 create  table LineItem(LineItemType) primary key l_orderkey,l_linenumber;
 
-select element {'l_returnflag':l_returnflag,'l_linestatus':l_linestatus,'count_cheaps':tpch.count(cheaps),'avg_expensive_discounts':tpch.avg(expensives),'sum_disc_prices':tpch.sum(disc_prices),'total_charges':tpch.sum(charges)}
+select element {'l_returnflag':l_returnflag,'l_linestatus':l_linestatus,'count_cheaps':tpch.coll_count(cheaps),'avg_expensive_discounts':tpch.coll_avg(expensives),'sum_disc_prices':tpch.coll_sum(disc_prices),'total_charges':tpch.coll_sum(charges)}
 from  LineItem as l
 where (l.l_shipdate <= '1998-09-02')
 /* +hash */

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue810.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue810.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue810.sqlpp
index da41e12..50760dc 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue810.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue810.sqlpp
@@ -51,7 +51,7 @@ create type tpch.LineItemType as
 
 create  table LineItem(LineItemType) primary key l_orderkey,l_linenumber;
 
-select element {'l_returnflag':l_returnflag,'l_linestatus':l_linestatus,'count_cheaps':tpch.count(cheap),'count_expensives':tpch.count(expensive)}
+select element {'l_returnflag':l_returnflag,'l_linestatus':l_linestatus,'count_cheaps':tpch.coll_count(cheap),'count_expensives':tpch.coll_count(expensive)}
 from  LineItem as l
 where (l.l_shipdate <= '1998-09-02')
 /* +hash */

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue827-2.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue827-2.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue827-2.sqlpp
index c5ad063..f7c8ddf 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue827-2.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/query-issue827-2.sqlpp
@@ -51,30 +51,30 @@ create type tpch.LineItemType as
 
 create  table LineItem(LineItemType) primary key l_orderkey,l_linenumber;
 
-{'sum_qty_partial':tpch.sum((
+{'sum_qty_partial':tpch.coll_sum((
     select element i.l_quantity
     from  LineItem as i
     where (i.l_shipdate <= '1998-09-02')
-)),'sum_base_price':tpch.sum((
+)),'sum_base_price':tpch.coll_sum((
     select element i.l_extendedprice
     from  LineItem as i
-)),'sum_disc_price':tpch.sum((
+)),'sum_disc_price':tpch.coll_sum((
     select element (i.l_extendedprice * (1 - i.l_discount))
     from  LineItem as i
-)),'sum_charge':tpch.sum((
+)),'sum_charge':tpch.coll_sum((
     select element (i.l_extendedprice * (1 - i.l_discount) * (1 + i.l_tax))
     from  LineItem as i
-)),'ave_qty':tpch.avg((
+)),'ave_qty':tpch.coll_avg((
     select element i.l_quantity
     from  LineItem as i
     where (i.l_shipdate <= '1998-09-02')
-)),'ave_price':tpch.avg((
+)),'ave_price':tpch.coll_avg((
     select element i.l_extendedprice
     from  LineItem as i
-)),'ave_disc':tpch.avg((
+)),'ave_disc':tpch.coll_avg((
     select element i.l_discount
     from  LineItem as i
-)),'count_order':tpch.count((
+)),'count_order':tpch.coll_count((
     select element l
     from  LineItem as l
 ))};

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/split-materialization-above-join.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/split-materialization-above-join.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/split-materialization-above-join.sqlpp
index 07ccedc..94bcbf1 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/split-materialization-above-join.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/split-materialization-above-join.sqlpp
@@ -54,7 +54,7 @@ from  DBLP as paperLeft,
               from  DBLP as paper,
                     fuzzyjoin."counthashed-word-tokens"(paper.title) as token
               group by token as tokenGroupped
-              order by fuzzyjoin.count(paper),tokenGroupped
+              order by count(paper),tokenGroupped
           ) as tokenRanked at i
           where (tokenUnranked = tokenRanked)
           order by i
@@ -68,7 +68,7 @@ from  DBLP as paperLeft,
               from  DBLP as paper,
                     fuzzyjoin."counthashed-word-tokens"(paper.title) as token
               group by token as tokenGroupped
-              order by fuzzyjoin.count(paper),tokenGroupped
+              order by count(paper),tokenGroupped
           ) as tokenRanked at i
           where (tokenUnranked = tokenRanked)
           order by i

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/optimizerts/queries_sqlpp/split-materialization.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/split-materialization.sqlpp b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/split-materialization.sqlpp
index 9f9d609..0cd244c 100644
--- a/asterix-app/src/test/resources/optimizerts/queries_sqlpp/split-materialization.sqlpp
+++ b/asterix-app/src/test/resources/optimizerts/queries_sqlpp/split-materialization.sqlpp
@@ -45,12 +45,12 @@ create  table FacebookUsers(FacebookUserType) primary key id;
 with  lonelyusers as (
       select element d
       from  FacebookUsers as d
-      where (TinySocial.count(d."friend-ids") < 2)
+      where (TinySocial.coll_count(d."friend-ids") < 2)
   ),
       lonelyusers2 as (
       select element d
       from  FacebookUsers as d
-      where (TinySocial.count(d."friend-ids") < 2)
+      where (TinySocial.coll_count(d."friend-ids") < 2)
   )
 select element {'user1':{'id':l1.id,'name':l1.name},'user2':{'id':l2.id,'name':l2.name}}
 from  lonelyusers as l1,

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null/agg_null.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null/agg_null.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null/agg_null.3.query.sqlpp
index 4529b3c..68c00f0 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null/agg_null.3.query.sqlpp
+++ b/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':"sql-count"([null]),'average1':"sql-avg"([null]),'sql-sum1':"sql-sum"([null]),'sql-min1':"sql-min"([null]),'sql-max1':"sql-max"([null]),'sql-count2':"sql-count"({{null,null}}),'average2':"sql-avg"({{null,null}}),'sql-sum2':"sql-sum"({{null,null}}),'sql-min2':"sql-min"({{null,null}}),'sql-max2':"sql-max"({{null,null}})};
+{'sql-count1':"coll_sql-count"([null]),'average1':"coll_sql-avg"([null]),'sql-sum1':"coll_sql-sum"([null]),'sql-min1':"coll_sql-min"([null]),'sql-max1':"coll_sql-max"([null]),'sql-count2':"coll_sql-count"({{null,null}}),'average2':"coll_sql-avg"({{null,null}}),'sql-sum2':"coll_sql-sum"({{null,null}}),'sql-min2':"coll_sql-min"({{null,null}}),'sql-max2':"coll_sql-max"({{null,null}})};

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null_rec/agg_null_rec.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null_rec/agg_null_rec.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null_rec/agg_null_rec.3.query.sqlpp
index f720a2c..83037b7 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null_rec/agg_null_rec.3.query.sqlpp
+++ b/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."sql-count"((
+{'sql-count':test."coll_sql-count"((
     select element t.valplus
     from  Test as t
-)),'average':test."sql-avg"((
+)),'average':test."coll_sql-avg"((
     select element t.valplus
     from  Test as t
-)),'sql-sum':test."sql-sum"((
+)),'sql-sum':test."coll_sql-sum"((
     select element t.valplus
     from  Test as t
-)),'sql-min':test."sql-min"((
+)),'sql-min':test."coll_sql-min"((
     select element t.valplus
     from  Test as t
-)),'sql-max':test."sql-max"((
+)),'sql-max':test."coll_sql-max"((
     select element t.valplus
     from  Test as t
 ))};

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null_rec_1/agg_null_rec_1.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null_rec_1/agg_null_rec_1.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null_rec_1/agg_null_rec_1.3.query.sqlpp
index bec4d87..0f32271 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_null_rec_1/agg_null_rec_1.3.query.sqlpp
+++ b/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."sql-count"((
+{'sql-count':test."coll_sql-count"((
     select element t
     from  Test as t
-)),'average':test."sql-avg"((
+)),'average':test."coll_sql-avg"((
     select element i.val
     from  (
         select element t
         from  Test as t
     ) as i
-)),'sql-sum':test."sql-sum"((
+)),'sql-sum':test."coll_sql-sum"((
     select element i.val
     from  (
         select element t
         from  Test as t
     ) as i
-)),'sql-min':test."sql-min"((
+)),'sql-min':test."coll_sql-min"((
     select element i.valplus
     from  (
         select element t
         from  Test as t
     ) as i
-)),'sql-max':test."sql-max"((
+)),'sql-max':test."coll_sql-max"((
     select element i.valplus
     from  (
         select element t

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_number/agg_number.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_number/agg_number.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_number/agg_number.3.query.sqlpp
index dc464a5..4f13bd4 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_number/agg_number.3.query.sqlpp
+++ b/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':"sql-count"([float('2.0'),double('3.0'),93847382783847382,1]),'average1':"sql-avg"([float('2.0'),double('3.0'),93847382783847382,1]),'sql-sum1':"sql-sum"([float('2.0'),double('3.0'),93847382783847382,1]),'sql-min1':"sql-min"([float('2.0'),double('3.0'),93847382783847382,1]),'sql-max1':"sql-max"([float('2.0'),double('3.0'),93847382783847382,1]),'sql-count2':"sql-count"({{float('2.0'),double('3.0'),93847382783847382,1}}),'average2':"sql-avg"({{float('2.0'),double('3.0'),93847382783847382,1}}),'sql-sum2':"sql-sum"({{float('2.0'),double('3.0'),93847382783847382,1}}),'sql-min2':"sql-min"({{float('2.0'),double('3.0'),93847382783847382,1}}),'sql-max2':"sql-max"({{float('2.0'),double('3.0'),93847382783847382,1}})};
+{'sql-count1':"coll_sql-count"([float('2.0'),double('3.0'),93847382783847382,1]),'average1':"coll_sql-avg"([float('2.0'),double('3.0'),93847382783847382,1]),'sql-sum1':"coll_sql-sum"([float('2.0'),double('3.0'),93847382783847382,1]),'sql-min1':"coll_sql-min"([float('2.0'),double('3.0'),93847382783847382,1]),'sql-max1':"coll_sql-max"([float('2.0'),double('3.0'),93847382783847382,1]),'sql-count2':"coll_sql-count"({{float('2.0'),double('3.0'),93847382783847382,1}}),'average2':"coll_sql-avg"({{float('2.0'),double('3.0'),93847382783847382,1}}),'sql-sum2':"coll_sql-sum"({{float('2.0'),double('3.0'),93847382783847382,1}}),'sql-min2':"coll_sql-min"({{float('2.0'),double('3.0'),93847382783847382,1}}),'sql-max2':"coll_sql-max"({{float('2.0'),double('3.0'),93847382783847382,1}})};

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_number_rec/agg_number_rec.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_number_rec/agg_number_rec.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_number_rec/agg_number_rec.3.query.sqlpp
index f57bba5..e93edc6 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/agg_number_rec/agg_number_rec.3.query.sqlpp
+++ b/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."sql-count"((
+{'sql-count':test."coll_sql-count"((
     select element t.valplus
     from  Test as t
-)),'average':test."sql-avg"((
+)),'average':test."coll_sql-avg"((
     select element t.valplus
     from  Test as t
-)),'sql-sum':test."sql-sum"((
+)),'sql-sum':test."coll_sql-sum"((
     select element t.valplus
     from  Test as t
-)),'sql-min':test."sql-min"((
+)),'sql-min':test."coll_sql-min"((
     select element t.valplus
     from  Test as t
-)),'sql-max':test."sql-max"((
+)),'sql-max':test."coll_sql-max"((
     select element t.valplus
     from  Test as t
 ))};

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_double/avg_double.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_double/avg_double.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_double/avg_double.3.query.sqlpp
index f6db917..0971e7d 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_double/avg_double.3.query.sqlpp
+++ b/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 "sql-avg"((
+select element "coll_sql-avg"((
     select element x
     from  [1.0,2.0,double('3.0')] as x
 ));

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_double_null/avg_double_null.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_double_null/avg_double_null.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_double_null/avg_double_null.3.query.sqlpp
index 9f70bcb..192c5c4 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_double_null/avg_double_null.3.query.sqlpp
+++ b/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."sql-avg"((
+{'average':test."coll_sql-avg"((
     select element x.doubleField
     from  Numeric as x
 ))};

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.1.ddl.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.1.ddl.sqlpp
index a71e263..dd878f9 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.1.ddl.sqlpp
+++ b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.1.ddl.sqlpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 /*
- * Description    : Tests that sql-avg aggregation correctly returns null for an empty stream,
+ * Description    : Tests that coll_sql-avg aggregation correctly returns null for an empty stream,
  *                  without an aggregate combiner.
  * Success        : Yes
  */

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.2.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.2.update.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.2.update.sqlpp
index ddc1233..d5b1944 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.2.update.sqlpp
+++ b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.2.update.sqlpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 /*
- * Description    : Tests that sql-avg aggregation correctly returns null for an empty stream,
+ * Description    : Tests that coll_sql-avg aggregation correctly returns null for an empty stream,
  *                  without an aggregate combiner.
  * Success        : Yes
  */

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.3.query.sqlpp
index 47e1388..104ce93 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.3.query.sqlpp
+++ b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_01/avg_empty_01.3.query.sqlpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 /*
- * Description    : Tests that sql-avg aggregation correctly returns null for an empty stream,
+ * Description    : Tests that coll_sql-avg aggregation correctly returns null for an empty stream,
  *                  without an aggregate combiner.
  * Success        : Yes
  */
@@ -25,7 +25,7 @@
 use test;
 
 
-select element test."sql-avg"((
+select element test."coll_sql-avg"((
     select element x
     from  [1,2,3] as x
     where (x > 10)

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.1.ddl.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.1.ddl.sqlpp
index 360c6db..345dc40 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.1.ddl.sqlpp
+++ b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.1.ddl.sqlpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 /*
- * Description    : Tests that sql-avg aggregation correctly returns null for an empty stream,
+ * Description    : Tests that coll_sql-avg aggregation correctly returns null for an empty stream,
  *                  with an aggregate combiner.
  * Success        : Yes
  */

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.2.update.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.2.update.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.2.update.sqlpp
index c0377fb..ca013ae 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.2.update.sqlpp
+++ b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.2.update.sqlpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 /*
- * Description    : Tests that sql-avg aggregation correctly returns null for an empty stream,
+ * Description    : Tests that coll_sql-avg aggregation correctly returns null for an empty stream,
  *                  with an aggregate combiner.
  * Success        : Yes
  */

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.3.query.sqlpp
index 2163d70..e8a4500 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.3.query.sqlpp
+++ b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_empty_02/avg_empty_02.3.query.sqlpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 /*
- * Description    : Tests that sql-avg aggregation correctly returns null for an empty stream,
+ * Description    : Tests that coll_sql-avg aggregation correctly returns null for an empty stream,
  *                  with an aggregate combiner.
  * Success        : Yes
  */
@@ -25,7 +25,7 @@
 use test;
 
 
-select element test."sql-avg"((
+select element test."coll_sql-avg"((
     select element x.val
     from  Test as x
 ));

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_float/avg_float.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_float/avg_float.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_float/avg_float.3.query.sqlpp
index 211efca..fd5e040 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_float/avg_float.3.query.sqlpp
+++ b/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."sql-avg"((
+select element test."coll_sql-avg"((
     select element x
     from  [test.float('1'),test.float('2'),test.float('3')] as x
 ));

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_float_null/avg_float_nu.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_float_null/avg_float_nu.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_float_null/avg_float_nu.3.query.sqlpp
index e2005b5..ad9089c 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_float_null/avg_float_nu.3.query.sqlpp
+++ b/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."sql-avg"((
+{'average':test."coll_sql-avg"((
     select element x.floatField
     from  Numeric as x
 ))};

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int16/avg_int16.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int16/avg_int16.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int16/avg_int16.3.query.sqlpp
index 36ee77a..0733772 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int16/avg_int16.3.query.sqlpp
+++ b/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."sql-avg"((
+select element test."coll_sql-avg"((
     select element x
     from  [test.int16('1'),test.int16('2'),test.int16('3')] as x
 ));

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int16_null/avg_int16_null.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int16_null/avg_int16_null.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int16_null/avg_int16_null.3.query.sqlpp
index 727455a..b3f76ed 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int16_null/avg_int16_null.3.query.sqlpp
+++ b/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."sql-avg"((
+{'average':test."coll_sql-avg"((
     select element x.int16Field
     from  Numeric as x
 ))};

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int32/avg_int32.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int32/avg_int32.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int32/avg_int32.3.query.sqlpp
index f7837ea..cb91b1f 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int32/avg_int32.3.query.sqlpp
+++ b/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."sql-avg"((
+select element test."coll_sql-avg"((
     select element x
     from  [test.int32('1'),test.int32('2'),test.int32('3')] as x
 ));

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int32_null/avg_int32_null.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int32_null/avg_int32_null.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int32_null/avg_int32_null.3.query.sqlpp
index 41faea7..90a8437 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int32_null/avg_int32_null.3.query.sqlpp
+++ b/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."sql-avg"((
+{'average':test."coll_sql-avg"((
     select element x.int32Field
     from  Numeric as x
 ))};

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int64/avg_int64.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int64/avg_int64.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int64/avg_int64.3.query.sqlpp
index 6694f52..0fb0b98 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int64/avg_int64.3.query.sqlpp
+++ b/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."sql-avg"((
+select element test."coll_sql-avg"((
     select element x
     from  [test.int64('1'),test.int64('2'),test.int64('3')] as x
 ));

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int64_null/avg_int64_null.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int64_null/avg_int64_null.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int64_null/avg_int64_null.3.query.sqlpp
index bc44cba..fd4902c 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int64_null/avg_int64_null.3.query.sqlpp
+++ b/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."sql-avg"((
+{'average':test."coll_sql-avg"((
     select element x.int64Field
     from  Numeric as x
 ))};

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int8/avg_int8.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int8/avg_int8.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int8/avg_int8.3.query.sqlpp
index 7acc346..10e04d4 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int8/avg_int8.3.query.sqlpp
+++ b/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."sql-avg"((
+select element test."coll_sql-avg"((
     select element x
     from  [test.int8('1'),test.int8('2'),test.int8('3')] as x
 ));

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int8_null/avg_int8_null.3.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int8_null/avg_int8_null.3.query.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int8_null/avg_int8_null.3.query.sqlpp
index 89f1dc9..8481f91 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_int8_null/avg_int8_null.3.query.sqlpp
+++ b/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."sql-avg"((
+{'average':test."coll_sql-avg"((
     select element x.int8Field
     from  Numeric as x
 ))};

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/3dd80ec4/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_mixed/avg_mixed.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_mixed/avg_mixed.1.ddl.sqlpp b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_mixed/avg_mixed.1.ddl.sqlpp
index 5378c3e..fff702e 100644
--- a/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_mixed/avg_mixed.1.ddl.sqlpp
+++ b/asterix-app/src/test/resources/runtimets/queries_sqlpp/aggregate-sql/avg_mixed/avg_mixed.1.ddl.sqlpp
@@ -17,7 +17,7 @@
  * under the License.
  */
 /*
-* Description  : Run sql-avg over an ordered list with mixed types
+* Description  : Run coll_sql-avg over an ordered list with mixed types
 * Expected Res : Failure
 * Date         : Feb 7th 2014
 */



Mime
View raw message