From 54c263252efaa9e6c2cd1b7ad7466e9bb9e4f545 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 3 Jan 2025 07:38:10 +0000 Subject: [PATCH] [Feature] Support translate Trino query to StarRocks Query (backport #54185) (#54632) Co-authored-by: Youngwb --- .../java/com/starrocks/qe/StmtExecutor.java | 8 ++ .../com/starrocks/qe/TranslateExecutor.java | 44 ++++++ .../com/starrocks/sql/analyzer/Analyzer.java | 8 ++ .../sql/analyzer/TranslateAnalyzer.java | 41 ++++++ .../com/starrocks/sql/ast/AstVisitor.java | 6 + .../sql/ast/translate/TranslateStmt.java | 49 +++++++ .../com/starrocks/sql/parser/AstBuilder.java | 74 ++++++---- .../com/starrocks/sql/parser/StarRocks.g4 | 16 +++ .../com/starrocks/sql/parser/StarRocksLex.g4 | 1 + .../combinator/AggStateCombinatorTest.java | 1 + .../sql/analyzer/AnalyzeTranslateTest.java | 126 ++++++++++++++++++ test/sql/test_agg/R/test_distinct_agg | 6 +- .../R/test_agg_state_with_sync_mv.sql | 3 + .../T/test_agg_state_with_sync_mv.sql | 1 + 14 files changed, 354 insertions(+), 30 deletions(-) create mode 100644 fe/fe-core/src/main/java/com/starrocks/qe/TranslateExecutor.java create mode 100644 fe/fe-core/src/main/java/com/starrocks/sql/analyzer/TranslateAnalyzer.java create mode 100644 fe/fe-core/src/main/java/com/starrocks/sql/ast/translate/TranslateStmt.java create mode 100644 fe/fe-core/src/test/java/com/starrocks/sql/analyzer/AnalyzeTranslateTest.java diff --git a/fe/fe-core/src/main/java/com/starrocks/qe/StmtExecutor.java b/fe/fe-core/src/main/java/com/starrocks/qe/StmtExecutor.java index db4e99bce5bc8..9a40a537034ea 100644 --- a/fe/fe-core/src/main/java/com/starrocks/qe/StmtExecutor.java +++ b/fe/fe-core/src/main/java/com/starrocks/qe/StmtExecutor.java @@ -187,6 +187,7 @@ import com.starrocks.sql.ast.UseDbStmt; import com.starrocks.sql.ast.UserVariable; import com.starrocks.sql.ast.feedback.PlanAdvisorStmt; +import com.starrocks.sql.ast.translate.TranslateStmt; import com.starrocks.sql.ast.warehouse.SetWarehouseStmt; import com.starrocks.sql.common.AuditEncryptionChecker; import com.starrocks.sql.common.DmlException; @@ -786,6 +787,8 @@ public void execute() throws Exception { handleDelBackendBlackListStmt(); } else if (parsedStmt instanceof PlanAdvisorStmt) { handlePlanAdvisorStmt(); + } else if (parsedStmt instanceof TranslateStmt) { + handleTranslateStmt(); } else { context.getState().setError("Do not support this query."); } @@ -1797,6 +1800,11 @@ private void handleSetWarehouseStmt() throws AnalysisException { context.getState().setOk(); } + private void handleTranslateStmt() throws IOException { + ShowResultSet resultSet = TranslateExecutor.execute((TranslateStmt) parsedStmt); + sendShowResult(resultSet); + } + private void sendMetaData(ShowResultSetMetaData metaData) throws IOException { // sends how many columns serializer.reset(); diff --git a/fe/fe-core/src/main/java/com/starrocks/qe/TranslateExecutor.java b/fe/fe-core/src/main/java/com/starrocks/qe/TranslateExecutor.java new file mode 100644 index 0000000000000..57e3a7c0fc6af --- /dev/null +++ b/fe/fe-core/src/main/java/com/starrocks/qe/TranslateExecutor.java @@ -0,0 +1,44 @@ +// Copyright 2021-present StarRocks, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.starrocks.qe; + +import com.starrocks.catalog.Column; +import com.starrocks.catalog.Type; +import com.starrocks.sql.analyzer.AstToSQLBuilder; +import com.starrocks.sql.ast.StatementBase; +import com.starrocks.sql.ast.translate.TranslateStmt; +import com.starrocks.sql.parser.SqlParser; + +import java.util.ArrayList; +import java.util.List; + +public class TranslateExecutor { + private static final ShowResultSetMetaData COLUMN_META = + ShowResultSetMetaData.builder().addColumn(new Column("Translated SQL", Type.STRING)).build(); + + public static ShowResultSet execute(TranslateStmt stmt) { + String dialect = stmt.getDialect(); + String translateSQL = stmt.getTranslateSQL(); + SessionVariable sessionVariable = ConnectContext.getSessionVariableOrDefault(); + sessionVariable.setSqlDialect(dialect); + List statementBases = SqlParser.parse(translateSQL, sessionVariable); + + List> resultRows = new ArrayList<>(); + for (StatementBase statementBase : statementBases) { + resultRows.add(List.of(AstToSQLBuilder.toSQL(statementBase))); + } + return new ShowResultSet(COLUMN_META, resultRows); + } +} diff --git a/fe/fe-core/src/main/java/com/starrocks/sql/analyzer/Analyzer.java b/fe/fe-core/src/main/java/com/starrocks/sql/analyzer/Analyzer.java index 9467ef3191321..2c942c8d5d0b6 100644 --- a/fe/fe-core/src/main/java/com/starrocks/sql/analyzer/Analyzer.java +++ b/fe/fe-core/src/main/java/com/starrocks/sql/analyzer/Analyzer.java @@ -153,6 +153,7 @@ import com.starrocks.sql.ast.pipe.DescPipeStmt; import com.starrocks.sql.ast.pipe.DropPipeStmt; import com.starrocks.sql.ast.pipe.ShowPipeStmt; +import com.starrocks.sql.ast.translate.TranslateStmt; import com.starrocks.sql.ast.warehouse.CreateWarehouseStmt; import com.starrocks.sql.ast.warehouse.DropWarehouseStmt; import com.starrocks.sql.ast.warehouse.ResumeWarehouseStmt; @@ -1086,5 +1087,12 @@ public Void visitSetWarehouseStatement(SetWarehouseStmt statement, ConnectContex public Void visitShowNodesStatement(ShowNodesStmt statement, ConnectContext context) { return null; } + + // ---------------------------------------- Translate Statement -------------------------------------------------- + @Override + public Void visitTranslateStatement(TranslateStmt statement, ConnectContext context) { + TranslateAnalyzer.analyze(statement, context); + return null; + } } } diff --git a/fe/fe-core/src/main/java/com/starrocks/sql/analyzer/TranslateAnalyzer.java b/fe/fe-core/src/main/java/com/starrocks/sql/analyzer/TranslateAnalyzer.java new file mode 100644 index 0000000000000..ec33e34ffcc20 --- /dev/null +++ b/fe/fe-core/src/main/java/com/starrocks/sql/analyzer/TranslateAnalyzer.java @@ -0,0 +1,41 @@ +// Copyright 2021-present StarRocks, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.starrocks.sql.analyzer; + +import com.starrocks.qe.ConnectContext; +import com.starrocks.sql.ast.AstVisitor; +import com.starrocks.sql.ast.StatementBase; +import com.starrocks.sql.ast.translate.TranslateStmt; + +public class TranslateAnalyzer { + public static void analyze(StatementBase statement, ConnectContext context) { + new TranslateAnalyzer.TranslateAnalyzerVisitor().analyze(statement, context); + } + + static class TranslateAnalyzerVisitor implements AstVisitor { + public void analyze(StatementBase statement, ConnectContext session) { + visit(statement, session); + } + + @Override + public Void visitTranslateStatement(TranslateStmt statement, ConnectContext context) { + String dialect = statement.getDialect(); + if (!dialect.equalsIgnoreCase("trino")) { + throw new SemanticException(String.format("Unsupported dialect: %s, only support trino dialect now", dialect)); + } + return null; + } + } +} diff --git a/fe/fe-core/src/main/java/com/starrocks/sql/ast/AstVisitor.java b/fe/fe-core/src/main/java/com/starrocks/sql/ast/AstVisitor.java index d2163eeee6300..67ad011a05019 100644 --- a/fe/fe-core/src/main/java/com/starrocks/sql/ast/AstVisitor.java +++ b/fe/fe-core/src/main/java/com/starrocks/sql/ast/AstVisitor.java @@ -65,6 +65,7 @@ import com.starrocks.sql.ast.pipe.DropPipeStmt; import com.starrocks.sql.ast.pipe.PipeName; import com.starrocks.sql.ast.pipe.ShowPipeStmt; +import com.starrocks.sql.ast.translate.TranslateStmt; import com.starrocks.sql.ast.warehouse.CreateWarehouseStmt; import com.starrocks.sql.ast.warehouse.DropWarehouseStmt; import com.starrocks.sql.ast.warehouse.ResumeWarehouseStmt; @@ -1491,6 +1492,11 @@ default R visitShowPlanAdvisorStatement(ShowPlanAdvisorStmt statement, C context return visitStatement(statement, context); } + // ---------------------------------------- Translate Statement -------------------------------------------------- + default R visitTranslateStatement(TranslateStmt statement, C context) { + return visitStatement(statement, context); + } + // ------------------------------------------- AST ----------------------------------------------------------------- default R visitLimitElement(LimitElement node, C context) { diff --git a/fe/fe-core/src/main/java/com/starrocks/sql/ast/translate/TranslateStmt.java b/fe/fe-core/src/main/java/com/starrocks/sql/ast/translate/TranslateStmt.java new file mode 100644 index 0000000000000..a2eb590e1d698 --- /dev/null +++ b/fe/fe-core/src/main/java/com/starrocks/sql/ast/translate/TranslateStmt.java @@ -0,0 +1,49 @@ +// Copyright 2021-present StarRocks, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.starrocks.sql.ast.translate; + +import com.starrocks.analysis.RedirectStatus; +import com.starrocks.sql.ast.AstVisitor; +import com.starrocks.sql.ast.StatementBase; +import com.starrocks.sql.parser.NodePosition; + +public class TranslateStmt extends StatementBase { + private final String dialect; + private final String translateSQL; + + public TranslateStmt(NodePosition pos, String dialect, String translateSQL) { + super(pos); + this.translateSQL = translateSQL; + this.dialect = dialect; + } + + @Override + public RedirectStatus getRedirectStatus() { + return RedirectStatus.NO_FORWARD; + } + + @Override + public R accept(AstVisitor visitor, C context) { + return visitor.visitTranslateStatement(this, context); + } + + public String getDialect() { + return dialect; + } + + public String getTranslateSQL() { + return translateSQL; + } +} diff --git a/fe/fe-core/src/main/java/com/starrocks/sql/parser/AstBuilder.java b/fe/fe-core/src/main/java/com/starrocks/sql/parser/AstBuilder.java index 3901fb2f51bc6..7f263498b70ed 100644 --- a/fe/fe-core/src/main/java/com/starrocks/sql/parser/AstBuilder.java +++ b/fe/fe-core/src/main/java/com/starrocks/sql/parser/AstBuilder.java @@ -477,6 +477,7 @@ import com.starrocks.sql.ast.pipe.DropPipeStmt; import com.starrocks.sql.ast.pipe.PipeName; import com.starrocks.sql.ast.pipe.ShowPipeStmt; +import com.starrocks.sql.ast.translate.TranslateStmt; import com.starrocks.sql.ast.warehouse.CreateWarehouseStmt; import com.starrocks.sql.ast.warehouse.DropWarehouseStmt; import com.starrocks.sql.ast.warehouse.ResumeWarehouseStmt; @@ -3405,7 +3406,7 @@ public ParseNode visitHelpStatement(StarRocksParser.HelpStatementContext context // ------------------------------------------- Backup Store Statement ---------------------------------------------- private ParseNode getFunctionRef(StarRocksParser.QualifiedNameContext qualifiedNameContext, - String alias, NodePosition position) { + String alias, NodePosition position) { String functionName = getQualifiedName(qualifiedNameContext).toString(); FunctionName fnName = FunctionName.createFnName(functionName); return new FunctionRef(fnName, alias, position); @@ -3434,22 +3435,22 @@ private ParseNode parseBackupRestoreStatement(ParserRuleContext context) { List externalCatalogRefs = new ArrayList<>(); boolean allExternalCatalog = backupContext != null ? - (backupContext.ALL() != null) : (restoreContext.ALL() != null); + (backupContext.ALL() != null) : (restoreContext.ALL() != null); if (!allExternalCatalog && (backupContext != null ? - (backupContext.CATALOG() != null || backupContext.CATALOGS() != null) : - (restoreContext.CATALOG() != null || restoreContext.CATALOGS() != null))) { + (backupContext.CATALOG() != null || backupContext.CATALOGS() != null) : + (restoreContext.CATALOG() != null || restoreContext.CATALOGS() != null))) { if (backupContext != null) { StarRocksParser.IdentifierListContext identifierListContext = backupContext.identifierList(); externalCatalogRefs = visit(identifierListContext.identifier(), Identifier.class) - .stream().map(Identifier::getValue) - .map(x -> new CatalogRef(x)).collect(Collectors.toList()); + .stream().map(Identifier::getValue) + .map(x -> new CatalogRef(x)).collect(Collectors.toList()); } else { List identifierWithAliasList = - restoreContext.identifierWithAliasList().identifierWithAlias(); + restoreContext.identifierWithAliasList().identifierWithAlias(); for (StarRocksParser.IdentifierWithAliasContext identifierWithAliasContext : identifierWithAliasList) { String originalName = getIdentifierName(identifierWithAliasContext.originalName); String alias = identifierWithAliasContext.AS() != null ? - getIdentifierName(identifierWithAliasContext.alias) : ""; + getIdentifierName(identifierWithAliasContext.alias) : ""; externalCatalogRefs.add(new CatalogRef(originalName, alias)); } } @@ -3457,7 +3458,7 @@ private ParseNode parseBackupRestoreStatement(ParserRuleContext context) { boolean containsExternalCatalog = allExternalCatalog || !externalCatalogRefs.isEmpty(); boolean specifyDbExplicitly = - backupContext != null ? (backupContext.DATABASE() != null) : (restoreContext.DATABASE() != null); + backupContext != null ? (backupContext.DATABASE() != null) : (restoreContext.DATABASE() != null); if (specifyDbExplicitly && containsExternalCatalog) { throw new ParsingException(PARSER_ERROR_MSG.unsupportedSepcifyDbForExternalCatalog()); @@ -3484,7 +3485,7 @@ private ParseNode parseBackupRestoreStatement(ParserRuleContext context) { } labelName = qualifiedNameToLabelName(getQualifiedName(backupContext != null ? - backupContext.qualifiedName() : restoreContext.qualifiedName())); + backupContext.qualifiedName() : restoreContext.qualifiedName())); if (specifyDbExplicitly) { if (labelName.getDbName() != null) { throw new ParsingException(PARSER_ERROR_MSG.unsupportedSepcifyDbNameAfterSnapshotName()); @@ -3506,16 +3507,16 @@ private ParseNode parseBackupRestoreStatement(ParserRuleContext context) { for (StarRocksParser.BackupRestoreObjectDescContext backupRestoreObjectDescContext : backupRestoreObjectDescContexts) { boolean specifiedFunction = backupRestoreObjectDescContext.FUNCTION() != null || - backupRestoreObjectDescContext.FUNCTIONS() != null; + backupRestoreObjectDescContext.FUNCTIONS() != null; boolean specifiedMV = backupRestoreObjectDescContext.MATERIALIZED() != null; boolean specifiedView = !specifiedMV && (backupRestoreObjectDescContext.VIEW() != null || - backupRestoreObjectDescContext.VIEWS() != null); + backupRestoreObjectDescContext.VIEWS() != null); boolean specifiedTable = backupRestoreObjectDescContext.TABLE() != null || - backupRestoreObjectDescContext.TABLES() != null; + backupRestoreObjectDescContext.TABLES() != null; if (backupContext != null && (backupRestoreObjectDescContext.AS() != null || - (backupRestoreObjectDescContext.backupRestoreTableDesc() != null && - backupRestoreObjectDescContext.backupRestoreTableDesc().AS() != null))) { + (backupRestoreObjectDescContext.backupRestoreTableDesc() != null && + backupRestoreObjectDescContext.backupRestoreTableDesc().AS() != null))) { throw new ParsingException(PARSER_ERROR_MSG.unsupportedSepcifyAliasInBackupStmt()); } @@ -3526,7 +3527,7 @@ private ParseNode parseBackupRestoreStatement(ParserRuleContext context) { if (backupRestoreObjectDescContext.AS() != null) { alias = getIdentifierName(backupRestoreObjectDescContext.identifier()); } else if (backupRestoreObjectDescContext.backupRestoreTableDesc() != null && - backupRestoreObjectDescContext.backupRestoreTableDesc().AS() != null) { + backupRestoreObjectDescContext.backupRestoreTableDesc().AS() != null) { alias = getIdentifierName(backupRestoreObjectDescContext.backupRestoreTableDesc().identifier()); } } @@ -3538,7 +3539,7 @@ private ParseNode parseBackupRestoreStatement(ParserRuleContext context) { } fnRefs.add((FunctionRef) getFunctionRef(backupRestoreObjectDescContext.qualifiedName(), - alias, createPos(backupRestoreObjectDescContext))); + alias, createPos(backupRestoreObjectDescContext))); } else if (specifiedMV) { if (backupRestoreObjectDescContext.ALL() != null) { allMarker.add(BackupObjectType.MV); @@ -3546,7 +3547,7 @@ private ParseNode parseBackupRestoreStatement(ParserRuleContext context) { } mvRefs.add((TableRef) getTableRef(backupRestoreObjectDescContext.qualifiedName(), - null, alias, createPos(backupRestoreObjectDescContext))); + null, alias, createPos(backupRestoreObjectDescContext))); } else if (specifiedView) { if (backupRestoreObjectDescContext.ALL() != null) { allMarker.add(BackupObjectType.VIEW); @@ -3554,7 +3555,7 @@ private ParseNode parseBackupRestoreStatement(ParserRuleContext context) { } viewRefs.add((TableRef) getTableRef(backupRestoreObjectDescContext.qualifiedName(), - null, alias, createPos(backupRestoreObjectDescContext))); + null, alias, createPos(backupRestoreObjectDescContext))); } else if (specifiedTable) { if (backupRestoreObjectDescContext.ALL() != null) { allMarker.add(BackupObjectType.TABLE); @@ -3562,12 +3563,12 @@ private ParseNode parseBackupRestoreStatement(ParserRuleContext context) { } tblRefs.add((TableRef) getTableRef(backupRestoreObjectDescContext.backupRestoreTableDesc().qualifiedName(), - backupRestoreObjectDescContext.backupRestoreTableDesc().partitionNames(), - alias, createPos(backupRestoreObjectDescContext))); + backupRestoreObjectDescContext.backupRestoreTableDesc().partitionNames(), + alias, createPos(backupRestoreObjectDescContext))); } else { mixTblRefs.add((TableRef) getTableRef(backupRestoreObjectDescContext.backupRestoreTableDesc().qualifiedName(), - backupRestoreObjectDescContext.backupRestoreTableDesc().partitionNames(), - alias, createPos(backupRestoreObjectDescContext))); + backupRestoreObjectDescContext.backupRestoreTableDesc().partitionNames(), + alias, createPos(backupRestoreObjectDescContext))); } } @@ -3586,7 +3587,7 @@ private ParseNode parseBackupRestoreStatement(ParserRuleContext context) { Map properties = null; StarRocksParser.PropertyListContext contextProperties = - (backupContext != null) ? backupContext.propertyList() : restoreContext.propertyList(); + (backupContext != null) ? backupContext.propertyList() : restoreContext.propertyList(); if (contextProperties != null) { properties = new HashMap<>(); List propertyList = visit(contextProperties.property(), Property.class); @@ -3598,10 +3599,10 @@ private ParseNode parseBackupRestoreStatement(ParserRuleContext context) { AbstractBackupStmt stmt = null; if (backupContext != null) { stmt = new BackupStmt(labelName, repoName, mixTblRefs, fnRefs, externalCatalogRefs, allMarker, withOnClause, - originDb != null ? originDb : "", properties, createPos(backupContext)); + originDb != null ? originDb : "", properties, createPos(backupContext)); } else { stmt = new RestoreStmt(labelName, repoName, mixTblRefs, fnRefs, externalCatalogRefs, allMarker, withOnClause, - originDb != null ? originDb : "", properties, createPos(restoreContext)); + originDb != null ? originDb : "", properties, createPos(restoreContext)); } return stmt; @@ -3640,7 +3641,7 @@ public ParseNode visitCancelRestoreStatement(StarRocksParser.CancelRestoreStatem if (context.CATALOG() == null && context.identifier() == null) { throw new ParsingException(PARSER_ERROR_MSG.nullIdentifierCancelBackupRestore()); } - return new CancelBackupStmt(context.CATALOG() != null ? "" : ((Identifier) visit(context.identifier())).getValue(), + return new CancelBackupStmt(context.CATALOG() != null ? "" : ((Identifier) visit(context.identifier())).getValue(), true, context.CATALOG() != null, createPos(context)); } @@ -5057,6 +5058,25 @@ public ParseNode visitShowNodesStatement(StarRocksParser.ShowNodesStatementConte return new ShowNodesStmt(warehouseName, pattern, createPos(context)); } + // ------------------------------------------- Translate Statement ------------------------------------------------- + @Override + public ParseNode visitTranslateStatement(StarRocksParser.TranslateStatementContext context) { + String dialect = ((Identifier) visit(context.dialect().identifier())).getValue(); + return new TranslateStmt(createPos(context), dialect, ((StringLiteral) visit(context.translateSQL())).getValue()); + } + + @Override + public ParseNode visitTranslateSQL(StarRocksParser.TranslateSQLContext context) { + StringBuilder buf = new StringBuilder(); + for (int i = 0; i < context.getChildCount(); ++i) { + if (i > 0) { + buf.append(' '); + } + buf.append(context.getChild(i).getText()); + } + return new StringLiteral(buf.toString(), createPos(context)); + } + // ------------------------------------------- Query Statement ----------------------------------------------------- @Override diff --git a/fe/fe-core/src/main/java/com/starrocks/sql/parser/StarRocks.g4 b/fe/fe-core/src/main/java/com/starrocks/sql/parser/StarRocks.g4 index 19fea3d1036fa..4a87fcebc9e8d 100644 --- a/fe/fe-core/src/main/java/com/starrocks/sql/parser/StarRocks.g4 +++ b/fe/fe-core/src/main/java/com/starrocks/sql/parser/StarRocks.g4 @@ -319,6 +319,9 @@ statement | showClustersStatement | showNodesStatement + // Translate Statement + | translateStatement + // Unsupported Statement | unsupportedStatement ; @@ -2052,6 +2055,19 @@ showNodesStatement | SHOW NODES FROM WAREHOUSE identifier ; +// ------------------------------------------- Translate Statement ----------------------------------------------------- +translateStatement + : TRANSLATE dialect translateSQL + ; + +dialect + : identifier + ; + +translateSQL + : .+ + ; + // ------------------------------------------- Query Statement --------------------------------------------------------- queryStatement diff --git a/fe/fe-core/src/main/java/com/starrocks/sql/parser/StarRocksLex.g4 b/fe/fe-core/src/main/java/com/starrocks/sql/parser/StarRocksLex.g4 index 6d8abe7d3df86..6024e661b8b9f 100644 --- a/fe/fe-core/src/main/java/com/starrocks/sql/parser/StarRocksLex.g4 +++ b/fe/fe-core/src/main/java/com/starrocks/sql/parser/StarRocksLex.g4 @@ -441,6 +441,7 @@ TIMESTAMPADD: 'TIMESTAMPADD'; TIMESTAMPDIFF: 'TIMESTAMPDIFF'; TINYINT: 'TINYINT'; TRANSACTION: 'TRANSACTION'; +TRANSLATE: {getCharPositionInLine() == 0}? 'TRANSLATE'; TO: 'TO'; TRACE: 'TRACE'; TRIGGERS: 'TRIGGERS'; diff --git a/fe/fe-core/src/test/java/com/starrocks/catalog/combinator/AggStateCombinatorTest.java b/fe/fe-core/src/test/java/com/starrocks/catalog/combinator/AggStateCombinatorTest.java index 7c7c41ea20b6d..ed76bcb95f9e5 100644 --- a/fe/fe-core/src/test/java/com/starrocks/catalog/combinator/AggStateCombinatorTest.java +++ b/fe/fe-core/src/test/java/com/starrocks/catalog/combinator/AggStateCombinatorTest.java @@ -1109,6 +1109,7 @@ public void testGenerateCreateAsyncMVWithAggState() throws Exception { String plan = getFragmentPlan(query); PlanTestBase.assertContains(plan, "test_mv1"); } + connectContext.getSessionVariable().setOptimizerExecuteTimeout(3000); starRocksAssert.dropTable("t1"); starRocksAssert.dropMaterializedView("test_mv1"); } diff --git a/fe/fe-core/src/test/java/com/starrocks/sql/analyzer/AnalyzeTranslateTest.java b/fe/fe-core/src/test/java/com/starrocks/sql/analyzer/AnalyzeTranslateTest.java new file mode 100644 index 0000000000000..6219d29d1c2e6 --- /dev/null +++ b/fe/fe-core/src/test/java/com/starrocks/sql/analyzer/AnalyzeTranslateTest.java @@ -0,0 +1,126 @@ +// Copyright 2021-present StarRocks, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.starrocks.sql.analyzer; + +import com.starrocks.qe.ConnectContext; +import com.starrocks.qe.ShowResultSet; +import com.starrocks.qe.StmtExecutor; +import com.starrocks.qe.TranslateExecutor; +import com.starrocks.sql.ast.StatementBase; +import com.starrocks.sql.ast.translate.TranslateStmt; +import com.starrocks.sql.parser.SqlParser; +import com.starrocks.utframe.UtFrameUtils; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +import static com.starrocks.sql.analyzer.AnalyzeTestUtil.analyzeFail; +import static com.starrocks.sql.analyzer.AnalyzeTestUtil.analyzeSuccess; + +public class AnalyzeTranslateTest { + @BeforeClass + public static void beforeClass() throws Exception { + UtFrameUtils.createMinStarRocksCluster(); + AnalyzeTestUtil.init(); + } + + @Test + public void testAnalyzeTranslate() { + analyzeSuccess("translate trino select * from t1"); + analyzeSuccess("translate trino select v1,v2 from t1"); + analyzeSuccess("translate trino select to_unixtime()"); + + analyzeFail("translate starrocks select * from t1 where v1 = 1"); + analyzeFail("translate hive select * from t1 where v1 = 1"); + analyzeFail("translate spark select * from t1 where v1 = 1"); + } + + @Test + public void testHandleTranslateStmt() throws Exception { + String sql = "translate trino select to_unixtime(TIMESTAMP '2023-04-22 00:00:00')"; + ConnectContext connectContext = AnalyzeTestUtil.getConnectContext(); + StatementBase statement = SqlParser.parseSingleStatement(sql, connectContext.getSessionVariable().getSqlMode()); + StmtExecutor stmtExecutor = new StmtExecutor(connectContext, statement); + stmtExecutor.execute(); + Assert.assertFalse(connectContext.getState().isError()); + Assert.assertEquals(1, connectContext.getReturnRows()); + } + + private void assertTranslateTrinoSQL(String originSQL, String translatedSQL) { + StatementBase parsedStmt = SqlParser.parse(originSQL, AnalyzeTestUtil.getConnectContext().getSessionVariable()).get(0); + ShowResultSet resultSet = TranslateExecutor.execute((TranslateStmt) parsedStmt); + Assert.assertEquals(1, resultSet.getResultRows().size()); + Assert.assertEquals(1, resultSet.getResultRows().get(0).size()); + Assert.assertEquals(translatedSQL, resultSet.getResultRows().get(0).get(0)); + } + + @Test + public void testTranslateTrinoSQL() { + assertTranslateTrinoSQL("translate trino select to_unixtime(TIMESTAMP '2023-04-22 00:00:00')", + "SELECT unix_timestamp('2023-04-22 00:00:00')"); + assertTranslateTrinoSQL("translate trino select day_of_week(timestamp '2022-03-06 01:02:03')", + "SELECT dayofweek_iso('2022-03-06 01:02:03')"); + assertTranslateTrinoSQL("translate trino SELECT date_parse('20141221','%Y%m%d')", + "SELECT str_to_date('20141221', '%Y%m%d')"); + + assertTranslateTrinoSQL("translate trino select approx_percentile(v1, 0.99) from t0", + "SELECT percentile_approx(`v1`, 0.99)\nFROM `t0`"); + assertTranslateTrinoSQL("translate trino select arbitrary(v1) from t0", "SELECT any_value(`v1`)\n" + + "FROM `t0`"); + assertTranslateTrinoSQL("translate trino select stddev(v1) from t0;", "SELECT stddev_samp(`v1`)\n" + + "FROM `t0`"); + + assertTranslateTrinoSQL("translate trino select array_union(c1, c2) from test_array", + "SELECT array_distinct(array_concat(`c1`, `c2`))\nFROM `test_array`"); + + assertTranslateTrinoSQL("translate trino select date_add('day', 1, TIMESTAMP '2014-03-08 09:00:00')", + "SELECT date_add('2014-03-08 09:00:00', INTERVAL 1 day)"); + + assertTranslateTrinoSQL("translate trino select chr(56)", "SELECT char(56)"); + + assertTranslateTrinoSQL("translate trino select approx_set(\"tc\") from tall", + "SELECT hll_hash(`tc`)\nFROM `tall`"); + + // test TPCH query + assertTranslateTrinoSQL("translate trino select\n" + + " o_orderpriority,\n" + + " count(*) as order_count\n" + + "from\n" + + " orders\n" + + "where\n" + + " o_orderdate >= date '1993-07-01'\n" + + " and o_orderdate < date '1993-07-01' + interval '3' month\n" + + " and exists (\n" + + " select\n" + + " *\n" + + " from\n" + + " lineitem\n" + + " where\n" + + " l_orderkey = o_orderkey\n" + + " and l_commitdate < l_receiptdate\n" + + " )\n" + + "group by\n" + + " o_orderpriority\n" + + "order by\n" + + " o_orderpriority;", "SELECT `o_orderpriority`, count(*) AS `order_count`\n" + + "FROM `orders`\n" + + "WHERE ((`o_orderdate` >= '1993-07-01') AND (`o_orderdate` < ('1993-07-01' + INTERVAL '3' MONTH))) AND " + + "(EXISTS (SELECT *\n" + + "FROM `lineitem`\n" + + "WHERE (`l_orderkey` = `o_orderkey`) AND (`l_commitdate` < `l_receiptdate`)))\n" + + "GROUP BY `o_orderpriority` ORDER BY `o_orderpriority` ASC "); + + } +} diff --git a/test/sql/test_agg/R/test_distinct_agg b/test/sql/test_agg/R/test_distinct_agg index 26737489d9049..613f28e39c59d 100644 --- a/test/sql/test_agg/R/test_distinct_agg +++ b/test/sql/test_agg/R/test_distinct_agg @@ -220,7 +220,7 @@ select count(distinct t1.c1, if(t2.c3 is null, 1, 0)), sum(t1.c2 + if(t2.c3 is n # streaming_preaggregation_mode = 'auto' new_planner_agg_stage = '0' set streaming_preaggregation_mode = 'auto'; -- result: -E: (1064, "Getting syntax error at line 1, column 2. Detail message: Unexpected input 'streaming_preaggregation_mode', the most similar input is {'ADMIN', 'GRANT', 'STOP', 'TRUNCATE', 'INSERT', '(', ';'}.") +E: (1064, "Getting syntax error at line 1, column 2. Detail message: Unexpected input 'streaming_preaggregation_mode', the most similar input is {'ADMIN', 'GRANT', TRANSLATE, 'STOP', 'TRUNCATE', '(', ';'}.") -- !result set new_planner_agg_stage = '0'; -- result: @@ -492,7 +492,7 @@ select array_agg(distinct c2), count(distinct c2), sum(c3) from skew_agg group b # streaming_preaggregation_mode = 'force_streaming' new_planner_agg_stage = '2' set streaming_preaggregation_mode = 'force_streaming'; -- result: -E: (1064, "Getting syntax error at line 1, column 2. Detail message: Unexpected input 'streaming_preaggregation_mode', the most similar input is {'ADMIN', 'GRANT', 'STOP', 'TRUNCATE', 'INSERT', '(', ';'}.") +E: (1064, "Getting syntax error at line 1, column 2. Detail message: Unexpected input 'streaming_preaggregation_mode', the most similar input is {'ADMIN', 'GRANT', TRANSLATE, 'STOP', 'TRUNCATE', '(', ';'}.") -- !result set new_planner_agg_stage = '0'; -- result: @@ -740,7 +740,7 @@ select array_agg(distinct c2), count(distinct c2), sum(c3) from skew_agg group b # streaming_preaggregation_mode = 'force_preaggregation' new_planner_agg_stage = '2' set streaming_preaggregation_mode = 'force_preaggregation'; -- result: -E: (1064, "Getting syntax error at line 1, column 2. Detail message: Unexpected input 'streaming_preaggregation_mode', the most similar input is {'ADMIN', 'GRANT', 'STOP', 'TRUNCATE', 'INSERT', '(', ';'}.") +E: (1064, "Getting syntax error at line 1, column 2. Detail message: Unexpected input 'streaming_preaggregation_mode', the most similar input is {'ADMIN', 'GRANT', TRANSLATE, 'STOP', 'TRUNCATE', '(', ';'}.") -- !result set new_planner_agg_stage = '0'; -- result: diff --git a/test/sql/test_agg_state/R/test_agg_state_with_sync_mv.sql b/test/sql/test_agg_state/R/test_agg_state_with_sync_mv.sql index 87395e0bddaad..7d3d64978de1d 100644 --- a/test/sql/test_agg_state/R/test_agg_state_with_sync_mv.sql +++ b/test/sql/test_agg_state/R/test_agg_state_with_sync_mv.sql @@ -78,6 +78,9 @@ function: wait_materialized_view_finish() -- result: None -- !result +set new_planner_optimize_timeout=10000; +-- result: +-- !result select k1, percentile_approx(c6, 0.5) as agg14, percentile_approx(c6, 0.5) as agg15, covar_pop(c6, c6) as agg16, covar_pop(c7, c7) as agg17, covar_pop(c0, c0) as agg18, covar_pop(c1, c1) as agg19, covar_pop(c2, c2) as agg20, covar_pop(c3, c3) as agg21, covar_pop(c4, c4) as agg22, covar_pop(c5, c5) as agg23, count(c0) as agg24, count(c1) as agg25, count(c2) as agg26, count(c3) as agg27, count(c4) as agg28, count(c5) as agg29, count(c6) as agg30, count(c7) as agg31, count(c8) as agg32, count(c8) as agg33, count(c8) as agg34, count(c24) as agg35, count(c10) as agg36, count(c11) as agg37, count(c16) as agg38, count(c27) as agg39, count(c28) as agg40, count(c25) as agg41, count(c26) as agg42, array_unique_agg(c12) as agg43, array_unique_agg(c13) as agg44, array_unique_agg(c14) as agg45, array_unique_agg(c15) as agg46, array_unique_agg(c16) as agg47, array_unique_agg(c17) as agg48, array_unique_agg(c18) as agg49, array_unique_agg(c19) as agg50, array_unique_agg(c20) as agg51, array_unique_agg(c20) as agg52, array_unique_agg(c20) as agg53, array_unique_agg(c20) as agg54, array_unique_agg(c21) as agg55, array_unique_agg(c22) as agg56, array_unique_agg(c23) as agg57, percentile_disc(c0, 0.5) as agg58, percentile_disc(c1, 0.5) as agg59, percentile_disc(c2, 0.5) as agg60, percentile_disc(c3, 0.5) as agg61, percentile_disc(c4, 0.5) as agg62, percentile_disc(c5, 0.5) as agg63, percentile_disc(c8, 0.5) as agg64, percentile_disc(c8, 0.5) as agg65, percentile_disc(c8, 0.5) as agg66, percentile_disc(c9, 0.5) as agg67, percentile_disc(c10, 0.5) as agg68, percentile_disc(c11, 0.5) as agg69, percentile_disc(c6, 0.5) as agg70, percentile_disc(c7, 0.5) as agg71, multi_distinct_count(c0) as agg72, multi_distinct_count(c1) as agg73, multi_distinct_count(c2) as agg74, multi_distinct_count(c3) as agg75, multi_distinct_count(c4) as agg76, multi_distinct_count(c5) as agg77, multi_distinct_count(c6) as agg78, multi_distinct_count(c7) as agg79, multi_distinct_count(c8) as agg80, multi_distinct_count(c8) as agg81, multi_distinct_count(c8) as agg82, multi_distinct_count(c9) as agg83, multi_distinct_count(c10) as agg84, multi_distinct_count(c11) as agg85, array_agg(c24) as agg86, stddev_samp(c6) as agg87, stddev_samp(c7) as agg88, stddev_samp(c0) as agg89, stddev_samp(c1) as agg90, stddev_samp(c2) as agg91, stddev_samp(c3) as agg92, stddev_samp(c4) as agg93, stddev_samp(c5) as agg94, mann_whitney_u_test(c6, c0, 'two-sided', 0) as agg95, mann_whitney_u_test(c6, c0, 'less') as agg96, mann_whitney_u_test(c6, c0, 'two-sided', 0) as agg97, max(c0) as agg98, max(c1) as agg99, max(c2) as agg100, max(c3) as agg101, max(c4) as agg102, max(c5) as agg103, max(c6) as agg104, max(c7) as agg105, max(c8) as agg106, max(c8) as agg107, max(c8) as agg108, max(c24) as agg109, max(c10) as agg110, max(c11) as agg111, ds_hll_count_distinct(c0, 18, 'hll_6') as agg112, ds_hll_count_distinct(c0, 18) as agg113, ds_hll_count_distinct(c0, 18, 'hll_6') as agg114, ds_hll_count_distinct(c1, 18, 'hll_6') as agg115, ds_hll_count_distinct(c1, 18) as agg116, ds_hll_count_distinct(c1, 18, 'hll_6') as agg117, ds_hll_count_distinct(c2, 18, 'hll_6') as agg118, ds_hll_count_distinct(c2, 18) as agg119, ds_hll_count_distinct(c2, 18, 'hll_6') as agg120, ds_hll_count_distinct(c3, 18, 'hll_6') as agg121, ds_hll_count_distinct(c3, 18) as agg122, ds_hll_count_distinct(c3, 18, 'hll_6') as agg123, ds_hll_count_distinct(c4, 18, 'hll_6') as agg124, ds_hll_count_distinct(c4, 18) as agg125, ds_hll_count_distinct(c4, 18, 'hll_6') as agg126, ds_hll_count_distinct(c5, 18, 'hll_6') as agg127, ds_hll_count_distinct(c5, 18) as agg128, ds_hll_count_distinct(c5, 18, 'hll_6') as agg129, ds_hll_count_distinct(c6, 18, 'hll_6') as agg130, ds_hll_count_distinct(c6, 18) as agg131, ds_hll_count_distinct(c6, 18, 'hll_6') as agg132, ds_hll_count_distinct(c7, 18, 'hll_6') as agg133, ds_hll_count_distinct(c7, 18) as agg134, ds_hll_count_distinct(c7, 18, 'hll_6') as agg135, ds_hll_count_distinct(c8, 18, 'hll_6') as agg136, ds_hll_count_distinct(c8, 18) as agg137, ds_hll_count_distinct(c8, 18, 'hll_6') as agg138, ds_hll_count_distinct(c8, 18, 'hll_6') as agg139, ds_hll_count_distinct(c8, 18) as agg140, ds_hll_count_distinct(c8, 18, 'hll_6') as agg141, ds_hll_count_distinct(c8, 18, 'hll_6') as agg142, ds_hll_count_distinct(c8, 18) as agg143, ds_hll_count_distinct(c8, 18, 'hll_6') as agg144, ds_hll_count_distinct(c24, 18, 'hll_6') as agg145, ds_hll_count_distinct(c24, 18) as agg146, ds_hll_count_distinct(c24, 18, 'hll_6') as agg147, ds_hll_count_distinct(c10, 18, 'hll_6') as agg148, ds_hll_count_distinct(c10, 18) as agg149, ds_hll_count_distinct(c10, 18, 'hll_6') as agg150, ds_hll_count_distinct(c11, 18, 'hll_6') as agg151, ds_hll_count_distinct(c11, 18) as agg152, ds_hll_count_distinct(c11, 18, 'hll_6') as agg153, ndv(c0) as agg154, ndv(c1) as agg155, ndv(c2) as agg156, ndv(c3) as agg157, ndv(c4) as agg158, ndv(c5) as agg159, ndv(c6) as agg160, ndv(c7) as agg161, ndv(c8) as agg162, ndv(c8) as agg163, ndv(c8) as agg164, ndv(c24) as agg165, ndv(c10) as agg166, ndv(c11) as agg167, stddev(c6) as agg168, stddev(c7) as agg169, stddev(c0) as agg170, stddev(c1) as agg171, stddev(c2) as agg172, stddev(c3) as agg173, stddev(c4) as agg174, stddev(c5) as agg175, covar_samp(c6, c6) as agg176, covar_samp(c7, c7) as agg177, covar_samp(c0, c0) as agg178, covar_samp(c1, c1) as agg179, covar_samp(c2, c2) as agg180, covar_samp(c3, c3) as agg181, covar_samp(c4, c4) as agg182, covar_samp(c5, c5) as agg183, bitmap_agg(c4) as agg184, bitmap_agg(c5) as agg185, bitmap_agg(c3) as agg186, bitmap_agg(c2) as agg187, bitmap_agg(c1) as agg188, bitmap_agg(c0) as agg189, std(c6) as agg190, std(c7) as agg191, std(c0) as agg192, std(c1) as agg193, std(c2) as agg194, std(c3) as agg195, std(c4) as agg196, std(c5) as agg197, sum(c6) as agg198, sum(c7) as agg199, sum(c1) as agg200, sum(c2) as agg201, sum(c3) as agg202, sum(c4) as agg203, sum(c5) as agg204, sum(c8) as agg205, sum(c8) as agg206, sum(c8) as agg207, approx_count_distinct(c0) as agg208, approx_count_distinct(c1) as agg209, approx_count_distinct(c2) as agg210, approx_count_distinct(c3) as agg211, approx_count_distinct(c4) as agg212, approx_count_distinct(c5) as agg213, approx_count_distinct(c6) as agg214, approx_count_distinct(c7) as agg215, approx_count_distinct(c8) as agg216, approx_count_distinct(c8) as agg217, approx_count_distinct(c8) as agg218, approx_count_distinct(c24) as agg219, approx_count_distinct(c10) as agg220, approx_count_distinct(c11) as agg221, min(c0) as agg222, min(c1) as agg223, min(c2) as agg224, min(c3) as agg225, min(c4) as agg226, min(c5) as agg227, min(c6) as agg228, min(c7) as agg229, min(c8) as agg230, min(c8) as agg231, min(c8) as agg232, min(c24) as agg233, min(c10) as agg234, min(c11) as agg235, retention(c12) as agg236, max_by(c0, c0) as agg237, max_by(c1, c0) as agg238, max_by(c2, c0) as agg239, max_by(c3, c0) as agg240, max_by(c4, c0) as agg241, max_by(c5, c0) as agg242, max_by(c6, c0) as agg243, max_by(c7, c0) as agg244, max_by(c8, c0) as agg245, max_by(c8, c0) as agg246, max_by(c8, c0) as agg247, max_by(c24, c0) as agg248, max_by(c10, c0) as agg249, max_by(c11, c0) as agg250, max_by(c25, c0) as agg251, max_by(c0, c1) as agg252, max_by(c1, c1) as agg253, max_by(c2, c1) as agg254, max_by(c3, c1) as agg255, max_by(c4, c1) as agg256, max_by(c5, c1) as agg257, max_by(c6, c1) as agg258, max_by(c7, c1) as agg259, max_by(c8, c1) as agg260, max_by(c8, c1) as agg261, max_by(c8, c1) as agg262, max_by(c24, c1) as agg263, max_by(c10, c1) as agg264, max_by(c11, c1) as agg265, max_by(c25, c1) as agg266, max_by(c0, c2) as agg267, max_by(c1, c2) as agg268, max_by(c2, c2) as agg269, max_by(c3, c2) as agg270, max_by(c4, c2) as agg271, max_by(c5, c2) as agg272, max_by(c6, c2) as agg273, max_by(c7, c2) as agg274, max_by(c8, c2) as agg275, max_by(c8, c2) as agg276, max_by(c8, c2) as agg277, max_by(c24, c2) as agg278, max_by(c10, c2) as agg279, max_by(c11, c2) as agg280, max_by(c25, c2) as agg281, max_by(c0, c3) as agg282, max_by(c1, c3) as agg283, max_by(c2, c3) as agg284, max_by(c3, c3) as agg285, max_by(c4, c3) as agg286, max_by(c5, c3) as agg287, max_by(c6, c3) as agg288, max_by(c7, c3) as agg289, max_by(c8, c3) as agg290, max_by(c8, c3) as agg291, max_by(c8, c3) as agg292, max_by(c24, c3) as agg293, max_by(c10, c3) as agg294, max_by(c11, c3) as agg295, max_by(c25, c3) as agg296, max_by(c0, c4) as agg297, max_by(c1, c4) as agg298, max_by(c2, c4) as agg299, max_by(c3, c4) as agg300, max_by(c4, c4) as agg301, max_by(c5, c4) as agg302, max_by(c6, c4) as agg303, max_by(c7, c4) as agg304, max_by(c8, c4) as agg305, max_by(c8, c4) as agg306, max_by(c8, c4) as agg307, max_by(c24, c4) as agg308, max_by(c10, c4) as agg309, max_by(c11, c4) as agg310, max_by(c25, c4) as agg311, max_by(c0, c5) as agg312, max_by(c1, c5) as agg313, max_by(c2, c5) as agg314, max_by(c3, c5) as agg315, max_by(c4, c5) as agg316, max_by(c5, c5) as agg317, max_by(c6, c5) as agg318, max_by(c7, c5) as agg319, max_by(c8, c5) as agg320, max_by(c8, c5) as agg321, max_by(c8, c5) as agg322, max_by(c24, c5) as agg323, max_by(c10, c5) as agg324, max_by(c11, c5) as agg325, max_by(c25, c5) as agg326, max_by(c0, c6) as agg327, max_by(c1, c6) as agg328, max_by(c2, c6) as agg329, max_by(c3, c6) as agg330, max_by(c4, c6) as agg331, max_by(c5, c6) as agg332, max_by(c6, c6) as agg333, max_by(c7, c6) as agg334, max_by(c8, c6) as agg335, max_by(c8, c6) as agg336, max_by(c8, c6) as agg337, max_by(c24, c6) as agg338, max_by(c10, c6) as agg339, max_by(c11, c6) as agg340, max_by(c25, c6) as agg341, max_by(c0, c7) as agg342, max_by(c1, c7) as agg343, max_by(c2, c7) as agg344, max_by(c3, c7) as agg345, max_by(c4, c7) as agg346, max_by(c5, c7) as agg347, max_by(c6, c7) as agg348, max_by(c7, c7) as agg349, max_by(c8, c7) as agg350, max_by(c8, c7) as agg351, max_by(c8, c7) as agg352, max_by(c24, c7) as agg353, max_by(c10, c7) as agg354, max_by(c11, c7) as agg355, max_by(c25, c7) as agg356, max_by(c0, c8) as agg357, max_by(c1, c8) as agg358, max_by(c2, c8) as agg359, max_by(c3, c8) as agg360, max_by(c4, c8) as agg361, max_by(c5, c8) as agg362, max_by(c6, c8) as agg363, max_by(c7, c8) as agg364, max_by(c8, c8) as agg365, max_by(c8, c8) as agg366, max_by(c8, c8) as agg367, max_by(c24, c8) as agg368, max_by(c10, c8) as agg369, max_by(c11, c8) as agg370, max_by(c25, c8) as agg371, max_by(c0, c8) as agg372, max_by(c1, c8) as agg373, max_by(c2, c8) as agg374, max_by(c3, c8) as agg375, max_by(c4, c8) as agg376, max_by(c5, c8) as agg377, max_by(c6, c8) as agg378, max_by(c7, c8) as agg379, max_by(c8, c8) as agg380, max_by(c8, c8) as agg381, max_by(c8, c8) as agg382, max_by(c24, c8) as agg383, max_by(c10, c8) as agg384, max_by(c11, c8) as agg385, max_by(c25, c8) as agg386, max_by(c0, c8) as agg387, max_by(c1, c8) as agg388, max_by(c2, c8) as agg389, max_by(c3, c8) as agg390, max_by(c4, c8) as agg391, max_by(c5, c8) as agg392, max_by(c6, c8) as agg393, max_by(c7, c8) as agg394, max_by(c8, c8) as agg395, max_by(c8, c8) as agg396, max_by(c8, c8) as agg397, max_by(c24, c8) as agg398, max_by(c10, c8) as agg399, max_by(c11, c8) as agg400, max_by(c25, c8) as agg401, max_by(c0, c24) as agg402, max_by(c1, c24) as agg403, max_by(c2, c24) as agg404, max_by(c3, c24) as agg405, max_by(c4, c24) as agg406, max_by(c5, c24) as agg407, max_by(c6, c24) as agg408, max_by(c7, c24) as agg409, max_by(c8, c24) as agg410, max_by(c8, c24) as agg411, max_by(c8, c24) as agg412, max_by(c24, c24) as agg413, max_by(c10, c24) as agg414, max_by(c11, c24) as agg415, max_by(c25, c24) as agg416, max_by(c0, c10) as agg417, max_by(c1, c10) as agg418, max_by(c2, c10) as agg419, max_by(c3, c10) as agg420, max_by(c4, c10) as agg421, max_by(c5, c10) as agg422, max_by(c6, c10) as agg423, max_by(c7, c10) as agg424, max_by(c8, c10) as agg425, max_by(c8, c10) as agg426, max_by(c8, c10) as agg427, max_by(c24, c10) as agg428, max_by(c10, c10) as agg429, max_by(c11, c10) as agg430, max_by(c25, c10) as agg431, max_by(c0, c11) as agg432, max_by(c1, c11) as agg433, max_by(c2, c11) as agg434, max_by(c3, c11) as agg435, max_by(c4, c11) as agg436, max_by(c5, c11) as agg437, max_by(c6, c11) as agg438, max_by(c7, c11) as agg439, max_by(c8, c11) as agg440, max_by(c8, c11) as agg441, max_by(c8, c11) as agg442, max_by(c24, c11) as agg443, max_by(c10, c11) as agg444, max_by(c11, c11) as agg445, max_by(c25, c11) as agg446, min_by(c0, c0) as agg447, min_by(c1, c0) as agg448, min_by(c2, c0) as agg449, min_by(c3, c0) as agg450, min_by(c4, c0) as agg451, min_by(c5, c0) as agg452, min_by(c6, c0) as agg453, min_by(c7, c0) as agg454, min_by(c8, c0) as agg455, min_by(c8, c0) as agg456, min_by(c8, c0) as agg457, min_by(c24, c0) as agg458, min_by(c10, c0) as agg459, min_by(c11, c0) as agg460, min_by(c25, c0) as agg461, min_by(c0, c1) as agg462, min_by(c1, c1) as agg463, min_by(c2, c1) as agg464, min_by(c3, c1) as agg465, min_by(c4, c1) as agg466, min_by(c5, c1) as agg467, min_by(c6, c1) as agg468, min_by(c7, c1) as agg469, min_by(c8, c1) as agg470, min_by(c8, c1) as agg471, min_by(c8, c1) as agg472, min_by(c24, c1) as agg473, min_by(c10, c1) as agg474, min_by(c11, c1) as agg475, min_by(c25, c1) as agg476, min_by(c0, c2) as agg477, min_by(c1, c2) as agg478, min_by(c2, c2) as agg479, min_by(c3, c2) as agg480, min_by(c4, c2) as agg481, min_by(c5, c2) as agg482, min_by(c6, c2) as agg483, min_by(c7, c2) as agg484, min_by(c8, c2) as agg485, min_by(c8, c2) as agg486, min_by(c8, c2) as agg487, min_by(c24, c2) as agg488, min_by(c10, c2) as agg489, min_by(c11, c2) as agg490, min_by(c25, c2) as agg491, min_by(c0, c3) as agg492, min_by(c1, c3) as agg493, min_by(c2, c3) as agg494, min_by(c3, c3) as agg495, min_by(c4, c3) as agg496, min_by(c5, c3) as agg497, min_by(c6, c3) as agg498, min_by(c7, c3) as agg499, min_by(c8, c3) as agg500, min_by(c8, c3) as agg501, min_by(c8, c3) as agg502, min_by(c24, c3) as agg503, min_by(c10, c3) as agg504, min_by(c11, c3) as agg505, min_by(c25, c3) as agg506, min_by(c0, c4) as agg507, min_by(c1, c4) as agg508, min_by(c2, c4) as agg509, min_by(c3, c4) as agg510, min_by(c4, c4) as agg511, min_by(c5, c4) as agg512, min_by(c6, c4) as agg513, min_by(c7, c4) as agg514, min_by(c8, c4) as agg515, min_by(c8, c4) as agg516, min_by(c8, c4) as agg517, min_by(c24, c4) as agg518, min_by(c10, c4) as agg519, min_by(c11, c4) as agg520, min_by(c25, c4) as agg521, min_by(c0, c5) as agg522, min_by(c1, c5) as agg523, min_by(c2, c5) as agg524, min_by(c3, c5) as agg525, min_by(c4, c5) as agg526, min_by(c5, c5) as agg527, min_by(c6, c5) as agg528, min_by(c7, c5) as agg529, min_by(c8, c5) as agg530, min_by(c8, c5) as agg531, min_by(c8, c5) as agg532, min_by(c24, c5) as agg533, min_by(c10, c5) as agg534, min_by(c11, c5) as agg535, min_by(c25, c5) as agg536, min_by(c0, c6) as agg537, min_by(c1, c6) as agg538, min_by(c2, c6) as agg539, min_by(c3, c6) as agg540, min_by(c4, c6) as agg541, min_by(c5, c6) as agg542, min_by(c6, c6) as agg543, min_by(c7, c6) as agg544, min_by(c8, c6) as agg545, min_by(c8, c6) as agg546, min_by(c8, c6) as agg547, min_by(c24, c6) as agg548, min_by(c10, c6) as agg549, min_by(c11, c6) as agg550, min_by(c25, c6) as agg551, min_by(c0, c7) as agg552, min_by(c1, c7) as agg553, min_by(c2, c7) as agg554, min_by(c3, c7) as agg555, min_by(c4, c7) as agg556, min_by(c5, c7) as agg557, min_by(c6, c7) as agg558, min_by(c7, c7) as agg559, min_by(c8, c7) as agg560, min_by(c8, c7) as agg561, min_by(c8, c7) as agg562, min_by(c24, c7) as agg563, min_by(c10, c7) as agg564, min_by(c11, c7) as agg565, min_by(c25, c7) as agg566, min_by(c0, c8) as agg567, min_by(c1, c8) as agg568, min_by(c2, c8) as agg569, min_by(c3, c8) as agg570, min_by(c4, c8) as agg571, min_by(c5, c8) as agg572, min_by(c6, c8) as agg573, min_by(c7, c8) as agg574, min_by(c8, c8) as agg575, min_by(c8, c8) as agg576, min_by(c8, c8) as agg577, min_by(c24, c8) as agg578, min_by(c10, c8) as agg579, min_by(c11, c8) as agg580, min_by(c25, c8) as agg581, min_by(c0, c8) as agg582, min_by(c1, c8) as agg583, min_by(c2, c8) as agg584, min_by(c3, c8) as agg585, min_by(c4, c8) as agg586, min_by(c5, c8) as agg587, min_by(c6, c8) as agg588, min_by(c7, c8) as agg589, min_by(c8, c8) as agg590, min_by(c8, c8) as agg591, min_by(c8, c8) as agg592, min_by(c24, c8) as agg593, min_by(c10, c8) as agg594, min_by(c11, c8) as agg595, min_by(c25, c8) as agg596, min_by(c0, c8) as agg597, min_by(c1, c8) as agg598, min_by(c2, c8) as agg599, min_by(c3, c8) as agg600, min_by(c4, c8) as agg601, min_by(c5, c8) as agg602, min_by(c6, c8) as agg603, min_by(c7, c8) as agg604, min_by(c8, c8) as agg605, min_by(c8, c8) as agg606, min_by(c8, c8) as agg607, min_by(c24, c8) as agg608, min_by(c10, c8) as agg609, min_by(c11, c8) as agg610, min_by(c25, c8) as agg611, min_by(c0, c24) as agg612, min_by(c1, c24) as agg613, min_by(c2, c24) as agg614, min_by(c3, c24) as agg615, min_by(c4, c24) as agg616, min_by(c5, c24) as agg617, min_by(c6, c24) as agg618, min_by(c7, c24) as agg619, min_by(c8, c24) as agg620, min_by(c8, c24) as agg621, min_by(c8, c24) as agg622, min_by(c24, c24) as agg623, min_by(c10, c24) as agg624, min_by(c11, c24) as agg625, min_by(c25, c24) as agg626, min_by(c0, c10) as agg627, min_by(c1, c10) as agg628, min_by(c2, c10) as agg629, min_by(c3, c10) as agg630, min_by(c4, c10) as agg631, min_by(c5, c10) as agg632, min_by(c6, c10) as agg633, min_by(c7, c10) as agg634, min_by(c8, c10) as agg635, min_by(c8, c10) as agg636, min_by(c8, c10) as agg637, min_by(c24, c10) as agg638, min_by(c10, c10) as agg639, min_by(c11, c10) as agg640, min_by(c25, c10) as agg641, min_by(c0, c11) as agg642, min_by(c1, c11) as agg643, min_by(c2, c11) as agg644, min_by(c3, c11) as agg645, min_by(c4, c11) as agg646, min_by(c5, c11) as agg647, min_by(c6, c11) as agg648, min_by(c7, c11) as agg649, min_by(c8, c11) as agg650, min_by(c8, c11) as agg651, min_by(c8, c11) as agg652, min_by(c24, c11) as agg653, min_by(c10, c11) as agg654, min_by(c11, c11) as agg655, min_by(c25, c11) as agg656, variance_pop(c6) as agg657, variance_pop(c7) as agg658, variance_pop(c0) as agg659, variance_pop(c1) as agg660, variance_pop(c2) as agg661, variance_pop(c3) as agg662, variance_pop(c4) as agg663, variance_pop(c5) as agg664, avg(c6) as agg665, avg(c7) as agg666, avg(c1) as agg667, avg(c2) as agg668, avg(c3) as agg669, avg(c4) as agg670, avg(c5) as agg671, avg(c8) as agg672, avg(c8) as agg673, avg(c8) as agg674, any_value(c0) as agg675, any_value(c1) as agg676, any_value(c2) as agg677, any_value(c3) as agg678, any_value(c4) as agg679, any_value(c5) as agg680, any_value(c6) as agg681, any_value(c7) as agg682, any_value(c8) as agg683, any_value(c8) as agg684, any_value(c8) as agg685, any_value(c24) as agg686, any_value(c10) as agg687, any_value(c11) as agg688, any_value(c16) as agg689, any_value(c27) as agg690, any_value(c28) as agg691, any_value(c25) as agg692, any_value(c26) as agg693, var_pop(c6) as agg694, var_pop(c7) as agg695, var_pop(c0) as agg696, var_pop(c1) as agg697, var_pop(c2) as agg698, var_pop(c3) as agg699, var_pop(c4) as agg700, var_pop(c5) as agg701, stddev_pop(c6) as agg702, stddev_pop(c7) as agg703, stddev_pop(c0) as agg704, stddev_pop(c1) as agg705, stddev_pop(c2) as agg706, stddev_pop(c3) as agg707, stddev_pop(c4) as agg708, stddev_pop(c5) as agg709, variance_samp(c6) as agg710, variance_samp(c7) as agg711, variance_samp(c0) as agg712, variance_samp(c1) as agg713, variance_samp(c2) as agg714, variance_samp(c3) as agg715, variance_samp(c4) as agg716, variance_samp(c5) as agg717, percentile_cont(c10, 0.5) as agg718, percentile_cont(c11, 0.5) as agg719, percentile_cont(c6, 0.5) as agg720, corr(c6, c6) as agg721, corr(c7, c7) as agg722, corr(c0, c0) as agg723, corr(c1, c1) as agg724, corr(c2, c2) as agg725, corr(c3, c3) as agg726, corr(c4, c4) as agg727, corr(c5, c5) as agg728, multi_distinct_sum(c6) as agg729, multi_distinct_sum(c7) as agg730, multi_distinct_sum(c0) as agg731, multi_distinct_sum(c1) as agg732, multi_distinct_sum(c2) as agg733, multi_distinct_sum(c3) as agg734, multi_distinct_sum(c4) as agg735, multi_distinct_sum(c5) as agg736, multi_distinct_sum(c8) as agg737, multi_distinct_sum(c8) as agg738, multi_distinct_sum(c8) as agg739, var_samp(c6) as agg740, var_samp(c7) as agg741, var_samp(c0) as agg742, var_samp(c1) as agg743, var_samp(c2) as agg744, var_samp(c3) as agg745, var_samp(c4) as agg746, var_samp(c5) as agg747, bitmap_union_int(c1) as agg748, bitmap_union_int(c2) as agg749, bitmap_union_int(c3) as agg750, bitmap_union_int(c4) as agg751, variance(c6) as agg752, variance(c7) as agg753, variance(c0) as agg754, variance(c1) as agg755, variance(c2) as agg756, variance(c3) as agg757, variance(c4) as agg758, variance(c5) as agg759 from t1 group by k1; -- result: E: (1064, 'PseudoType should not exposed to external') diff --git a/test/sql/test_agg_state/T/test_agg_state_with_sync_mv.sql b/test/sql/test_agg_state/T/test_agg_state_with_sync_mv.sql index c8415b6c7aba9..f4e9c677ef17d 100644 --- a/test/sql/test_agg_state/T/test_agg_state_with_sync_mv.sql +++ b/test/sql/test_agg_state/T/test_agg_state_with_sync_mv.sql @@ -72,6 +72,7 @@ INSERT INTO t1 VALUES -- create sync mv CREATE MATERIALIZED VIEW test_mv1 as select k1, percentile_approx_union(percentile_approx_state(c6, 0.5)) as agg14, percentile_approx_union(percentile_approx_state(c6, 0.5)) as agg15, covar_pop_union(covar_pop_state(c6, c6)) as agg16, covar_pop_union(covar_pop_state(c7, c7)) as agg17, covar_pop_union(covar_pop_state(c0, c0)) as agg18, covar_pop_union(covar_pop_state(c1, c1)) as agg19, covar_pop_union(covar_pop_state(c2, c2)) as agg20, covar_pop_union(covar_pop_state(c3, c3)) as agg21, covar_pop_union(covar_pop_state(c4, c4)) as agg22, covar_pop_union(covar_pop_state(c5, c5)) as agg23, count_union(count_state(c0)) as agg24, count_union(count_state(c1)) as agg25, count_union(count_state(c2)) as agg26, count_union(count_state(c3)) as agg27, count_union(count_state(c4)) as agg28, count_union(count_state(c5)) as agg29, count_union(count_state(c6)) as agg30, count_union(count_state(c7)) as agg31, count_union(count_state(c8)) as agg32, count_union(count_state(c8)) as agg33, count_union(count_state(c8)) as agg34, count_union(count_state(c24)) as agg35, count_union(count_state(c10)) as agg36, count_union(count_state(c11)) as agg37, count_union(count_state(c16)) as agg38, count_union(count_state(c27)) as agg39, count_union(count_state(c28)) as agg40, count_union(count_state(c25)) as agg41, count_union(count_state(c26)) as agg42, array_unique_agg_union(array_unique_agg_state(c12)) as agg43, array_unique_agg_union(array_unique_agg_state(c13)) as agg44, array_unique_agg_union(array_unique_agg_state(c14)) as agg45, array_unique_agg_union(array_unique_agg_state(c15)) as agg46, array_unique_agg_union(array_unique_agg_state(c16)) as agg47, array_unique_agg_union(array_unique_agg_state(c17)) as agg48, array_unique_agg_union(array_unique_agg_state(c18)) as agg49, array_unique_agg_union(array_unique_agg_state(c19)) as agg50, array_unique_agg_union(array_unique_agg_state(c20)) as agg51, array_unique_agg_union(array_unique_agg_state(c20)) as agg52, array_unique_agg_union(array_unique_agg_state(c20)) as agg53, array_unique_agg_union(array_unique_agg_state(c20)) as agg54, array_unique_agg_union(array_unique_agg_state(c21)) as agg55, array_unique_agg_union(array_unique_agg_state(c22)) as agg56, array_unique_agg_union(array_unique_agg_state(c23)) as agg57, percentile_disc_union(percentile_disc_state(c0, 0.5)) as agg58, percentile_disc_union(percentile_disc_state(c1, 0.5)) as agg59, percentile_disc_union(percentile_disc_state(c2, 0.5)) as agg60, percentile_disc_union(percentile_disc_state(c3, 0.5)) as agg61, percentile_disc_union(percentile_disc_state(c4, 0.5)) as agg62, percentile_disc_union(percentile_disc_state(c5, 0.5)) as agg63, percentile_disc_union(percentile_disc_state(c8, 0.5)) as agg64, percentile_disc_union(percentile_disc_state(c8, 0.5)) as agg65, percentile_disc_union(percentile_disc_state(c8, 0.5)) as agg66, percentile_disc_union(percentile_disc_state(c9, 0.5)) as agg67, percentile_disc_union(percentile_disc_state(c10, 0.5)) as agg68, percentile_disc_union(percentile_disc_state(c11, 0.5)) as agg69, percentile_disc_union(percentile_disc_state(c6, 0.5)) as agg70, percentile_disc_union(percentile_disc_state(c7, 0.5)) as agg71, multi_distinct_count_union(multi_distinct_count_state(c0)) as agg72, multi_distinct_count_union(multi_distinct_count_state(c1)) as agg73, multi_distinct_count_union(multi_distinct_count_state(c2)) as agg74, multi_distinct_count_union(multi_distinct_count_state(c3)) as agg75, multi_distinct_count_union(multi_distinct_count_state(c4)) as agg76, multi_distinct_count_union(multi_distinct_count_state(c5)) as agg77, multi_distinct_count_union(multi_distinct_count_state(c6)) as agg78, multi_distinct_count_union(multi_distinct_count_state(c7)) as agg79, multi_distinct_count_union(multi_distinct_count_state(c8)) as agg80, multi_distinct_count_union(multi_distinct_count_state(c8)) as agg81, multi_distinct_count_union(multi_distinct_count_state(c8)) as agg82, multi_distinct_count_union(multi_distinct_count_state(c9)) as agg83, multi_distinct_count_union(multi_distinct_count_state(c10)) as agg84, multi_distinct_count_union(multi_distinct_count_state(c11)) as agg85, array_agg_union(array_agg_state(c24)) as agg86, stddev_samp_union(stddev_samp_state(c6)) as agg87, stddev_samp_union(stddev_samp_state(c7)) as agg88, stddev_samp_union(stddev_samp_state(c0)) as agg89, stddev_samp_union(stddev_samp_state(c1)) as agg90, stddev_samp_union(stddev_samp_state(c2)) as agg91, stddev_samp_union(stddev_samp_state(c3)) as agg92, stddev_samp_union(stddev_samp_state(c4)) as agg93, stddev_samp_union(stddev_samp_state(c5)) as agg94, mann_whitney_u_test_union(mann_whitney_u_test_state(c6, c0, 'two-sided', 0)) as agg95, mann_whitney_u_test_union(mann_whitney_u_test_state(c6, c0, 'less')) as agg96, mann_whitney_u_test_union(mann_whitney_u_test_state(c6, c0, 'two-sided', 0)) as agg97, max_union(max_state(c0)) as agg98, max_union(max_state(c1)) as agg99, max_union(max_state(c2)) as agg100, max_union(max_state(c3)) as agg101, max_union(max_state(c4)) as agg102, max_union(max_state(c5)) as agg103, max_union(max_state(c6)) as agg104, max_union(max_state(c7)) as agg105, max_union(max_state(c8)) as agg106, max_union(max_state(c8)) as agg107, max_union(max_state(c8)) as agg108, max_union(max_state(c24)) as agg109, max_union(max_state(c10)) as agg110, max_union(max_state(c11)) as agg111, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c0, 18, 'hll_6')) as agg112, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c0, 18)) as agg113, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c0, 18, 'hll_6')) as agg114, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c1, 18, 'hll_6')) as agg115, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c1, 18)) as agg116, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c1, 18, 'hll_6')) as agg117, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c2, 18, 'hll_6')) as agg118, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c2, 18)) as agg119, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c2, 18, 'hll_6')) as agg120, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c3, 18, 'hll_6')) as agg121, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c3, 18)) as agg122, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c3, 18, 'hll_6')) as agg123, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c4, 18, 'hll_6')) as agg124, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c4, 18)) as agg125, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c4, 18, 'hll_6')) as agg126, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c5, 18, 'hll_6')) as agg127, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c5, 18)) as agg128, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c5, 18, 'hll_6')) as agg129, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c6, 18, 'hll_6')) as agg130, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c6, 18)) as agg131, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c6, 18, 'hll_6')) as agg132, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c7, 18, 'hll_6')) as agg133, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c7, 18)) as agg134, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c7, 18, 'hll_6')) as agg135, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c8, 18, 'hll_6')) as agg136, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c8, 18)) as agg137, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c8, 18, 'hll_6')) as agg138, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c8, 18, 'hll_6')) as agg139, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c8, 18)) as agg140, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c8, 18, 'hll_6')) as agg141, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c8, 18, 'hll_6')) as agg142, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c8, 18)) as agg143, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c8, 18, 'hll_6')) as agg144, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c24, 18, 'hll_6')) as agg145, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c24, 18)) as agg146, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c24, 18, 'hll_6')) as agg147, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c10, 18, 'hll_6')) as agg148, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c10, 18)) as agg149, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c10, 18, 'hll_6')) as agg150, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c11, 18, 'hll_6')) as agg151, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c11, 18)) as agg152, ds_hll_count_distinct_union(ds_hll_count_distinct_state(c11, 18, 'hll_6')) as agg153, ndv_union(ndv_state(c0)) as agg154, ndv_union(ndv_state(c1)) as agg155, ndv_union(ndv_state(c2)) as agg156, ndv_union(ndv_state(c3)) as agg157, ndv_union(ndv_state(c4)) as agg158, ndv_union(ndv_state(c5)) as agg159, ndv_union(ndv_state(c6)) as agg160, ndv_union(ndv_state(c7)) as agg161, ndv_union(ndv_state(c8)) as agg162, ndv_union(ndv_state(c8)) as agg163, ndv_union(ndv_state(c8)) as agg164, ndv_union(ndv_state(c24)) as agg165, ndv_union(ndv_state(c10)) as agg166, ndv_union(ndv_state(c11)) as agg167, stddev_union(stddev_state(c6)) as agg168, stddev_union(stddev_state(c7)) as agg169, stddev_union(stddev_state(c0)) as agg170, stddev_union(stddev_state(c1)) as agg171, stddev_union(stddev_state(c2)) as agg172, stddev_union(stddev_state(c3)) as agg173, stddev_union(stddev_state(c4)) as agg174, stddev_union(stddev_state(c5)) as agg175, covar_samp_union(covar_samp_state(c6, c6)) as agg176, covar_samp_union(covar_samp_state(c7, c7)) as agg177, covar_samp_union(covar_samp_state(c0, c0)) as agg178, covar_samp_union(covar_samp_state(c1, c1)) as agg179, covar_samp_union(covar_samp_state(c2, c2)) as agg180, covar_samp_union(covar_samp_state(c3, c3)) as agg181, covar_samp_union(covar_samp_state(c4, c4)) as agg182, covar_samp_union(covar_samp_state(c5, c5)) as agg183, bitmap_agg_union(bitmap_agg_state(c4)) as agg184, bitmap_agg_union(bitmap_agg_state(c5)) as agg185, bitmap_agg_union(bitmap_agg_state(c3)) as agg186, bitmap_agg_union(bitmap_agg_state(c2)) as agg187, bitmap_agg_union(bitmap_agg_state(c1)) as agg188, bitmap_agg_union(bitmap_agg_state(c0)) as agg189, std_union(std_state(c6)) as agg190, std_union(std_state(c7)) as agg191, std_union(std_state(c0)) as agg192, std_union(std_state(c1)) as agg193, std_union(std_state(c2)) as agg194, std_union(std_state(c3)) as agg195, std_union(std_state(c4)) as agg196, std_union(std_state(c5)) as agg197, sum_union(sum_state(c6)) as agg198, sum_union(sum_state(c7)) as agg199, sum_union(sum_state(c1)) as agg200, sum_union(sum_state(c2)) as agg201, sum_union(sum_state(c3)) as agg202, sum_union(sum_state(c4)) as agg203, sum_union(sum_state(c5)) as agg204, sum_union(sum_state(c8)) as agg205, sum_union(sum_state(c8)) as agg206, sum_union(sum_state(c8)) as agg207, approx_count_distinct_union(approx_count_distinct_state(c0)) as agg208, approx_count_distinct_union(approx_count_distinct_state(c1)) as agg209, approx_count_distinct_union(approx_count_distinct_state(c2)) as agg210, approx_count_distinct_union(approx_count_distinct_state(c3)) as agg211, approx_count_distinct_union(approx_count_distinct_state(c4)) as agg212, approx_count_distinct_union(approx_count_distinct_state(c5)) as agg213, approx_count_distinct_union(approx_count_distinct_state(c6)) as agg214, approx_count_distinct_union(approx_count_distinct_state(c7)) as agg215, approx_count_distinct_union(approx_count_distinct_state(c8)) as agg216, approx_count_distinct_union(approx_count_distinct_state(c8)) as agg217, approx_count_distinct_union(approx_count_distinct_state(c8)) as agg218, approx_count_distinct_union(approx_count_distinct_state(c24)) as agg219, approx_count_distinct_union(approx_count_distinct_state(c10)) as agg220, approx_count_distinct_union(approx_count_distinct_state(c11)) as agg221, min_union(min_state(c0)) as agg222, min_union(min_state(c1)) as agg223, min_union(min_state(c2)) as agg224, min_union(min_state(c3)) as agg225, min_union(min_state(c4)) as agg226, min_union(min_state(c5)) as agg227, min_union(min_state(c6)) as agg228, min_union(min_state(c7)) as agg229, min_union(min_state(c8)) as agg230, min_union(min_state(c8)) as agg231, min_union(min_state(c8)) as agg232, min_union(min_state(c24)) as agg233, min_union(min_state(c10)) as agg234, min_union(min_state(c11)) as agg235, retention_union(retention_state(c12)) as agg236, max_by_union(max_by_state(c0, c0)) as agg237, max_by_union(max_by_state(c1, c0)) as agg238, max_by_union(max_by_state(c2, c0)) as agg239, max_by_union(max_by_state(c3, c0)) as agg240, max_by_union(max_by_state(c4, c0)) as agg241, max_by_union(max_by_state(c5, c0)) as agg242, max_by_union(max_by_state(c6, c0)) as agg243, max_by_union(max_by_state(c7, c0)) as agg244, max_by_union(max_by_state(c8, c0)) as agg245, max_by_union(max_by_state(c8, c0)) as agg246, max_by_union(max_by_state(c8, c0)) as agg247, max_by_union(max_by_state(c24, c0)) as agg248, max_by_union(max_by_state(c10, c0)) as agg249, max_by_union(max_by_state(c11, c0)) as agg250, max_by_union(max_by_state(c25, c0)) as agg251, max_by_union(max_by_state(c0, c1)) as agg252, max_by_union(max_by_state(c1, c1)) as agg253, max_by_union(max_by_state(c2, c1)) as agg254, max_by_union(max_by_state(c3, c1)) as agg255, max_by_union(max_by_state(c4, c1)) as agg256, max_by_union(max_by_state(c5, c1)) as agg257, max_by_union(max_by_state(c6, c1)) as agg258, max_by_union(max_by_state(c7, c1)) as agg259, max_by_union(max_by_state(c8, c1)) as agg260, max_by_union(max_by_state(c8, c1)) as agg261, max_by_union(max_by_state(c8, c1)) as agg262, max_by_union(max_by_state(c24, c1)) as agg263, max_by_union(max_by_state(c10, c1)) as agg264, max_by_union(max_by_state(c11, c1)) as agg265, max_by_union(max_by_state(c25, c1)) as agg266, max_by_union(max_by_state(c0, c2)) as agg267, max_by_union(max_by_state(c1, c2)) as agg268, max_by_union(max_by_state(c2, c2)) as agg269, max_by_union(max_by_state(c3, c2)) as agg270, max_by_union(max_by_state(c4, c2)) as agg271, max_by_union(max_by_state(c5, c2)) as agg272, max_by_union(max_by_state(c6, c2)) as agg273, max_by_union(max_by_state(c7, c2)) as agg274, max_by_union(max_by_state(c8, c2)) as agg275, max_by_union(max_by_state(c8, c2)) as agg276, max_by_union(max_by_state(c8, c2)) as agg277, max_by_union(max_by_state(c24, c2)) as agg278, max_by_union(max_by_state(c10, c2)) as agg279, max_by_union(max_by_state(c11, c2)) as agg280, max_by_union(max_by_state(c25, c2)) as agg281, max_by_union(max_by_state(c0, c3)) as agg282, max_by_union(max_by_state(c1, c3)) as agg283, max_by_union(max_by_state(c2, c3)) as agg284, max_by_union(max_by_state(c3, c3)) as agg285, max_by_union(max_by_state(c4, c3)) as agg286, max_by_union(max_by_state(c5, c3)) as agg287, max_by_union(max_by_state(c6, c3)) as agg288, max_by_union(max_by_state(c7, c3)) as agg289, max_by_union(max_by_state(c8, c3)) as agg290, max_by_union(max_by_state(c8, c3)) as agg291, max_by_union(max_by_state(c8, c3)) as agg292, max_by_union(max_by_state(c24, c3)) as agg293, max_by_union(max_by_state(c10, c3)) as agg294, max_by_union(max_by_state(c11, c3)) as agg295, max_by_union(max_by_state(c25, c3)) as agg296, max_by_union(max_by_state(c0, c4)) as agg297, max_by_union(max_by_state(c1, c4)) as agg298, max_by_union(max_by_state(c2, c4)) as agg299, max_by_union(max_by_state(c3, c4)) as agg300, max_by_union(max_by_state(c4, c4)) as agg301, max_by_union(max_by_state(c5, c4)) as agg302, max_by_union(max_by_state(c6, c4)) as agg303, max_by_union(max_by_state(c7, c4)) as agg304, max_by_union(max_by_state(c8, c4)) as agg305, max_by_union(max_by_state(c8, c4)) as agg306, max_by_union(max_by_state(c8, c4)) as agg307, max_by_union(max_by_state(c24, c4)) as agg308, max_by_union(max_by_state(c10, c4)) as agg309, max_by_union(max_by_state(c11, c4)) as agg310, max_by_union(max_by_state(c25, c4)) as agg311, max_by_union(max_by_state(c0, c5)) as agg312, max_by_union(max_by_state(c1, c5)) as agg313, max_by_union(max_by_state(c2, c5)) as agg314, max_by_union(max_by_state(c3, c5)) as agg315, max_by_union(max_by_state(c4, c5)) as agg316, max_by_union(max_by_state(c5, c5)) as agg317, max_by_union(max_by_state(c6, c5)) as agg318, max_by_union(max_by_state(c7, c5)) as agg319, max_by_union(max_by_state(c8, c5)) as agg320, max_by_union(max_by_state(c8, c5)) as agg321, max_by_union(max_by_state(c8, c5)) as agg322, max_by_union(max_by_state(c24, c5)) as agg323, max_by_union(max_by_state(c10, c5)) as agg324, max_by_union(max_by_state(c11, c5)) as agg325, max_by_union(max_by_state(c25, c5)) as agg326, max_by_union(max_by_state(c0, c6)) as agg327, max_by_union(max_by_state(c1, c6)) as agg328, max_by_union(max_by_state(c2, c6)) as agg329, max_by_union(max_by_state(c3, c6)) as agg330, max_by_union(max_by_state(c4, c6)) as agg331, max_by_union(max_by_state(c5, c6)) as agg332, max_by_union(max_by_state(c6, c6)) as agg333, max_by_union(max_by_state(c7, c6)) as agg334, max_by_union(max_by_state(c8, c6)) as agg335, max_by_union(max_by_state(c8, c6)) as agg336, max_by_union(max_by_state(c8, c6)) as agg337, max_by_union(max_by_state(c24, c6)) as agg338, max_by_union(max_by_state(c10, c6)) as agg339, max_by_union(max_by_state(c11, c6)) as agg340, max_by_union(max_by_state(c25, c6)) as agg341, max_by_union(max_by_state(c0, c7)) as agg342, max_by_union(max_by_state(c1, c7)) as agg343, max_by_union(max_by_state(c2, c7)) as agg344, max_by_union(max_by_state(c3, c7)) as agg345, max_by_union(max_by_state(c4, c7)) as agg346, max_by_union(max_by_state(c5, c7)) as agg347, max_by_union(max_by_state(c6, c7)) as agg348, max_by_union(max_by_state(c7, c7)) as agg349, max_by_union(max_by_state(c8, c7)) as agg350, max_by_union(max_by_state(c8, c7)) as agg351, max_by_union(max_by_state(c8, c7)) as agg352, max_by_union(max_by_state(c24, c7)) as agg353, max_by_union(max_by_state(c10, c7)) as agg354, max_by_union(max_by_state(c11, c7)) as agg355, max_by_union(max_by_state(c25, c7)) as agg356, max_by_union(max_by_state(c0, c8)) as agg357, max_by_union(max_by_state(c1, c8)) as agg358, max_by_union(max_by_state(c2, c8)) as agg359, max_by_union(max_by_state(c3, c8)) as agg360, max_by_union(max_by_state(c4, c8)) as agg361, max_by_union(max_by_state(c5, c8)) as agg362, max_by_union(max_by_state(c6, c8)) as agg363, max_by_union(max_by_state(c7, c8)) as agg364, max_by_union(max_by_state(c8, c8)) as agg365, max_by_union(max_by_state(c8, c8)) as agg366, max_by_union(max_by_state(c8, c8)) as agg367, max_by_union(max_by_state(c24, c8)) as agg368, max_by_union(max_by_state(c10, c8)) as agg369, max_by_union(max_by_state(c11, c8)) as agg370, max_by_union(max_by_state(c25, c8)) as agg371, max_by_union(max_by_state(c0, c8)) as agg372, max_by_union(max_by_state(c1, c8)) as agg373, max_by_union(max_by_state(c2, c8)) as agg374, max_by_union(max_by_state(c3, c8)) as agg375, max_by_union(max_by_state(c4, c8)) as agg376, max_by_union(max_by_state(c5, c8)) as agg377, max_by_union(max_by_state(c6, c8)) as agg378, max_by_union(max_by_state(c7, c8)) as agg379, max_by_union(max_by_state(c8, c8)) as agg380, max_by_union(max_by_state(c8, c8)) as agg381, max_by_union(max_by_state(c8, c8)) as agg382, max_by_union(max_by_state(c24, c8)) as agg383, max_by_union(max_by_state(c10, c8)) as agg384, max_by_union(max_by_state(c11, c8)) as agg385, max_by_union(max_by_state(c25, c8)) as agg386, max_by_union(max_by_state(c0, c8)) as agg387, max_by_union(max_by_state(c1, c8)) as agg388, max_by_union(max_by_state(c2, c8)) as agg389, max_by_union(max_by_state(c3, c8)) as agg390, max_by_union(max_by_state(c4, c8)) as agg391, max_by_union(max_by_state(c5, c8)) as agg392, max_by_union(max_by_state(c6, c8)) as agg393, max_by_union(max_by_state(c7, c8)) as agg394, max_by_union(max_by_state(c8, c8)) as agg395, max_by_union(max_by_state(c8, c8)) as agg396, max_by_union(max_by_state(c8, c8)) as agg397, max_by_union(max_by_state(c24, c8)) as agg398, max_by_union(max_by_state(c10, c8)) as agg399, max_by_union(max_by_state(c11, c8)) as agg400, max_by_union(max_by_state(c25, c8)) as agg401, max_by_union(max_by_state(c0, c24)) as agg402, max_by_union(max_by_state(c1, c24)) as agg403, max_by_union(max_by_state(c2, c24)) as agg404, max_by_union(max_by_state(c3, c24)) as agg405, max_by_union(max_by_state(c4, c24)) as agg406, max_by_union(max_by_state(c5, c24)) as agg407, max_by_union(max_by_state(c6, c24)) as agg408, max_by_union(max_by_state(c7, c24)) as agg409, max_by_union(max_by_state(c8, c24)) as agg410, max_by_union(max_by_state(c8, c24)) as agg411, max_by_union(max_by_state(c8, c24)) as agg412, max_by_union(max_by_state(c24, c24)) as agg413, max_by_union(max_by_state(c10, c24)) as agg414, max_by_union(max_by_state(c11, c24)) as agg415, max_by_union(max_by_state(c25, c24)) as agg416, max_by_union(max_by_state(c0, c10)) as agg417, max_by_union(max_by_state(c1, c10)) as agg418, max_by_union(max_by_state(c2, c10)) as agg419, max_by_union(max_by_state(c3, c10)) as agg420, max_by_union(max_by_state(c4, c10)) as agg421, max_by_union(max_by_state(c5, c10)) as agg422, max_by_union(max_by_state(c6, c10)) as agg423, max_by_union(max_by_state(c7, c10)) as agg424, max_by_union(max_by_state(c8, c10)) as agg425, max_by_union(max_by_state(c8, c10)) as agg426, max_by_union(max_by_state(c8, c10)) as agg427, max_by_union(max_by_state(c24, c10)) as agg428, max_by_union(max_by_state(c10, c10)) as agg429, max_by_union(max_by_state(c11, c10)) as agg430, max_by_union(max_by_state(c25, c10)) as agg431, max_by_union(max_by_state(c0, c11)) as agg432, max_by_union(max_by_state(c1, c11)) as agg433, max_by_union(max_by_state(c2, c11)) as agg434, max_by_union(max_by_state(c3, c11)) as agg435, max_by_union(max_by_state(c4, c11)) as agg436, max_by_union(max_by_state(c5, c11)) as agg437, max_by_union(max_by_state(c6, c11)) as agg438, max_by_union(max_by_state(c7, c11)) as agg439, max_by_union(max_by_state(c8, c11)) as agg440, max_by_union(max_by_state(c8, c11)) as agg441, max_by_union(max_by_state(c8, c11)) as agg442, max_by_union(max_by_state(c24, c11)) as agg443, max_by_union(max_by_state(c10, c11)) as agg444, max_by_union(max_by_state(c11, c11)) as agg445, max_by_union(max_by_state(c25, c11)) as agg446, min_by_union(min_by_state(c0, c0)) as agg447, min_by_union(min_by_state(c1, c0)) as agg448, min_by_union(min_by_state(c2, c0)) as agg449, min_by_union(min_by_state(c3, c0)) as agg450, min_by_union(min_by_state(c4, c0)) as agg451, min_by_union(min_by_state(c5, c0)) as agg452, min_by_union(min_by_state(c6, c0)) as agg453, min_by_union(min_by_state(c7, c0)) as agg454, min_by_union(min_by_state(c8, c0)) as agg455, min_by_union(min_by_state(c8, c0)) as agg456, min_by_union(min_by_state(c8, c0)) as agg457, min_by_union(min_by_state(c24, c0)) as agg458, min_by_union(min_by_state(c10, c0)) as agg459, min_by_union(min_by_state(c11, c0)) as agg460, min_by_union(min_by_state(c25, c0)) as agg461, min_by_union(min_by_state(c0, c1)) as agg462, min_by_union(min_by_state(c1, c1)) as agg463, min_by_union(min_by_state(c2, c1)) as agg464, min_by_union(min_by_state(c3, c1)) as agg465, min_by_union(min_by_state(c4, c1)) as agg466, min_by_union(min_by_state(c5, c1)) as agg467, min_by_union(min_by_state(c6, c1)) as agg468, min_by_union(min_by_state(c7, c1)) as agg469, min_by_union(min_by_state(c8, c1)) as agg470, min_by_union(min_by_state(c8, c1)) as agg471, min_by_union(min_by_state(c8, c1)) as agg472, min_by_union(min_by_state(c24, c1)) as agg473, min_by_union(min_by_state(c10, c1)) as agg474, min_by_union(min_by_state(c11, c1)) as agg475, min_by_union(min_by_state(c25, c1)) as agg476, min_by_union(min_by_state(c0, c2)) as agg477, min_by_union(min_by_state(c1, c2)) as agg478, min_by_union(min_by_state(c2, c2)) as agg479, min_by_union(min_by_state(c3, c2)) as agg480, min_by_union(min_by_state(c4, c2)) as agg481, min_by_union(min_by_state(c5, c2)) as agg482, min_by_union(min_by_state(c6, c2)) as agg483, min_by_union(min_by_state(c7, c2)) as agg484, min_by_union(min_by_state(c8, c2)) as agg485, min_by_union(min_by_state(c8, c2)) as agg486, min_by_union(min_by_state(c8, c2)) as agg487, min_by_union(min_by_state(c24, c2)) as agg488, min_by_union(min_by_state(c10, c2)) as agg489, min_by_union(min_by_state(c11, c2)) as agg490, min_by_union(min_by_state(c25, c2)) as agg491, min_by_union(min_by_state(c0, c3)) as agg492, min_by_union(min_by_state(c1, c3)) as agg493, min_by_union(min_by_state(c2, c3)) as agg494, min_by_union(min_by_state(c3, c3)) as agg495, min_by_union(min_by_state(c4, c3)) as agg496, min_by_union(min_by_state(c5, c3)) as agg497, min_by_union(min_by_state(c6, c3)) as agg498, min_by_union(min_by_state(c7, c3)) as agg499, min_by_union(min_by_state(c8, c3)) as agg500, min_by_union(min_by_state(c8, c3)) as agg501, min_by_union(min_by_state(c8, c3)) as agg502, min_by_union(min_by_state(c24, c3)) as agg503, min_by_union(min_by_state(c10, c3)) as agg504, min_by_union(min_by_state(c11, c3)) as agg505, min_by_union(min_by_state(c25, c3)) as agg506, min_by_union(min_by_state(c0, c4)) as agg507, min_by_union(min_by_state(c1, c4)) as agg508, min_by_union(min_by_state(c2, c4)) as agg509, min_by_union(min_by_state(c3, c4)) as agg510, min_by_union(min_by_state(c4, c4)) as agg511, min_by_union(min_by_state(c5, c4)) as agg512, min_by_union(min_by_state(c6, c4)) as agg513, min_by_union(min_by_state(c7, c4)) as agg514, min_by_union(min_by_state(c8, c4)) as agg515, min_by_union(min_by_state(c8, c4)) as agg516, min_by_union(min_by_state(c8, c4)) as agg517, min_by_union(min_by_state(c24, c4)) as agg518, min_by_union(min_by_state(c10, c4)) as agg519, min_by_union(min_by_state(c11, c4)) as agg520, min_by_union(min_by_state(c25, c4)) as agg521, min_by_union(min_by_state(c0, c5)) as agg522, min_by_union(min_by_state(c1, c5)) as agg523, min_by_union(min_by_state(c2, c5)) as agg524, min_by_union(min_by_state(c3, c5)) as agg525, min_by_union(min_by_state(c4, c5)) as agg526, min_by_union(min_by_state(c5, c5)) as agg527, min_by_union(min_by_state(c6, c5)) as agg528, min_by_union(min_by_state(c7, c5)) as agg529, min_by_union(min_by_state(c8, c5)) as agg530, min_by_union(min_by_state(c8, c5)) as agg531, min_by_union(min_by_state(c8, c5)) as agg532, min_by_union(min_by_state(c24, c5)) as agg533, min_by_union(min_by_state(c10, c5)) as agg534, min_by_union(min_by_state(c11, c5)) as agg535, min_by_union(min_by_state(c25, c5)) as agg536, min_by_union(min_by_state(c0, c6)) as agg537, min_by_union(min_by_state(c1, c6)) as agg538, min_by_union(min_by_state(c2, c6)) as agg539, min_by_union(min_by_state(c3, c6)) as agg540, min_by_union(min_by_state(c4, c6)) as agg541, min_by_union(min_by_state(c5, c6)) as agg542, min_by_union(min_by_state(c6, c6)) as agg543, min_by_union(min_by_state(c7, c6)) as agg544, min_by_union(min_by_state(c8, c6)) as agg545, min_by_union(min_by_state(c8, c6)) as agg546, min_by_union(min_by_state(c8, c6)) as agg547, min_by_union(min_by_state(c24, c6)) as agg548, min_by_union(min_by_state(c10, c6)) as agg549, min_by_union(min_by_state(c11, c6)) as agg550, min_by_union(min_by_state(c25, c6)) as agg551, min_by_union(min_by_state(c0, c7)) as agg552, min_by_union(min_by_state(c1, c7)) as agg553, min_by_union(min_by_state(c2, c7)) as agg554, min_by_union(min_by_state(c3, c7)) as agg555, min_by_union(min_by_state(c4, c7)) as agg556, min_by_union(min_by_state(c5, c7)) as agg557, min_by_union(min_by_state(c6, c7)) as agg558, min_by_union(min_by_state(c7, c7)) as agg559, min_by_union(min_by_state(c8, c7)) as agg560, min_by_union(min_by_state(c8, c7)) as agg561, min_by_union(min_by_state(c8, c7)) as agg562, min_by_union(min_by_state(c24, c7)) as agg563, min_by_union(min_by_state(c10, c7)) as agg564, min_by_union(min_by_state(c11, c7)) as agg565, min_by_union(min_by_state(c25, c7)) as agg566, min_by_union(min_by_state(c0, c8)) as agg567, min_by_union(min_by_state(c1, c8)) as agg568, min_by_union(min_by_state(c2, c8)) as agg569, min_by_union(min_by_state(c3, c8)) as agg570, min_by_union(min_by_state(c4, c8)) as agg571, min_by_union(min_by_state(c5, c8)) as agg572, min_by_union(min_by_state(c6, c8)) as agg573, min_by_union(min_by_state(c7, c8)) as agg574, min_by_union(min_by_state(c8, c8)) as agg575, min_by_union(min_by_state(c8, c8)) as agg576, min_by_union(min_by_state(c8, c8)) as agg577, min_by_union(min_by_state(c24, c8)) as agg578, min_by_union(min_by_state(c10, c8)) as agg579, min_by_union(min_by_state(c11, c8)) as agg580, min_by_union(min_by_state(c25, c8)) as agg581, min_by_union(min_by_state(c0, c8)) as agg582, min_by_union(min_by_state(c1, c8)) as agg583, min_by_union(min_by_state(c2, c8)) as agg584, min_by_union(min_by_state(c3, c8)) as agg585, min_by_union(min_by_state(c4, c8)) as agg586, min_by_union(min_by_state(c5, c8)) as agg587, min_by_union(min_by_state(c6, c8)) as agg588, min_by_union(min_by_state(c7, c8)) as agg589, min_by_union(min_by_state(c8, c8)) as agg590, min_by_union(min_by_state(c8, c8)) as agg591, min_by_union(min_by_state(c8, c8)) as agg592, min_by_union(min_by_state(c24, c8)) as agg593, min_by_union(min_by_state(c10, c8)) as agg594, min_by_union(min_by_state(c11, c8)) as agg595, min_by_union(min_by_state(c25, c8)) as agg596, min_by_union(min_by_state(c0, c8)) as agg597, min_by_union(min_by_state(c1, c8)) as agg598, min_by_union(min_by_state(c2, c8)) as agg599, min_by_union(min_by_state(c3, c8)) as agg600, min_by_union(min_by_state(c4, c8)) as agg601, min_by_union(min_by_state(c5, c8)) as agg602, min_by_union(min_by_state(c6, c8)) as agg603, min_by_union(min_by_state(c7, c8)) as agg604, min_by_union(min_by_state(c8, c8)) as agg605, min_by_union(min_by_state(c8, c8)) as agg606, min_by_union(min_by_state(c8, c8)) as agg607, min_by_union(min_by_state(c24, c8)) as agg608, min_by_union(min_by_state(c10, c8)) as agg609, min_by_union(min_by_state(c11, c8)) as agg610, min_by_union(min_by_state(c25, c8)) as agg611, min_by_union(min_by_state(c0, c24)) as agg612, min_by_union(min_by_state(c1, c24)) as agg613, min_by_union(min_by_state(c2, c24)) as agg614, min_by_union(min_by_state(c3, c24)) as agg615, min_by_union(min_by_state(c4, c24)) as agg616, min_by_union(min_by_state(c5, c24)) as agg617, min_by_union(min_by_state(c6, c24)) as agg618, min_by_union(min_by_state(c7, c24)) as agg619, min_by_union(min_by_state(c8, c24)) as agg620, min_by_union(min_by_state(c8, c24)) as agg621, min_by_union(min_by_state(c8, c24)) as agg622, min_by_union(min_by_state(c24, c24)) as agg623, min_by_union(min_by_state(c10, c24)) as agg624, min_by_union(min_by_state(c11, c24)) as agg625, min_by_union(min_by_state(c25, c24)) as agg626, min_by_union(min_by_state(c0, c10)) as agg627, min_by_union(min_by_state(c1, c10)) as agg628, min_by_union(min_by_state(c2, c10)) as agg629, min_by_union(min_by_state(c3, c10)) as agg630, min_by_union(min_by_state(c4, c10)) as agg631, min_by_union(min_by_state(c5, c10)) as agg632, min_by_union(min_by_state(c6, c10)) as agg633, min_by_union(min_by_state(c7, c10)) as agg634, min_by_union(min_by_state(c8, c10)) as agg635, min_by_union(min_by_state(c8, c10)) as agg636, min_by_union(min_by_state(c8, c10)) as agg637, min_by_union(min_by_state(c24, c10)) as agg638, min_by_union(min_by_state(c10, c10)) as agg639, min_by_union(min_by_state(c11, c10)) as agg640, min_by_union(min_by_state(c25, c10)) as agg641, min_by_union(min_by_state(c0, c11)) as agg642, min_by_union(min_by_state(c1, c11)) as agg643, min_by_union(min_by_state(c2, c11)) as agg644, min_by_union(min_by_state(c3, c11)) as agg645, min_by_union(min_by_state(c4, c11)) as agg646, min_by_union(min_by_state(c5, c11)) as agg647, min_by_union(min_by_state(c6, c11)) as agg648, min_by_union(min_by_state(c7, c11)) as agg649, min_by_union(min_by_state(c8, c11)) as agg650, min_by_union(min_by_state(c8, c11)) as agg651, min_by_union(min_by_state(c8, c11)) as agg652, min_by_union(min_by_state(c24, c11)) as agg653, min_by_union(min_by_state(c10, c11)) as agg654, min_by_union(min_by_state(c11, c11)) as agg655, min_by_union(min_by_state(c25, c11)) as agg656, variance_pop_union(variance_pop_state(c6)) as agg657, variance_pop_union(variance_pop_state(c7)) as agg658, variance_pop_union(variance_pop_state(c0)) as agg659, variance_pop_union(variance_pop_state(c1)) as agg660, variance_pop_union(variance_pop_state(c2)) as agg661, variance_pop_union(variance_pop_state(c3)) as agg662, variance_pop_union(variance_pop_state(c4)) as agg663, variance_pop_union(variance_pop_state(c5)) as agg664, avg_union(avg_state(c6)) as agg665, avg_union(avg_state(c7)) as agg666, avg_union(avg_state(c1)) as agg667, avg_union(avg_state(c2)) as agg668, avg_union(avg_state(c3)) as agg669, avg_union(avg_state(c4)) as agg670, avg_union(avg_state(c5)) as agg671, avg_union(avg_state(c8)) as agg672, avg_union(avg_state(c8)) as agg673, avg_union(avg_state(c8)) as agg674, any_value_union(any_value_state(c0)) as agg675, any_value_union(any_value_state(c1)) as agg676, any_value_union(any_value_state(c2)) as agg677, any_value_union(any_value_state(c3)) as agg678, any_value_union(any_value_state(c4)) as agg679, any_value_union(any_value_state(c5)) as agg680, any_value_union(any_value_state(c6)) as agg681, any_value_union(any_value_state(c7)) as agg682, any_value_union(any_value_state(c8)) as agg683, any_value_union(any_value_state(c8)) as agg684, any_value_union(any_value_state(c8)) as agg685, any_value_union(any_value_state(c24)) as agg686, any_value_union(any_value_state(c10)) as agg687, any_value_union(any_value_state(c11)) as agg688, any_value_union(any_value_state(c16)) as agg689, any_value_union(any_value_state(c27)) as agg690, any_value_union(any_value_state(c28)) as agg691, any_value_union(any_value_state(c25)) as agg692, any_value_union(any_value_state(c26)) as agg693, var_pop_union(var_pop_state(c6)) as agg694, var_pop_union(var_pop_state(c7)) as agg695, var_pop_union(var_pop_state(c0)) as agg696, var_pop_union(var_pop_state(c1)) as agg697, var_pop_union(var_pop_state(c2)) as agg698, var_pop_union(var_pop_state(c3)) as agg699, var_pop_union(var_pop_state(c4)) as agg700, var_pop_union(var_pop_state(c5)) as agg701, stddev_pop_union(stddev_pop_state(c6)) as agg702, stddev_pop_union(stddev_pop_state(c7)) as agg703, stddev_pop_union(stddev_pop_state(c0)) as agg704, stddev_pop_union(stddev_pop_state(c1)) as agg705, stddev_pop_union(stddev_pop_state(c2)) as agg706, stddev_pop_union(stddev_pop_state(c3)) as agg707, stddev_pop_union(stddev_pop_state(c4)) as agg708, stddev_pop_union(stddev_pop_state(c5)) as agg709, variance_samp_union(variance_samp_state(c6)) as agg710, variance_samp_union(variance_samp_state(c7)) as agg711, variance_samp_union(variance_samp_state(c0)) as agg712, variance_samp_union(variance_samp_state(c1)) as agg713, variance_samp_union(variance_samp_state(c2)) as agg714, variance_samp_union(variance_samp_state(c3)) as agg715, variance_samp_union(variance_samp_state(c4)) as agg716, variance_samp_union(variance_samp_state(c5)) as agg717, percentile_cont_union(percentile_cont_state(c10, 0.5)) as agg718, percentile_cont_union(percentile_cont_state(c11, 0.5)) as agg719, percentile_cont_union(percentile_cont_state(c6, 0.5)) as agg720, corr_union(corr_state(c6, c6)) as agg721, corr_union(corr_state(c7, c7)) as agg722, corr_union(corr_state(c0, c0)) as agg723, corr_union(corr_state(c1, c1)) as agg724, corr_union(corr_state(c2, c2)) as agg725, corr_union(corr_state(c3, c3)) as agg726, corr_union(corr_state(c4, c4)) as agg727, corr_union(corr_state(c5, c5)) as agg728, multi_distinct_sum_union(multi_distinct_sum_state(c6)) as agg729, multi_distinct_sum_union(multi_distinct_sum_state(c7)) as agg730, multi_distinct_sum_union(multi_distinct_sum_state(c0)) as agg731, multi_distinct_sum_union(multi_distinct_sum_state(c1)) as agg732, multi_distinct_sum_union(multi_distinct_sum_state(c2)) as agg733, multi_distinct_sum_union(multi_distinct_sum_state(c3)) as agg734, multi_distinct_sum_union(multi_distinct_sum_state(c4)) as agg735, multi_distinct_sum_union(multi_distinct_sum_state(c5)) as agg736, multi_distinct_sum_union(multi_distinct_sum_state(c8)) as agg737, multi_distinct_sum_union(multi_distinct_sum_state(c8)) as agg738, multi_distinct_sum_union(multi_distinct_sum_state(c8)) as agg739, var_samp_union(var_samp_state(c6)) as agg740, var_samp_union(var_samp_state(c7)) as agg741, var_samp_union(var_samp_state(c0)) as agg742, var_samp_union(var_samp_state(c1)) as agg743, var_samp_union(var_samp_state(c2)) as agg744, var_samp_union(var_samp_state(c3)) as agg745, var_samp_union(var_samp_state(c4)) as agg746, var_samp_union(var_samp_state(c5)) as agg747, bitmap_union_int_union(bitmap_union_int_state(c1)) as agg748, bitmap_union_int_union(bitmap_union_int_state(c2)) as agg749, bitmap_union_int_union(bitmap_union_int_state(c3)) as agg750, bitmap_union_int_union(bitmap_union_int_state(c4)) as agg751, variance_union(variance_state(c6)) as agg752, variance_union(variance_state(c7)) as agg753, variance_union(variance_state(c0)) as agg754, variance_union(variance_state(c1)) as agg755, variance_union(variance_state(c2)) as agg756, variance_union(variance_state(c3)) as agg757, variance_union(variance_state(c4)) as agg758, variance_union(variance_state(c5)) as agg759 from t1 group by k1; function: wait_materialized_view_finish() +set new_planner_optimize_timeout=10000; select k1, percentile_approx(c6, 0.5) as agg14, percentile_approx(c6, 0.5) as agg15, covar_pop(c6, c6) as agg16, covar_pop(c7, c7) as agg17, covar_pop(c0, c0) as agg18, covar_pop(c1, c1) as agg19, covar_pop(c2, c2) as agg20, covar_pop(c3, c3) as agg21, covar_pop(c4, c4) as agg22, covar_pop(c5, c5) as agg23, count(c0) as agg24, count(c1) as agg25, count(c2) as agg26, count(c3) as agg27, count(c4) as agg28, count(c5) as agg29, count(c6) as agg30, count(c7) as agg31, count(c8) as agg32, count(c8) as agg33, count(c8) as agg34, count(c24) as agg35, count(c10) as agg36, count(c11) as agg37, count(c16) as agg38, count(c27) as agg39, count(c28) as agg40, count(c25) as agg41, count(c26) as agg42, array_unique_agg(c12) as agg43, array_unique_agg(c13) as agg44, array_unique_agg(c14) as agg45, array_unique_agg(c15) as agg46, array_unique_agg(c16) as agg47, array_unique_agg(c17) as agg48, array_unique_agg(c18) as agg49, array_unique_agg(c19) as agg50, array_unique_agg(c20) as agg51, array_unique_agg(c20) as agg52, array_unique_agg(c20) as agg53, array_unique_agg(c20) as agg54, array_unique_agg(c21) as agg55, array_unique_agg(c22) as agg56, array_unique_agg(c23) as agg57, percentile_disc(c0, 0.5) as agg58, percentile_disc(c1, 0.5) as agg59, percentile_disc(c2, 0.5) as agg60, percentile_disc(c3, 0.5) as agg61, percentile_disc(c4, 0.5) as agg62, percentile_disc(c5, 0.5) as agg63, percentile_disc(c8, 0.5) as agg64, percentile_disc(c8, 0.5) as agg65, percentile_disc(c8, 0.5) as agg66, percentile_disc(c9, 0.5) as agg67, percentile_disc(c10, 0.5) as agg68, percentile_disc(c11, 0.5) as agg69, percentile_disc(c6, 0.5) as agg70, percentile_disc(c7, 0.5) as agg71, multi_distinct_count(c0) as agg72, multi_distinct_count(c1) as agg73, multi_distinct_count(c2) as agg74, multi_distinct_count(c3) as agg75, multi_distinct_count(c4) as agg76, multi_distinct_count(c5) as agg77, multi_distinct_count(c6) as agg78, multi_distinct_count(c7) as agg79, multi_distinct_count(c8) as agg80, multi_distinct_count(c8) as agg81, multi_distinct_count(c8) as agg82, multi_distinct_count(c9) as agg83, multi_distinct_count(c10) as agg84, multi_distinct_count(c11) as agg85, array_agg(c24) as agg86, stddev_samp(c6) as agg87, stddev_samp(c7) as agg88, stddev_samp(c0) as agg89, stddev_samp(c1) as agg90, stddev_samp(c2) as agg91, stddev_samp(c3) as agg92, stddev_samp(c4) as agg93, stddev_samp(c5) as agg94, mann_whitney_u_test(c6, c0, 'two-sided', 0) as agg95, mann_whitney_u_test(c6, c0, 'less') as agg96, mann_whitney_u_test(c6, c0, 'two-sided', 0) as agg97, max(c0) as agg98, max(c1) as agg99, max(c2) as agg100, max(c3) as agg101, max(c4) as agg102, max(c5) as agg103, max(c6) as agg104, max(c7) as agg105, max(c8) as agg106, max(c8) as agg107, max(c8) as agg108, max(c24) as agg109, max(c10) as agg110, max(c11) as agg111, ds_hll_count_distinct(c0, 18, 'hll_6') as agg112, ds_hll_count_distinct(c0, 18) as agg113, ds_hll_count_distinct(c0, 18, 'hll_6') as agg114, ds_hll_count_distinct(c1, 18, 'hll_6') as agg115, ds_hll_count_distinct(c1, 18) as agg116, ds_hll_count_distinct(c1, 18, 'hll_6') as agg117, ds_hll_count_distinct(c2, 18, 'hll_6') as agg118, ds_hll_count_distinct(c2, 18) as agg119, ds_hll_count_distinct(c2, 18, 'hll_6') as agg120, ds_hll_count_distinct(c3, 18, 'hll_6') as agg121, ds_hll_count_distinct(c3, 18) as agg122, ds_hll_count_distinct(c3, 18, 'hll_6') as agg123, ds_hll_count_distinct(c4, 18, 'hll_6') as agg124, ds_hll_count_distinct(c4, 18) as agg125, ds_hll_count_distinct(c4, 18, 'hll_6') as agg126, ds_hll_count_distinct(c5, 18, 'hll_6') as agg127, ds_hll_count_distinct(c5, 18) as agg128, ds_hll_count_distinct(c5, 18, 'hll_6') as agg129, ds_hll_count_distinct(c6, 18, 'hll_6') as agg130, ds_hll_count_distinct(c6, 18) as agg131, ds_hll_count_distinct(c6, 18, 'hll_6') as agg132, ds_hll_count_distinct(c7, 18, 'hll_6') as agg133, ds_hll_count_distinct(c7, 18) as agg134, ds_hll_count_distinct(c7, 18, 'hll_6') as agg135, ds_hll_count_distinct(c8, 18, 'hll_6') as agg136, ds_hll_count_distinct(c8, 18) as agg137, ds_hll_count_distinct(c8, 18, 'hll_6') as agg138, ds_hll_count_distinct(c8, 18, 'hll_6') as agg139, ds_hll_count_distinct(c8, 18) as agg140, ds_hll_count_distinct(c8, 18, 'hll_6') as agg141, ds_hll_count_distinct(c8, 18, 'hll_6') as agg142, ds_hll_count_distinct(c8, 18) as agg143, ds_hll_count_distinct(c8, 18, 'hll_6') as agg144, ds_hll_count_distinct(c24, 18, 'hll_6') as agg145, ds_hll_count_distinct(c24, 18) as agg146, ds_hll_count_distinct(c24, 18, 'hll_6') as agg147, ds_hll_count_distinct(c10, 18, 'hll_6') as agg148, ds_hll_count_distinct(c10, 18) as agg149, ds_hll_count_distinct(c10, 18, 'hll_6') as agg150, ds_hll_count_distinct(c11, 18, 'hll_6') as agg151, ds_hll_count_distinct(c11, 18) as agg152, ds_hll_count_distinct(c11, 18, 'hll_6') as agg153, ndv(c0) as agg154, ndv(c1) as agg155, ndv(c2) as agg156, ndv(c3) as agg157, ndv(c4) as agg158, ndv(c5) as agg159, ndv(c6) as agg160, ndv(c7) as agg161, ndv(c8) as agg162, ndv(c8) as agg163, ndv(c8) as agg164, ndv(c24) as agg165, ndv(c10) as agg166, ndv(c11) as agg167, stddev(c6) as agg168, stddev(c7) as agg169, stddev(c0) as agg170, stddev(c1) as agg171, stddev(c2) as agg172, stddev(c3) as agg173, stddev(c4) as agg174, stddev(c5) as agg175, covar_samp(c6, c6) as agg176, covar_samp(c7, c7) as agg177, covar_samp(c0, c0) as agg178, covar_samp(c1, c1) as agg179, covar_samp(c2, c2) as agg180, covar_samp(c3, c3) as agg181, covar_samp(c4, c4) as agg182, covar_samp(c5, c5) as agg183, bitmap_agg(c4) as agg184, bitmap_agg(c5) as agg185, bitmap_agg(c3) as agg186, bitmap_agg(c2) as agg187, bitmap_agg(c1) as agg188, bitmap_agg(c0) as agg189, std(c6) as agg190, std(c7) as agg191, std(c0) as agg192, std(c1) as agg193, std(c2) as agg194, std(c3) as agg195, std(c4) as agg196, std(c5) as agg197, sum(c6) as agg198, sum(c7) as agg199, sum(c1) as agg200, sum(c2) as agg201, sum(c3) as agg202, sum(c4) as agg203, sum(c5) as agg204, sum(c8) as agg205, sum(c8) as agg206, sum(c8) as agg207, approx_count_distinct(c0) as agg208, approx_count_distinct(c1) as agg209, approx_count_distinct(c2) as agg210, approx_count_distinct(c3) as agg211, approx_count_distinct(c4) as agg212, approx_count_distinct(c5) as agg213, approx_count_distinct(c6) as agg214, approx_count_distinct(c7) as agg215, approx_count_distinct(c8) as agg216, approx_count_distinct(c8) as agg217, approx_count_distinct(c8) as agg218, approx_count_distinct(c24) as agg219, approx_count_distinct(c10) as agg220, approx_count_distinct(c11) as agg221, min(c0) as agg222, min(c1) as agg223, min(c2) as agg224, min(c3) as agg225, min(c4) as agg226, min(c5) as agg227, min(c6) as agg228, min(c7) as agg229, min(c8) as agg230, min(c8) as agg231, min(c8) as agg232, min(c24) as agg233, min(c10) as agg234, min(c11) as agg235, retention(c12) as agg236, max_by(c0, c0) as agg237, max_by(c1, c0) as agg238, max_by(c2, c0) as agg239, max_by(c3, c0) as agg240, max_by(c4, c0) as agg241, max_by(c5, c0) as agg242, max_by(c6, c0) as agg243, max_by(c7, c0) as agg244, max_by(c8, c0) as agg245, max_by(c8, c0) as agg246, max_by(c8, c0) as agg247, max_by(c24, c0) as agg248, max_by(c10, c0) as agg249, max_by(c11, c0) as agg250, max_by(c25, c0) as agg251, max_by(c0, c1) as agg252, max_by(c1, c1) as agg253, max_by(c2, c1) as agg254, max_by(c3, c1) as agg255, max_by(c4, c1) as agg256, max_by(c5, c1) as agg257, max_by(c6, c1) as agg258, max_by(c7, c1) as agg259, max_by(c8, c1) as agg260, max_by(c8, c1) as agg261, max_by(c8, c1) as agg262, max_by(c24, c1) as agg263, max_by(c10, c1) as agg264, max_by(c11, c1) as agg265, max_by(c25, c1) as agg266, max_by(c0, c2) as agg267, max_by(c1, c2) as agg268, max_by(c2, c2) as agg269, max_by(c3, c2) as agg270, max_by(c4, c2) as agg271, max_by(c5, c2) as agg272, max_by(c6, c2) as agg273, max_by(c7, c2) as agg274, max_by(c8, c2) as agg275, max_by(c8, c2) as agg276, max_by(c8, c2) as agg277, max_by(c24, c2) as agg278, max_by(c10, c2) as agg279, max_by(c11, c2) as agg280, max_by(c25, c2) as agg281, max_by(c0, c3) as agg282, max_by(c1, c3) as agg283, max_by(c2, c3) as agg284, max_by(c3, c3) as agg285, max_by(c4, c3) as agg286, max_by(c5, c3) as agg287, max_by(c6, c3) as agg288, max_by(c7, c3) as agg289, max_by(c8, c3) as agg290, max_by(c8, c3) as agg291, max_by(c8, c3) as agg292, max_by(c24, c3) as agg293, max_by(c10, c3) as agg294, max_by(c11, c3) as agg295, max_by(c25, c3) as agg296, max_by(c0, c4) as agg297, max_by(c1, c4) as agg298, max_by(c2, c4) as agg299, max_by(c3, c4) as agg300, max_by(c4, c4) as agg301, max_by(c5, c4) as agg302, max_by(c6, c4) as agg303, max_by(c7, c4) as agg304, max_by(c8, c4) as agg305, max_by(c8, c4) as agg306, max_by(c8, c4) as agg307, max_by(c24, c4) as agg308, max_by(c10, c4) as agg309, max_by(c11, c4) as agg310, max_by(c25, c4) as agg311, max_by(c0, c5) as agg312, max_by(c1, c5) as agg313, max_by(c2, c5) as agg314, max_by(c3, c5) as agg315, max_by(c4, c5) as agg316, max_by(c5, c5) as agg317, max_by(c6, c5) as agg318, max_by(c7, c5) as agg319, max_by(c8, c5) as agg320, max_by(c8, c5) as agg321, max_by(c8, c5) as agg322, max_by(c24, c5) as agg323, max_by(c10, c5) as agg324, max_by(c11, c5) as agg325, max_by(c25, c5) as agg326, max_by(c0, c6) as agg327, max_by(c1, c6) as agg328, max_by(c2, c6) as agg329, max_by(c3, c6) as agg330, max_by(c4, c6) as agg331, max_by(c5, c6) as agg332, max_by(c6, c6) as agg333, max_by(c7, c6) as agg334, max_by(c8, c6) as agg335, max_by(c8, c6) as agg336, max_by(c8, c6) as agg337, max_by(c24, c6) as agg338, max_by(c10, c6) as agg339, max_by(c11, c6) as agg340, max_by(c25, c6) as agg341, max_by(c0, c7) as agg342, max_by(c1, c7) as agg343, max_by(c2, c7) as agg344, max_by(c3, c7) as agg345, max_by(c4, c7) as agg346, max_by(c5, c7) as agg347, max_by(c6, c7) as agg348, max_by(c7, c7) as agg349, max_by(c8, c7) as agg350, max_by(c8, c7) as agg351, max_by(c8, c7) as agg352, max_by(c24, c7) as agg353, max_by(c10, c7) as agg354, max_by(c11, c7) as agg355, max_by(c25, c7) as agg356, max_by(c0, c8) as agg357, max_by(c1, c8) as agg358, max_by(c2, c8) as agg359, max_by(c3, c8) as agg360, max_by(c4, c8) as agg361, max_by(c5, c8) as agg362, max_by(c6, c8) as agg363, max_by(c7, c8) as agg364, max_by(c8, c8) as agg365, max_by(c8, c8) as agg366, max_by(c8, c8) as agg367, max_by(c24, c8) as agg368, max_by(c10, c8) as agg369, max_by(c11, c8) as agg370, max_by(c25, c8) as agg371, max_by(c0, c8) as agg372, max_by(c1, c8) as agg373, max_by(c2, c8) as agg374, max_by(c3, c8) as agg375, max_by(c4, c8) as agg376, max_by(c5, c8) as agg377, max_by(c6, c8) as agg378, max_by(c7, c8) as agg379, max_by(c8, c8) as agg380, max_by(c8, c8) as agg381, max_by(c8, c8) as agg382, max_by(c24, c8) as agg383, max_by(c10, c8) as agg384, max_by(c11, c8) as agg385, max_by(c25, c8) as agg386, max_by(c0, c8) as agg387, max_by(c1, c8) as agg388, max_by(c2, c8) as agg389, max_by(c3, c8) as agg390, max_by(c4, c8) as agg391, max_by(c5, c8) as agg392, max_by(c6, c8) as agg393, max_by(c7, c8) as agg394, max_by(c8, c8) as agg395, max_by(c8, c8) as agg396, max_by(c8, c8) as agg397, max_by(c24, c8) as agg398, max_by(c10, c8) as agg399, max_by(c11, c8) as agg400, max_by(c25, c8) as agg401, max_by(c0, c24) as agg402, max_by(c1, c24) as agg403, max_by(c2, c24) as agg404, max_by(c3, c24) as agg405, max_by(c4, c24) as agg406, max_by(c5, c24) as agg407, max_by(c6, c24) as agg408, max_by(c7, c24) as agg409, max_by(c8, c24) as agg410, max_by(c8, c24) as agg411, max_by(c8, c24) as agg412, max_by(c24, c24) as agg413, max_by(c10, c24) as agg414, max_by(c11, c24) as agg415, max_by(c25, c24) as agg416, max_by(c0, c10) as agg417, max_by(c1, c10) as agg418, max_by(c2, c10) as agg419, max_by(c3, c10) as agg420, max_by(c4, c10) as agg421, max_by(c5, c10) as agg422, max_by(c6, c10) as agg423, max_by(c7, c10) as agg424, max_by(c8, c10) as agg425, max_by(c8, c10) as agg426, max_by(c8, c10) as agg427, max_by(c24, c10) as agg428, max_by(c10, c10) as agg429, max_by(c11, c10) as agg430, max_by(c25, c10) as agg431, max_by(c0, c11) as agg432, max_by(c1, c11) as agg433, max_by(c2, c11) as agg434, max_by(c3, c11) as agg435, max_by(c4, c11) as agg436, max_by(c5, c11) as agg437, max_by(c6, c11) as agg438, max_by(c7, c11) as agg439, max_by(c8, c11) as agg440, max_by(c8, c11) as agg441, max_by(c8, c11) as agg442, max_by(c24, c11) as agg443, max_by(c10, c11) as agg444, max_by(c11, c11) as agg445, max_by(c25, c11) as agg446, min_by(c0, c0) as agg447, min_by(c1, c0) as agg448, min_by(c2, c0) as agg449, min_by(c3, c0) as agg450, min_by(c4, c0) as agg451, min_by(c5, c0) as agg452, min_by(c6, c0) as agg453, min_by(c7, c0) as agg454, min_by(c8, c0) as agg455, min_by(c8, c0) as agg456, min_by(c8, c0) as agg457, min_by(c24, c0) as agg458, min_by(c10, c0) as agg459, min_by(c11, c0) as agg460, min_by(c25, c0) as agg461, min_by(c0, c1) as agg462, min_by(c1, c1) as agg463, min_by(c2, c1) as agg464, min_by(c3, c1) as agg465, min_by(c4, c1) as agg466, min_by(c5, c1) as agg467, min_by(c6, c1) as agg468, min_by(c7, c1) as agg469, min_by(c8, c1) as agg470, min_by(c8, c1) as agg471, min_by(c8, c1) as agg472, min_by(c24, c1) as agg473, min_by(c10, c1) as agg474, min_by(c11, c1) as agg475, min_by(c25, c1) as agg476, min_by(c0, c2) as agg477, min_by(c1, c2) as agg478, min_by(c2, c2) as agg479, min_by(c3, c2) as agg480, min_by(c4, c2) as agg481, min_by(c5, c2) as agg482, min_by(c6, c2) as agg483, min_by(c7, c2) as agg484, min_by(c8, c2) as agg485, min_by(c8, c2) as agg486, min_by(c8, c2) as agg487, min_by(c24, c2) as agg488, min_by(c10, c2) as agg489, min_by(c11, c2) as agg490, min_by(c25, c2) as agg491, min_by(c0, c3) as agg492, min_by(c1, c3) as agg493, min_by(c2, c3) as agg494, min_by(c3, c3) as agg495, min_by(c4, c3) as agg496, min_by(c5, c3) as agg497, min_by(c6, c3) as agg498, min_by(c7, c3) as agg499, min_by(c8, c3) as agg500, min_by(c8, c3) as agg501, min_by(c8, c3) as agg502, min_by(c24, c3) as agg503, min_by(c10, c3) as agg504, min_by(c11, c3) as agg505, min_by(c25, c3) as agg506, min_by(c0, c4) as agg507, min_by(c1, c4) as agg508, min_by(c2, c4) as agg509, min_by(c3, c4) as agg510, min_by(c4, c4) as agg511, min_by(c5, c4) as agg512, min_by(c6, c4) as agg513, min_by(c7, c4) as agg514, min_by(c8, c4) as agg515, min_by(c8, c4) as agg516, min_by(c8, c4) as agg517, min_by(c24, c4) as agg518, min_by(c10, c4) as agg519, min_by(c11, c4) as agg520, min_by(c25, c4) as agg521, min_by(c0, c5) as agg522, min_by(c1, c5) as agg523, min_by(c2, c5) as agg524, min_by(c3, c5) as agg525, min_by(c4, c5) as agg526, min_by(c5, c5) as agg527, min_by(c6, c5) as agg528, min_by(c7, c5) as agg529, min_by(c8, c5) as agg530, min_by(c8, c5) as agg531, min_by(c8, c5) as agg532, min_by(c24, c5) as agg533, min_by(c10, c5) as agg534, min_by(c11, c5) as agg535, min_by(c25, c5) as agg536, min_by(c0, c6) as agg537, min_by(c1, c6) as agg538, min_by(c2, c6) as agg539, min_by(c3, c6) as agg540, min_by(c4, c6) as agg541, min_by(c5, c6) as agg542, min_by(c6, c6) as agg543, min_by(c7, c6) as agg544, min_by(c8, c6) as agg545, min_by(c8, c6) as agg546, min_by(c8, c6) as agg547, min_by(c24, c6) as agg548, min_by(c10, c6) as agg549, min_by(c11, c6) as agg550, min_by(c25, c6) as agg551, min_by(c0, c7) as agg552, min_by(c1, c7) as agg553, min_by(c2, c7) as agg554, min_by(c3, c7) as agg555, min_by(c4, c7) as agg556, min_by(c5, c7) as agg557, min_by(c6, c7) as agg558, min_by(c7, c7) as agg559, min_by(c8, c7) as agg560, min_by(c8, c7) as agg561, min_by(c8, c7) as agg562, min_by(c24, c7) as agg563, min_by(c10, c7) as agg564, min_by(c11, c7) as agg565, min_by(c25, c7) as agg566, min_by(c0, c8) as agg567, min_by(c1, c8) as agg568, min_by(c2, c8) as agg569, min_by(c3, c8) as agg570, min_by(c4, c8) as agg571, min_by(c5, c8) as agg572, min_by(c6, c8) as agg573, min_by(c7, c8) as agg574, min_by(c8, c8) as agg575, min_by(c8, c8) as agg576, min_by(c8, c8) as agg577, min_by(c24, c8) as agg578, min_by(c10, c8) as agg579, min_by(c11, c8) as agg580, min_by(c25, c8) as agg581, min_by(c0, c8) as agg582, min_by(c1, c8) as agg583, min_by(c2, c8) as agg584, min_by(c3, c8) as agg585, min_by(c4, c8) as agg586, min_by(c5, c8) as agg587, min_by(c6, c8) as agg588, min_by(c7, c8) as agg589, min_by(c8, c8) as agg590, min_by(c8, c8) as agg591, min_by(c8, c8) as agg592, min_by(c24, c8) as agg593, min_by(c10, c8) as agg594, min_by(c11, c8) as agg595, min_by(c25, c8) as agg596, min_by(c0, c8) as agg597, min_by(c1, c8) as agg598, min_by(c2, c8) as agg599, min_by(c3, c8) as agg600, min_by(c4, c8) as agg601, min_by(c5, c8) as agg602, min_by(c6, c8) as agg603, min_by(c7, c8) as agg604, min_by(c8, c8) as agg605, min_by(c8, c8) as agg606, min_by(c8, c8) as agg607, min_by(c24, c8) as agg608, min_by(c10, c8) as agg609, min_by(c11, c8) as agg610, min_by(c25, c8) as agg611, min_by(c0, c24) as agg612, min_by(c1, c24) as agg613, min_by(c2, c24) as agg614, min_by(c3, c24) as agg615, min_by(c4, c24) as agg616, min_by(c5, c24) as agg617, min_by(c6, c24) as agg618, min_by(c7, c24) as agg619, min_by(c8, c24) as agg620, min_by(c8, c24) as agg621, min_by(c8, c24) as agg622, min_by(c24, c24) as agg623, min_by(c10, c24) as agg624, min_by(c11, c24) as agg625, min_by(c25, c24) as agg626, min_by(c0, c10) as agg627, min_by(c1, c10) as agg628, min_by(c2, c10) as agg629, min_by(c3, c10) as agg630, min_by(c4, c10) as agg631, min_by(c5, c10) as agg632, min_by(c6, c10) as agg633, min_by(c7, c10) as agg634, min_by(c8, c10) as agg635, min_by(c8, c10) as agg636, min_by(c8, c10) as agg637, min_by(c24, c10) as agg638, min_by(c10, c10) as agg639, min_by(c11, c10) as agg640, min_by(c25, c10) as agg641, min_by(c0, c11) as agg642, min_by(c1, c11) as agg643, min_by(c2, c11) as agg644, min_by(c3, c11) as agg645, min_by(c4, c11) as agg646, min_by(c5, c11) as agg647, min_by(c6, c11) as agg648, min_by(c7, c11) as agg649, min_by(c8, c11) as agg650, min_by(c8, c11) as agg651, min_by(c8, c11) as agg652, min_by(c24, c11) as agg653, min_by(c10, c11) as agg654, min_by(c11, c11) as agg655, min_by(c25, c11) as agg656, variance_pop(c6) as agg657, variance_pop(c7) as agg658, variance_pop(c0) as agg659, variance_pop(c1) as agg660, variance_pop(c2) as agg661, variance_pop(c3) as agg662, variance_pop(c4) as agg663, variance_pop(c5) as agg664, avg(c6) as agg665, avg(c7) as agg666, avg(c1) as agg667, avg(c2) as agg668, avg(c3) as agg669, avg(c4) as agg670, avg(c5) as agg671, avg(c8) as agg672, avg(c8) as agg673, avg(c8) as agg674, any_value(c0) as agg675, any_value(c1) as agg676, any_value(c2) as agg677, any_value(c3) as agg678, any_value(c4) as agg679, any_value(c5) as agg680, any_value(c6) as agg681, any_value(c7) as agg682, any_value(c8) as agg683, any_value(c8) as agg684, any_value(c8) as agg685, any_value(c24) as agg686, any_value(c10) as agg687, any_value(c11) as agg688, any_value(c16) as agg689, any_value(c27) as agg690, any_value(c28) as agg691, any_value(c25) as agg692, any_value(c26) as agg693, var_pop(c6) as agg694, var_pop(c7) as agg695, var_pop(c0) as agg696, var_pop(c1) as agg697, var_pop(c2) as agg698, var_pop(c3) as agg699, var_pop(c4) as agg700, var_pop(c5) as agg701, stddev_pop(c6) as agg702, stddev_pop(c7) as agg703, stddev_pop(c0) as agg704, stddev_pop(c1) as agg705, stddev_pop(c2) as agg706, stddev_pop(c3) as agg707, stddev_pop(c4) as agg708, stddev_pop(c5) as agg709, variance_samp(c6) as agg710, variance_samp(c7) as agg711, variance_samp(c0) as agg712, variance_samp(c1) as agg713, variance_samp(c2) as agg714, variance_samp(c3) as agg715, variance_samp(c4) as agg716, variance_samp(c5) as agg717, percentile_cont(c10, 0.5) as agg718, percentile_cont(c11, 0.5) as agg719, percentile_cont(c6, 0.5) as agg720, corr(c6, c6) as agg721, corr(c7, c7) as agg722, corr(c0, c0) as agg723, corr(c1, c1) as agg724, corr(c2, c2) as agg725, corr(c3, c3) as agg726, corr(c4, c4) as agg727, corr(c5, c5) as agg728, multi_distinct_sum(c6) as agg729, multi_distinct_sum(c7) as agg730, multi_distinct_sum(c0) as agg731, multi_distinct_sum(c1) as agg732, multi_distinct_sum(c2) as agg733, multi_distinct_sum(c3) as agg734, multi_distinct_sum(c4) as agg735, multi_distinct_sum(c5) as agg736, multi_distinct_sum(c8) as agg737, multi_distinct_sum(c8) as agg738, multi_distinct_sum(c8) as agg739, var_samp(c6) as agg740, var_samp(c7) as agg741, var_samp(c0) as agg742, var_samp(c1) as agg743, var_samp(c2) as agg744, var_samp(c3) as agg745, var_samp(c4) as agg746, var_samp(c5) as agg747, bitmap_union_int(c1) as agg748, bitmap_union_int(c2) as agg749, bitmap_union_int(c3) as agg750, bitmap_union_int(c4) as agg751, variance(c6) as agg752, variance(c7) as agg753, variance(c0) as agg754, variance(c1) as agg755, variance(c2) as agg756, variance(c3) as agg757, variance(c4) as agg758, variance(c5) as agg759 from t1 group by k1;