>From Hongyu Shi <[email protected]>:

Attention is currently required from: Hongyu Shi.

Hello Anon. E. Moose #1000171, Jenkins,

I'd like you to reexamine a change. Please visit

    https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21384?usp=email

to look at the new patch set (#3).

The following approvals got outdated and were removed:
Contrib-2 by Anon. E. Moose #1000171, Integration-Tests-1 by Jenkins, 
Verified-1 by Jenkins


Change subject: [ASTERIXDB-3783] CLUSTER BY: grammar, desugar rewrite, and 
EXPLAIN
......................................................................

[ASTERIXDB-3783] CLUSTER BY: grammar, desugar rewrite, and EXPLAIN

Compile-time support for the SQL++ CLUSTER BY clause: parse it and desugar it
into a distributed k-means query, producing an optimizable/EXPLAIN-able physical
plan. Not executable on its own — the k-means runtime evaluators
(centroid / nearest_centroid) are a follow-up patch.

- Grammar: CLUSTER BY ... AS sc [CLUSTER AS members] WITH {...} (SQLPP.jj) and 
the
  ClusterbyClause AST node (+ Clause enum, SelectBlock, lang AST visitors).
- Rewrite: SqlppClusterByVisitor desugars a CLUSTER BY block into query-level 
LET
  centroids (first-k seed + fixed Lloyd iterations) + GROUP BY nearest_centroid,
  with sc.cluster_id / sc.centroid / sc.cluster_radius substituted onto the
  group-aggregation path; runs before 
substituteGroupbyKeyExpression/rewriteGroupBys
  so the emitted GROUP BY rides the normal pipeline. WITH-option validation 
included.
- Function declarations (asterix-om): BuiltinFunctions ids + type computers for 
the
  centroid aggregate family and nearest_centroid, enough for resolution/EXPLAIN.
- Translator: visit(ClusterbyClause) throws defensively (the rewrite removes the
  clause before translation); the ISqlppVisitor method is required by the 
interface.
- Tests: EXPLAIN optimizer tests (kmeans-validate, kmeans-full-validate), 
CLUSTER BY
  WITH-option negative tests, and ClusterByParserTest.

Change-Id: I250cf1abe7cfe8dccac75b154856f6d2d771cf28
---
M 
asterixdb/asterix-algebra/src/main/java/org/apache/asterix/translator/SqlppExpressionToPlanTranslator.java
A 
asterixdb/asterix-app/src/test/resources/optimizerts/queries/cluster-by/kmeans-full-validate.sqlpp
A 
asterixdb/asterix-app/src/test/resources/optimizerts/queries/cluster-by/kmeans-validate.sqlpp
A 
asterixdb/asterix-app/src/test/resources/optimizerts/results/cluster-by/kmeans-full-validate.plan
A 
asterixdb/asterix-app/src/test/resources/optimizerts/results/cluster-by/kmeans-validate.plan
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/cluster-by/ClusterByQueries.xml
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/cluster-by/negative/missing-numclusters/test.1.query.sqlpp
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/cluster-by/negative/nonpositive-numclusters/test.1.query.sqlpp
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/cluster-by/negative/unknown-distance/test.1.query.sqlpp
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/cluster-by/negative/unknown-option/test.1.query.sqlpp
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/cluster-by/negative/unsupported-algorithm/test.1.query.sqlpp
M asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
M 
asterixdb/asterix-lang-common/src/main/java/org/apache/asterix/lang/common/base/Clause.java
A 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/clause/ClusterbyClause.java
M 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/clause/SelectBlock.java
M 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/SqlppQueryRewriter.java
A 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/SqlppClusterByVisitor.java
M 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/SqlppGatherFunctionCallsVisitor.java
M 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/rewrites/visitor/SqlppInlineUdfsVisitor.java
M 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/CheckDatasetOnlyResolutionVisitor.java
M 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/CheckSql92AggregateVisitor.java
M 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/CheckSubqueryVisitor.java
M 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/DeepCopyVisitor.java
M 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/FreeVariableVisitor.java
M 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppAstPrintVisitor.java
M 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppCloneAndSubstituteVariablesVisitor.java
M 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/SqlppFormatPrintVisitor.java
M 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppAstVisitor.java
M 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppContainsExpressionVisitor.java
M 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppExpressionScopingVisitor.java
M 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/AbstractSqlppSimpleExpressionVisitor.java
M 
asterixdb/asterix-lang-sqlpp/src/main/java/org/apache/asterix/lang/sqlpp/visitor/base/ISqlppVisitor.java
M asterixdb/asterix-lang-sqlpp/src/main/javacc/SQLPP.jj
A 
asterixdb/asterix-lang-sqlpp/src/test/java/org/apache/asterix/lang/sqlpp/parser/ClusterByParserTest.java
M 
asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/BuiltinFunctions.java
A 
asterixdb/asterix-om/src/main/java/org/apache/asterix/om/typecomputer/impl/OrderedListOfADoubleTypeComputer.java
36 files changed, 1,429 insertions(+), 1 deletion(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/84/21384/3
--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/21384?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://asterix-gerrit.ics.uci.edu/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Change-Id: I250cf1abe7cfe8dccac75b154856f6d2d771cf28
Gerrit-Change-Number: 21384
Gerrit-PatchSet: 3
Gerrit-Owner: Hongyu Shi <[email protected]>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <[email protected]>
Gerrit-Attention: Hongyu Shi <[email protected]>

Reply via email to