From 732194d00a219b45136dfdd70078e94c9091bb32 Mon Sep 17 00:00:00 2001 From: lihangyu <15605149486@163.com> Date: Mon, 29 Jan 2024 10:10:43 +0800 Subject: [PATCH] [Improve)(Variant) do not allow fall back to legacy planner (#30430) --- .../java/org/apache/doris/common/Config.java | 3 + .../org/apache/doris/analysis/Analyzer.java | 5 ++ .../doris/nereids/StatementContext.java | 5 +- .../glue/translator/ExpressionTranslator.java | 1 + .../post/PushDownFilterThroughProject.java | 2 +- .../nereids/processor/post/Validator.java | 2 +- .../apache/doris/nereids/rules/RuleType.java | 3 +- .../rules/analysis/CheckAfterRewrite.java | 2 +- .../rules/rewrite/PullUpProjectUnderTopN.java | 1 + .../rewrite/PushDownFilterThroughProject.java | 4 +- .../scalar/PushDownToProjectionFunction.java | 15 +++- .../nereids/trees/plans/algebra/Project.java | 3 +- .../doris/nereids/types/VariantType.java | 2 +- .../data/variant_p0/column_name.out | 2 +- .../affinityByIssuesAndPRs1.sql | 16 ++-- .../affinityByIssuesAndPRs2.sql | 16 ++-- .../authorsWithTheMostPushes.sql | 8 +- .../countingStar1.sql | 2 +- .../countingStar2.sql | 2 +- .../countingStar3.sql | 2 +- .../distributionOfRepositoriesByStarCount.sql | 6 +- .../githubRoulette.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears1.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears2.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears3.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears4.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears5.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears6.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears7.sql | 6 +- ...asTheTotalNumberOfStarsChangedOverTime.sql | 2 +- .../issuesWithTheMostComments1.sql | 2 +- .../issuesWithTheMostComments2.sql | 2 +- .../issuesWithTheMostComments3.sql | 8 +- .../issuesWithTheMostComments4.sql | 8 +- .../issuesWithTheMostComments5.sql | 10 +-- .../issuesWithTheMostComments6.sql | 12 +-- .../issuesWithTheMostComments7.sql | 8 +- .../issuesWithTheMostComments8.sql | 10 +-- .../variant_github_events_p0/load.groovy | 2 +- .../mostForkedRepositories.sql | 2 +- .../mostPopularCommentsOnGithub.sql | 2 +- ...organizationsByTheNumberOfRepositories.sql | 6 +- .../organizationsByTheNumberOfStars.sql | 4 +- .../organizationsByTheSizeOfCommunity.sql | 20 ++--- .../proportionsBetweenStarsAndForks1.sql | 8 +- .../proportionsBetweenStarsAndForks2.sql | 8 +- .../proportionsBetweenStarsAndForks3.sql | 8 +- .../proportionsBetweenStarsAndForks4.sql | 8 +- .../proportionsBetweenStarsAndForks5.sql | 8 +- .../repositoriesByAmountOfModifiedCode.sql | 12 +-- .../repositoriesByTheNumberOfPushes.sql | 16 ++-- ...toriesWithClickhouse_related_comments1.sql | 2 +- ...toriesWithClickhouse_related_comments2.sql | 8 +- ...epositoriesWithDoris_related_comments1.sql | 2 +- ...epositoriesWithDoris_related_comments2.sql | 8 +- .../repositoriesWithTheHighestGrowthYoY.sql | 10 +-- ...ositoriesWithTheMaximumAmountOfIssues1.sql | 2 +- ...ositoriesWithTheMaximumAmountOfIssues2.sql | 10 +-- ...ositoriesWithTheMaximumAmountOfIssues3.sql | 10 +-- ...ositoriesWithTheMaximumAmountOfIssues4.sql | 10 +-- ...iesWithTheMaximumAmountOfPullRequests1.sql | 2 +- ...iesWithTheMaximumAmountOfPullRequests2.sql | 2 +- ...hTheMaximumNumberOfAcceptedInvitations.sql | 8 +- ...iesWithTheMostPeopleWhoHavePushAccess1.sql | 8 +- ...iesWithTheMostPeopleWhoHavePushAccess2.sql | 14 ++-- ...iesWithTheMostPeopleWhoHavePushAccess3.sql | 14 ++-- ...epositoriesWithTheMostStarsOverOneDay1.sql | 8 +- ...epositoriesWithTheMostStarsOverOneDay2.sql | 14 ++-- ...epositoriesWithTheMostStarsOverOneDay3.sql | 2 +- ...itoriesWithTheMostSteadyGrowthOverTime.sql | 6 +- ...positoriesWithTheWorstStagnation_order.sql | 10 +-- .../repositoryAffinityList1.sql | 10 +-- .../repositoryAffinityList2.sql | 10 +-- .../starsFromHeavyGithubUsers1.sql | 12 +-- .../starsFromHeavyGithubUsers2.sql | 12 +-- .../theLongestRepositoryNames1.sql | 2 +- .../theLongestRepositoryNames2.sql | 2 +- .../theMostToughCodeReviews.sql | 10 +-- .../theTotalNumberOfRepositoriesOnGithub.sql | 2 +- .../theTotalNumberOfUsersOnGithub1.sql | 2 +- .../theTotalNumberOfUsersOnGithub2.sql | 2 +- .../theTotalNumberOfUsersOnGithub3.sql | 2 +- .../theTotalNumberOfUsersOnGithub4.sql | 2 +- .../variant_github_events_p0/topLabels1.sql | 2 +- .../variant_github_events_p0/topLabels2.sql | 2 +- .../variant_github_events_p0/topLabels3.sql | 2 +- .../topRepositoriesByStars.sql | 2 +- .../whatIsTheBestDayOfTheWeekToCatchAStar.sql | 2 +- .../whoAreAllThosePeopleGivingStars1.sql | 2 +- .../whoAreAllThosePeopleGivingStars2.sql | 2 +- .../whoAreAllThosePeopleGivingStars3.sql | 12 +-- .../sql/affinityByIssuesAndPRs1.sql | 2 +- .../sql/affinityByIssuesAndPRs2.sql | 2 +- .../sql/authorsWithTheMostPushes.sql | 2 +- .../sql/countingStar1.sql | 2 +- .../sql/countingStar2.sql | 2 +- .../sql/countingStar3.sql | 2 +- .../distributionOfRepositoriesByStarCount.sql | 2 +- .../sql/githubRoulette.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears1.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears2.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears3.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears4.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears5.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears6.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears7.sql | 2 +- ...asTheTotalNumberOfStarsChangedOverTime.sql | 2 +- .../sql/issuesWithTheMostComments1.sql | 2 +- .../sql/issuesWithTheMostComments2.sql | 2 +- .../sql/issuesWithTheMostComments3.sql | 2 +- .../sql/issuesWithTheMostComments4.sql | 2 +- .../sql/issuesWithTheMostComments5.sql | 2 +- .../sql/issuesWithTheMostComments6.sql | 2 +- .../sql/issuesWithTheMostComments7.sql | 2 +- .../sql/issuesWithTheMostComments8.sql | 2 +- .../sql/mostForkedRepositories.sql | 2 +- .../sql/mostPopularCommentsOnGithub.sql | 2 +- ...organizationsByTheNumberOfRepositories.sql | 2 +- .../sql/organizationsByTheNumberOfStars.sql | 2 +- .../sql/organizationsByTheSizeOfCommunity.sql | 2 +- .../sql/proportionsBetweenStarsAndForks1.sql | 2 +- .../sql/proportionsBetweenStarsAndForks2.sql | 2 +- .../sql/proportionsBetweenStarsAndForks3.sql | 2 +- .../sql/proportionsBetweenStarsAndForks4.sql | 2 +- .../sql/proportionsBetweenStarsAndForks5.sql | 2 +- .../repositoriesByAmountOfModifiedCode.sql | 2 +- .../sql/repositoriesByTheNumberOfPushes.sql | 2 +- ...toriesWithClickhouse_related_comments1.sql | 2 +- ...toriesWithClickhouse_related_comments2.sql | 2 +- ...epositoriesWithDoris_related_comments1.sql | 2 +- ...epositoriesWithDoris_related_comments2.sql | 2 +- .../repositoriesWithTheHighestGrowthYoY.sql | 2 +- ...ositoriesWithTheMaximumAmountOfIssues1.sql | 2 +- ...ositoriesWithTheMaximumAmountOfIssues2.sql | 2 +- ...ositoriesWithTheMaximumAmountOfIssues3.sql | 2 +- ...ositoriesWithTheMaximumAmountOfIssues4.sql | 2 +- ...iesWithTheMaximumAmountOfPullRequests1.sql | 2 +- ...iesWithTheMaximumAmountOfPullRequests2.sql | 2 +- ...hTheMaximumNumberOfAcceptedInvitations.sql | 2 +- ...iesWithTheMostPeopleWhoHavePushAccess1.sql | 2 +- ...iesWithTheMostPeopleWhoHavePushAccess2.sql | 2 +- ...iesWithTheMostPeopleWhoHavePushAccess3.sql | 2 +- ...epositoriesWithTheMostStarsOverOneDay1.sql | 2 +- ...epositoriesWithTheMostStarsOverOneDay2.sql | 2 +- ...epositoriesWithTheMostStarsOverOneDay3.sql | 2 +- ...itoriesWithTheMostSteadyGrowthOverTime.sql | 2 +- ...positoriesWithTheWorstStagnation_order.sql | 2 +- .../sql/repositoryAffinityList1.sql | 2 +- .../sql/repositoryAffinityList2.sql | 2 +- .../sql/starsFromHeavyGithubUsers1.sql | 2 +- .../sql/starsFromHeavyGithubUsers2.sql | 2 +- .../sql/theLongestRepositoryNames1.sql | 2 +- .../sql/theLongestRepositoryNames2.sql | 2 +- .../sql/theMostToughCodeReviews.sql | 2 +- .../theTotalNumberOfRepositoriesOnGithub.sql | 2 +- .../sql/theTotalNumberOfUsersOnGithub1.sql | 2 +- .../sql/theTotalNumberOfUsersOnGithub2.sql | 2 +- .../sql/theTotalNumberOfUsersOnGithub3.sql | 2 +- .../sql/theTotalNumberOfUsersOnGithub4.sql | 2 +- .../sql/topLabels1.sql | 2 +- .../sql/topLabels2.sql | 2 +- .../sql/topLabels3.sql | 2 +- .../sql/topRepositoriesByStars.sql | 2 +- .../whatIsTheBestDayOfTheWeekToCatchAStar.sql | 2 +- .../sql/whoAreAllThosePeopleGivingStars1.sql | 2 +- .../sql/whoAreAllThosePeopleGivingStars2.sql | 2 +- .../sql/whoAreAllThosePeopleGivingStars3.sql | 2 +- .../suites/variant_p0/column_name.groovy | 5 +- .../compaction/test_compaction.groovy | 14 ++-- .../suites/variant_p0/complexjson.groovy | 23 ------ regression-test/suites/variant_p0/desc.groovy | 10 ++- regression-test/suites/variant_p0/load.groovy | 82 ++++++++----------- .../schema_change/schema_change.groovy | 17 ++-- ...est_double_write_when_schema_change.groovy | 6 +- .../variant_p0/sql/rewrite_or_to_in.sql | 4 +- .../suites/variant_p0/tpch/load.groovy | 2 +- .../suites/variant_p0/tpch/sql/q01_trans.sql | 2 +- .../suites/variant_p0/tpch/sql/q02_trans.sql | 2 +- .../suites/variant_p0/tpch/sql/q03_trans.sql | 2 +- .../suites/variant_p0/tpch/sql/q05_trans.sql | 2 +- .../suites/variant_p0/tpch/sql/q06_trans.sql | 4 +- .../suites/variant_p0/tpch/sql/q08_trans.sql | 2 +- .../suites/variant_p0/tpch/sql/q09_trans.sql | 2 +- .../suites/variant_p0/tpch/sql/q10_trans.sql | 2 +- .../suites/variant_p0/tpch/sql/q12_trans.sql | 2 +- .../suites/variant_p0/tpch/sql/q13_trans.sql | 2 +- .../suites/variant_p0/tpch/sql/q14_trans.sql | 3 +- .../suites/variant_p0/tpch/sql/q16_trans.sql | 2 +- .../variant_p0/variant_hirachinal.groovy | 1 - .../suites/variant_p0/with_index/load.groovy | 4 +- .../sql/authorsWithTheMostPushes.sql | 6 +- .../suites/variant_p2/sql/countingStar2.sql | 2 +- .../suites/variant_p2/sql/countingStar3.sql | 2 +- .../distributionOfRepositoriesByStarCount.sql | 4 +- .../suites/variant_p2/sql/githubRoulette.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears1.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears2.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears3.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears4.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears5.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears6.sql | 2 +- ...tOfTopRepositoriesChangedOverTheYears7.sql | 2 +- .../sql/issuesWithTheMostComments2.sql | 2 +- .../sql/issuesWithTheMostComments3.sql | 6 +- .../sql/issuesWithTheMostComments4.sql | 8 +- .../sql/issuesWithTheMostComments5.sql | 10 +-- .../sql/issuesWithTheMostComments6.sql | 10 +-- .../sql/issuesWithTheMostComments7.sql | 6 +- .../sql/issuesWithTheMostComments8.sql | 10 +-- .../variant_p2/sql/mostForkedRepositories.sql | 2 +- .../sql/mostPopularCommentsOnGithub.sql | 2 +- ...organizationsByTheNumberOfRepositories.sql | 4 +- .../sql/organizationsByTheNumberOfStars.sql | 2 +- .../sql/organizationsByTheSizeOfCommunity.sql | 14 ++-- .../sql/proportionsBetweenStarsAndForks1.sql | 2 +- .../sql/proportionsBetweenStarsAndForks2.sql | 2 +- .../sql/proportionsBetweenStarsAndForks3.sql | 2 +- .../sql/proportionsBetweenStarsAndForks4.sql | 2 +- .../sql/proportionsBetweenStarsAndForks5.sql | 2 +- ...toriesWithClickhouse_related_comments1.sql | 2 +- ...toriesWithClickhouse_related_comments2.sql | 6 +- ...epositoriesWithDoris_related_comments1.sql | 2 +- ...epositoriesWithDoris_related_comments2.sql | 6 +- .../repositoriesWithTheHighestGrowthYoY.sql | 2 +- ...ositoriesWithTheMaximumAmountOfIssues1.sql | 2 +- ...ositoriesWithTheMaximumAmountOfIssues2.sql | 6 +- ...ositoriesWithTheMaximumAmountOfIssues3.sql | 6 +- ...ositoriesWithTheMaximumAmountOfIssues4.sql | 6 +- ...iesWithTheMaximumAmountOfPullRequests1.sql | 2 +- ...iesWithTheMaximumAmountOfPullRequests2.sql | 2 +- ...hTheMaximumNumberOfAcceptedInvitations.sql | 2 +- ...iesWithTheMostPeopleWhoHavePushAccess1.sql | 6 +- ...iesWithTheMostPeopleWhoHavePushAccess2.sql | 6 +- ...iesWithTheMostPeopleWhoHavePushAccess3.sql | 6 +- ...epositoriesWithTheMostStarsOverOneDay1.sql | 4 +- ...epositoriesWithTheMostStarsOverOneDay2.sql | 4 +- ...epositoriesWithTheMostStarsOverOneDay3.sql | 2 +- ...itoriesWithTheMostSteadyGrowthOverTime.sql | 2 +- ...positoriesWithTheWorstStagnation_order.sql | 2 +- .../sql/repositoryAffinityList2.sql | 10 +-- .../suites/variant_p2/sql/sql01.sql | 2 +- .../suites/variant_p2/sql/sql02.sql | 2 +- .../suites/variant_p2/sql/sql03.sql | 2 +- .../suites/variant_p2/sql/sql04.sql | 2 +- .../suites/variant_p2/sql/sql05.sql | 2 +- .../suites/variant_p2/sql/sql06.sql | 2 +- .../suites/variant_p2/sql/sql07.sql | 2 +- .../suites/variant_p2/sql/sql08.sql | 2 +- .../sql/theLongestRepositoryNames1.sql | 2 +- .../sql/theLongestRepositoryNames2.sql | 2 +- .../sql/theMostToughCodeReviews.sql | 10 +-- .../theTotalNumberOfRepositoriesOnGithub.sql | 2 +- .../sql/theTotalNumberOfUsersOnGithub1.sql | 2 +- .../sql/theTotalNumberOfUsersOnGithub2.sql | 2 +- .../sql/theTotalNumberOfUsersOnGithub3.sql | 2 +- .../sql/theTotalNumberOfUsersOnGithub4.sql | 2 +- .../suites/variant_p2/sql/topLabels1.sql | 2 +- .../suites/variant_p2/sql/topLabels2.sql | 2 +- .../suites/variant_p2/sql/topLabels3.sql | 2 +- .../variant_p2/sql/topRepositoriesByStars.sql | 2 +- .../sql/whoAreAllThosePeopleGivingStars1.sql | 2 +- .../sql/whoAreAllThosePeopleGivingStars2.sql | 2 +- .../affinityByIssuesAndPRs1.sql | 16 ++-- .../affinityByIssuesAndPRs2.sql | 16 ++-- .../repositoriesByAmountOfModifiedCode.sql | 6 +- .../repositoriesByTheNumberOfPushes.sql | 12 +-- .../repositoryAffinityList1.sql | 10 +-- .../starsFromHeavyGithubUsers1.sql | 10 +-- .../starsFromHeavyGithubUsers2.sql | 12 +-- .../whoAreAllThosePeopleGivingStars3.sql | 10 +-- 270 files changed, 601 insertions(+), 624 deletions(-) diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java index 1231312cf5d0e1..be18d266f43f0a 100644 --- a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java +++ b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java @@ -2499,6 +2499,9 @@ public static boolean isNotCloudMode() { @ConfField public static String cloud_sql_server_cluster_id = "RESERVED_CLUSTER_ID_FOR_SQL_SERVER"; + + @ConfField(mutable = true) + public static boolean enable_variant_access_in_original_planner = false; //========================================================================== // end of cloud config //========================================================================== diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java index 2e7d7d729add93..115ca1936226a7 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/Analyzer.java @@ -1029,6 +1029,11 @@ public SlotDescriptor registerColumnRef(TableName tblName, String colName, List< LOG.debug("register column ref table {}, colName {}, col {}", tblName, colName, col.toSql()); if (col.getType().isVariantType() || (subColNames != null && !subColNames.isEmpty())) { + if (!Config.enable_variant_access_in_original_planner + && (subColNames != null && !subColNames.isEmpty())) { + ErrorReport.reportAnalysisException("Variant sub-column access is disabled in original planner," + + "set enable_variant_access_in_original_planner = true in session variable"); + } if (!col.getType().isVariantType()) { ErrorReport.reportAnalysisException(ErrorCode.ERR_ILLEGAL_COLUMN_REFERENCE_ERROR, Joiner.on(".").join(tblName.getTbl(), colName)); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/StatementContext.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/StatementContext.java index d8fa683027b546..5c894fd46ef2b9 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/StatementContext.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/StatementContext.java @@ -186,7 +186,7 @@ public Slot getRewrittenSlotRefByOriginalExpr(Expression originalExpr) { * Add a slot ref attached with paths in context to avoid duplicated slot */ public void addPathSlotRef(Slot root, List paths, SlotReference slotRef, Expression originalExpr) { - Comparator> pathsComparator = new Comparator>() { + subColumnSlotRefMap.computeIfAbsent(root, k -> Maps.newTreeMap(new Comparator>() { @Override public int compare(List lst1, List lst2) { Iterator it1 = lst1.iterator(); @@ -199,8 +199,7 @@ public int compare(List lst1, List lst2) { } return Integer.compare(lst1.size(), lst2.size()); } - }; - subColumnSlotRefMap.computeIfAbsent(root, k -> Maps.newTreeMap(pathsComparator)); + })); subColumnSlotRefMap.get(root).put(paths, slotRef); subColumnOriginalExprMap.put(slotRef, originalExpr); originalExprToRewrittenSubColumn.put(originalExpr, slotRef); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/ExpressionTranslator.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/ExpressionTranslator.java index dbc083915f2cbc..2d77124fa58be0 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/ExpressionTranslator.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/ExpressionTranslator.java @@ -219,6 +219,7 @@ public Expr visitMatch(Match match, PlanTranslatorContext context) { String invertedIndexParser = InvertedIndexUtil.INVERTED_INDEX_PARSER_UNKNOWN; String invertedIndexParserMode = InvertedIndexUtil.INVERTED_INDEX_PARSER_COARSE_GRANULARITY; Map invertedIndexCharFilter = new HashMap<>(); + // Get the first slot from match's left expr SlotRef left = (SlotRef) match.left().getInputSlots().stream().findFirst().get().accept(this, context); OlapTable olapTbl = Optional.ofNullable(getOlapTableFromSlotDesc(left.getDesc())) .orElse(getOlapTableDirectly(left)); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/PushDownFilterThroughProject.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/PushDownFilterThroughProject.java index 821ac47e44f378..99b7d8a9572863 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/PushDownFilterThroughProject.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/PushDownFilterThroughProject.java @@ -42,7 +42,7 @@ public Plan visitPhysicalFilter(PhysicalFilter filter, CascadesC } PhysicalProject project = (PhysicalProject) child; - if (project.isPulledUpProjectFromScan()) { + if (project.hasPushedDownToProjectionFunctions()) { // ignore project which is pulled up from LogicalOlapScan return filter; } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/Validator.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/Validator.java index 392788575c8f50..76b417194b19e3 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/Validator.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/processor/post/Validator.java @@ -59,7 +59,7 @@ public Plan visitPhysicalFilter(PhysicalFilter filter, CascadesC Plan child = filter.child(); // Forbidden filter-project, we must make filter-project -> project-filter. - if (child instanceof PhysicalProject && !((PhysicalProject) child).isPulledUpProjectFromScan()) { + if (child instanceof PhysicalProject && !((PhysicalProject) child).hasPushedDownToProjectionFunctions()) { throw new AnalysisException( "Nereids generate a filter-project plan, but backend not support:\n" + filter.treeString()); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/RuleType.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/RuleType.java index 58947760b422ff..b35c7e03b72aef 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/RuleType.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/RuleType.java @@ -49,10 +49,9 @@ public enum RuleType { BINDING_UNBOUND_TVF_RELATION_FUNCTION(RuleTypeClass.REWRITE), BINDING_SET_OPERATION_SLOT(RuleTypeClass.REWRITE), BINDING_INLINE_TABLE_SLOT(RuleTypeClass.REWRITE), - COUNT_LITERAL_REWRITE(RuleTypeClass.REWRITE), - BINDING_SLOT_WITH_PATHS_PROJECT(RuleTypeClass.REWRITE), BINDING_SLOT_WITH_PATHS_SCAN(RuleTypeClass.REWRITE), + COUNT_LITERAL_REWRITE(RuleTypeClass.REWRITE), REPLACE_SORT_EXPRESSION_BY_CHILD_OUTPUT(RuleTypeClass.REWRITE), diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/CheckAfterRewrite.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/CheckAfterRewrite.java index 402ac833d66112..e098e0cac13ef8 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/CheckAfterRewrite.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/CheckAfterRewrite.java @@ -184,7 +184,7 @@ private void checkMatchIsUsedCorrectly(Plan plan) { if (plan instanceof LogicalFilter && (plan.child(0) instanceof LogicalOlapScan || plan.child(0) instanceof LogicalDeferMaterializeOlapScan || plan.child(0) instanceof LogicalProject - && ((LogicalProject) plan.child(0)).isPulledUpProjectFromScan())) { + && ((LogicalProject) plan.child(0)).hasPushedDownToProjectionFunctions())) { return; } else { throw new AnalysisException(String.format( diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PullUpProjectUnderTopN.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PullUpProjectUnderTopN.java index 84ac06c153def6..b02edd9033ba05 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PullUpProjectUnderTopN.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PullUpProjectUnderTopN.java @@ -38,6 +38,7 @@ public class PullUpProjectUnderTopN extends OneRewriteRuleFactory { @Override public Rule build() { return logicalTopN(logicalProject().whenNot(p -> p.isAllSlots())) + .whenNot(topN -> topN.child().hasPushedDownToProjectionFunctions()) .then(topN -> { LogicalProject project = topN.child(); Set outputSet = project.child().getOutputSet(); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownFilterThroughProject.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownFilterThroughProject.java index 34514a3b34b84a..c0fe79fe01dda0 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownFilterThroughProject.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PushDownFilterThroughProject.java @@ -44,7 +44,7 @@ public List buildRules() { logicalFilter(logicalProject()) .whenNot(filter -> filter.child().getProjects().stream().anyMatch( expr -> expr.anyMatch(WindowExpression.class::isInstance))) - .whenNot(filter -> filter.child().isPulledUpProjectFromScan()) + .whenNot(filter -> filter.child().hasPushedDownToProjectionFunctions()) .then(PushDownFilterThroughProject::pushdownFilterThroughProject) .toRule(RuleType.PUSH_DOWN_FILTER_THROUGH_PROJECT), // filter(project(limit)) will change to filter(limit(project)) by PushdownProjectThroughLimit, @@ -52,7 +52,7 @@ public List buildRules() { logicalFilter(logicalLimit(logicalProject())) .whenNot(filter -> filter.child().child().getProjects().stream() .anyMatch(expr -> expr.anyMatch(WindowExpression.class::isInstance))) - .whenNot(filter -> filter.child().child().isPulledUpProjectFromScan()) + .whenNot(filter -> filter.child().child().hasPushedDownToProjectionFunctions()) .then(filter -> { LogicalLimit> limit = filter.child(); LogicalProject project = limit.child(); diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/PushDownToProjectionFunction.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/PushDownToProjectionFunction.java index 321e08f8811407..e2473ea0954258 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/PushDownToProjectionFunction.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/PushDownToProjectionFunction.java @@ -19,13 +19,22 @@ import org.apache.doris.nereids.trees.expressions.Expression; +import java.util.stream.Collectors; + /** * Function that could be rewritten and pushed down to projection */ public interface PushDownToProjectionFunction { - // check if specified function could be pushed down to project + /** + * check if specified function could be pushed down to project + * @param pushDownExpr expr to check + * @return if it is valid to push down input expr + */ static boolean validToPushDown(Expression pushDownExpr) { - // Currently only Variant type could be pushed down - return pushDownExpr instanceof PushDownToProjectionFunction && pushDownExpr.getDataType().isVariantType(); + // Currently only element at for variant type could be pushed down + return !pushDownExpr.collectToList( + PushDownToProjectionFunction.class::isInstance).stream().filter( + x -> ((Expression) x).getDataType().isVariantType()).collect( + Collectors.toList()).isEmpty(); } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/algebra/Project.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/algebra/Project.java index 4561353c84e2bc..8005f07da8ef81 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/algebra/Project.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/algebra/Project.java @@ -71,8 +71,9 @@ default List mergeProjections(Project childProject) { /** * Check if it is a project that is pull up from scan in analyze rule * e.g. BindSlotWithPaths + * And check if contains PushDownToProjectionFunction that can pushed down to project */ - default boolean isPulledUpProjectFromScan() { + default boolean hasPushedDownToProjectionFunctions() { return ConnectContext.get() != null && ConnectContext.get().getSessionVariable() != null && ConnectContext.get().getSessionVariable().isEnableRewriteElementAtToSlot() diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/VariantType.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/VariantType.java index 14818f39bb1398..63752594998b3a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/types/VariantType.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/types/VariantType.java @@ -47,7 +47,7 @@ public boolean acceptsType(DataType other) { @Override public String simpleString() { - return "map"; + return "variant"; } @Override diff --git a/regression-test/data/variant_p0/column_name.out b/regression-test/data/variant_p0/column_name.out index 753526dd088597..2b897c04a0524e 100644 --- a/regression-test/data/variant_p0/column_name.out +++ b/regression-test/data/variant_p0/column_name.out @@ -1,6 +1,6 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !sql -- -中文 \N +中文 unicode -- !sql -- "" diff --git a/regression-test/suites/variant_github_events_p0/affinityByIssuesAndPRs1.sql b/regression-test/suites/variant_github_events_p0/affinityByIssuesAndPRs1.sql index 0f89de3394bc0a..55c3589753fb73 100644 --- a/regression-test/suites/variant_github_events_p0/affinityByIssuesAndPRs1.sql +++ b/regression-test/suites/variant_github_events_p0/affinityByIssuesAndPRs1.sql @@ -1,14 +1,14 @@ SELECT - cast(v:repo.name as string), + cast(v["repo"]["name"] as string), count() AS prs, - count(distinct cast(v:actor.login as string)) AS authors + count(distinct cast(v["actor"]["login"] as string)) AS authors FROM github_events -WHERE (cast(v:type as string) = 'PullRequestEvent') AND (cast(v:payload.action as string) = 'opened') AND (cast(v:actor.login as string) IN +WHERE (cast(v["type"] as string) = 'PullRequestEvent') AND (cast(v["payload"]["action"] as string) = 'opened') AND (cast(v["actor"]["login"] as string) IN ( - SELECT cast(v:actor.login as string) + SELECT cast(v["actor"]["login"] as string) FROM github_events - WHERE (cast(v:type as string) = 'PullRequestEvent') AND (cast(v:payload.action as string)= 'opened') AND (cast(v:repo.name as string) IN ('rspec/rspec-core', 'golden-warning/giraffedraft-server', 'apache/spark')) -)) AND (lower(cast(v:repo.name as string)) NOT LIKE '%clickhouse%') -GROUP BY cast(v:repo.name as string) -ORDER BY authors DESC, prs DESC, cast(v:repo.name as string) DESC + WHERE (cast(v["type"] as string) = 'PullRequestEvent') AND (cast(v["payload"]["action"] as string)= 'opened') AND (cast(v["repo"]["name"] as string) IN ('rspec/rspec-core', 'golden-warning/giraffedraft-server', 'apache/spark')) +)) AND (lower(cast(v["repo"]["name"] as string)) NOT LIKE '%clickhouse%') +GROUP BY cast(v["repo"]["name"] as string) +ORDER BY authors DESC, prs DESC, cast(v["repo"]["name"] as string) DESC LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/affinityByIssuesAndPRs2.sql b/regression-test/suites/variant_github_events_p0/affinityByIssuesAndPRs2.sql index 913953c271cf1e..e9158f8246b532 100644 --- a/regression-test/suites/variant_github_events_p0/affinityByIssuesAndPRs2.sql +++ b/regression-test/suites/variant_github_events_p0/affinityByIssuesAndPRs2.sql @@ -1,14 +1,14 @@ SELECT - cast(v:repo.name as string), + cast(v["repo"]["name"] as string), count() AS prs, - count(distinct cast(v:actor.login as string)) AS authors + count(distinct cast(v["actor"]["login"] as string)) AS authors FROM github_events -WHERE (cast(v:type as string) = 'IssuesEvent') AND (cast(v:payload.action as string) = 'opened') AND (cast(v:actor.login as string) IN +WHERE (cast(v["type"] as string) = 'IssuesEvent') AND (cast(v["payload"]["action"] as string) = 'opened') AND (cast(v["actor"]["login"] as string) IN ( - SELECT cast(v:actor.login as string) + SELECT cast(v["actor"]["login"] as string) FROM github_events - WHERE (cast(v:type as string) = 'IssuesEvent') AND (cast(v:payload.action as string) = 'opened') AND (cast(v:repo.name as string) IN ('No-CQRT/GooGuns', 'ivolunteerph/ivolunteerph', 'Tribler/tribler')) -)) AND (lower(cast(v:repo.name as string)) NOT LIKE '%clickhouse%') -GROUP BY cast(v:repo.name as string) -ORDER BY authors DESC, prs DESC, cast(v:repo.name as string) ASC + WHERE (cast(v["type"] as string) = 'IssuesEvent') AND (cast(v["payload"]["action"] as string) = 'opened') AND (cast(v["repo"]["name"] as string) IN ('No-CQRT/GooGuns', 'ivolunteerph/ivolunteerph', 'Tribler/tribler')) +)) AND (lower(cast(v["repo"]["name"] as string)) NOT LIKE '%clickhouse%') +GROUP BY cast(v["repo"]["name"] as string) +ORDER BY authors DESC, prs DESC, cast(v["repo"]["name"] as string) ASC LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/authorsWithTheMostPushes.sql b/regression-test/suites/variant_github_events_p0/authorsWithTheMostPushes.sql index 006a9ae9d3f01a..2e8bf32009814e 100644 --- a/regression-test/suites/variant_github_events_p0/authorsWithTheMostPushes.sql +++ b/regression-test/suites/variant_github_events_p0/authorsWithTheMostPushes.sql @@ -1,9 +1,9 @@ SELECT - cast(v:actor.login as string), + cast(v["actor"]["login"] as string), count() AS c, - count(distinct cast(v:repo.name as string)) AS repos + count(distinct cast(v["repo"]["name"] as string)) AS repos FROM github_events - WHERE cast(v:type as string) = 'PushEvent' - GROUP BY cast(v:actor.login as string) + WHERE cast(v["type"] as string) = 'PushEvent' + GROUP BY cast(v["actor"]["login"] as string) ORDER BY c DESC, 1, 3 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/countingStar1.sql b/regression-test/suites/variant_github_events_p0/countingStar1.sql index db71c34c4e17ae..8b2d615acd052e 100644 --- a/regression-test/suites/variant_github_events_p0/countingStar1.sql +++ b/regression-test/suites/variant_github_events_p0/countingStar1.sql @@ -1 +1 @@ -SELECT count() FROM github_events WHERE cast(v:type as string) = 'WatchEvent' +SELECT count() FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' diff --git a/regression-test/suites/variant_github_events_p0/countingStar2.sql b/regression-test/suites/variant_github_events_p0/countingStar2.sql index 892efa7d726547..057a410e0caeeb 100644 --- a/regression-test/suites/variant_github_events_p0/countingStar2.sql +++ b/regression-test/suites/variant_github_events_p0/countingStar2.sql @@ -1 +1 @@ -SELECT cast(v:payload.action as string), count() FROM github_events WHERE cast(v:type as string) = 'WatchEvent' GROUP BY cast(v:payload.action as string) \ No newline at end of file +SELECT cast(v["payload"]["action"] as string), count() FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY cast(v["payload"]["action"] as string) \ No newline at end of file diff --git a/regression-test/suites/variant_github_events_p0/countingStar3.sql b/regression-test/suites/variant_github_events_p0/countingStar3.sql index 9370e01530a2bf..9b5f41288901d7 100644 --- a/regression-test/suites/variant_github_events_p0/countingStar3.sql +++ b/regression-test/suites/variant_github_events_p0/countingStar3.sql @@ -1 +1 @@ -SELECT count() FROM github_events WHERE cast(v:type as string) = 'WatchEvent' AND cast(v:repo.name as string) IN ('apache/spark', 'GunZi200/Memory-Colour', 'isohuntto/openbay', 'wasabeef/awesome-android-ui') GROUP BY cast(v:payload.action as string) \ No newline at end of file +SELECT count() FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND cast(v["repo"]["name"] as string) IN ('apache/spark', 'GunZi200/Memory-Colour', 'isohuntto/openbay', 'wasabeef/awesome-android-ui') GROUP BY cast(v["payload"]["action"] as string) \ No newline at end of file diff --git a/regression-test/suites/variant_github_events_p0/distributionOfRepositoriesByStarCount.sql b/regression-test/suites/variant_github_events_p0/distributionOfRepositoriesByStarCount.sql index 1e252ef4a7bfd1..e2d987afe6510b 100644 --- a/regression-test/suites/variant_github_events_p0/distributionOfRepositoriesByStarCount.sql +++ b/regression-test/suites/variant_github_events_p0/distributionOfRepositoriesByStarCount.sql @@ -4,11 +4,11 @@ SELECT FROM ( SELECT - cast(v:repo.name as string) as k, + cast(v["repo"]["name"] as string) as k, count() AS c FROM github_events - WHERE cast(v:type as string) = 'WatchEvent' - GROUP BY cast(v:repo.name as string) + WHERE cast(v["type"] as string) = 'WatchEvent' + GROUP BY cast(v["repo"]["name"] as string) ) t GROUP BY stars ORDER BY stars ASC diff --git a/regression-test/suites/variant_github_events_p0/githubRoulette.sql b/regression-test/suites/variant_github_events_p0/githubRoulette.sql index cda527b69f62b4..0b9ea42f77d8ea 100644 --- a/regression-test/suites/variant_github_events_p0/githubRoulette.sql +++ b/regression-test/suites/variant_github_events_p0/githubRoulette.sql @@ -1 +1 @@ -SELECT cast(v:repo.name as string) FROM github_events WHERE cast(v:type as string) = 'WatchEvent' ORDER BY cast(v:created_at as datetime), cast(v:repo.name as string) LIMIT 50 \ No newline at end of file +SELECT cast(v["repo"]["name"] as string) FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' ORDER BY cast(v["created_at"] as datetime), cast(v["repo"]["name"] as string) LIMIT 50 \ No newline at end of file diff --git a/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears1.sql b/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears1.sql index 14b2ec2b788156..95389cb9a0651c 100644 --- a/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears1.sql +++ b/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears1.sql @@ -1 +1 @@ -SELECT cast(v:repo.name as string), count() AS stars FROM github_events WHERE cast(v:type as string) = 'WatchEvent' AND year(cast(v:created_at as datetime)) = '2015' GROUP BY cast(v:repo.name as string) ORDER BY stars DESC, 1 LIMIT 50 +SELECT cast(v["repo"]["name"] as string), count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND year(cast(v["created_at"] as datetime)) = '2015' GROUP BY cast(v["repo"]["name"] as string) ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears2.sql b/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears2.sql index 14b2ec2b788156..95389cb9a0651c 100644 --- a/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears2.sql +++ b/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears2.sql @@ -1 +1 @@ -SELECT cast(v:repo.name as string), count() AS stars FROM github_events WHERE cast(v:type as string) = 'WatchEvent' AND year(cast(v:created_at as datetime)) = '2015' GROUP BY cast(v:repo.name as string) ORDER BY stars DESC, 1 LIMIT 50 +SELECT cast(v["repo"]["name"] as string), count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND year(cast(v["created_at"] as datetime)) = '2015' GROUP BY cast(v["repo"]["name"] as string) ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears3.sql b/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears3.sql index 19c4bb03587255..67b5d0d3d18969 100644 --- a/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears3.sql +++ b/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears3.sql @@ -1 +1 @@ -SELECT cast(v:repo.name as string), count() AS stars FROM github_events WHERE cast(v:type as string) = 'WatchEvent' AND year(cast(v:created_at as datetime)) = '2015' GROUP BY cast(v:repo.name as string) ORDER BY stars, cast(v:repo.name as string) DESC LIMIT 50 +SELECT cast(v["repo"]["name"] as string), count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND year(cast(v["created_at"] as datetime)) = '2015' GROUP BY cast(v["repo"]["name"] as string) ORDER BY stars, cast(v["repo"]["name"] as string) DESC LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears4.sql b/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears4.sql index 14b2ec2b788156..95389cb9a0651c 100644 --- a/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears4.sql +++ b/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears4.sql @@ -1 +1 @@ -SELECT cast(v:repo.name as string), count() AS stars FROM github_events WHERE cast(v:type as string) = 'WatchEvent' AND year(cast(v:created_at as datetime)) = '2015' GROUP BY cast(v:repo.name as string) ORDER BY stars DESC, 1 LIMIT 50 +SELECT cast(v["repo"]["name"] as string), count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND year(cast(v["created_at"] as datetime)) = '2015' GROUP BY cast(v["repo"]["name"] as string) ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears5.sql b/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears5.sql index 14b2ec2b788156..95389cb9a0651c 100644 --- a/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears5.sql +++ b/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears5.sql @@ -1 +1 @@ -SELECT cast(v:repo.name as string), count() AS stars FROM github_events WHERE cast(v:type as string) = 'WatchEvent' AND year(cast(v:created_at as datetime)) = '2015' GROUP BY cast(v:repo.name as string) ORDER BY stars DESC, 1 LIMIT 50 +SELECT cast(v["repo"]["name"] as string), count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND year(cast(v["created_at"] as datetime)) = '2015' GROUP BY cast(v["repo"]["name"] as string) ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears6.sql b/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears6.sql index 14b2ec2b788156..95389cb9a0651c 100644 --- a/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears6.sql +++ b/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears6.sql @@ -1 +1 @@ -SELECT cast(v:repo.name as string), count() AS stars FROM github_events WHERE cast(v:type as string) = 'WatchEvent' AND year(cast(v:created_at as datetime)) = '2015' GROUP BY cast(v:repo.name as string) ORDER BY stars DESC, 1 LIMIT 50 +SELECT cast(v["repo"]["name"] as string), count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND year(cast(v["created_at"] as datetime)) = '2015' GROUP BY cast(v["repo"]["name"] as string) ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears7.sql b/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears7.sql index 5e4efa99ad8ce2..ee2fbef43b3f53 100644 --- a/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears7.sql +++ b/regression-test/suites/variant_github_events_p0/howHasTheListOfTopRepositoriesChangedOverTheYears7.sql @@ -13,11 +13,11 @@ -- FROM -- ( -- SELECT --- lower(cast(v:repo.name as string)) AS repo, --- year(cast(v:created_at as datetime)) AS year, +-- lower(cast(v["repo"]["name"] as string)) AS repo, +-- year(cast(v["created_at"] as datetime)) AS year, -- count() AS cnt -- FROM github_events --- WHERE (cast(v:type as string) = 'WatchEvent') AND (year(cast(v:created_at as datetime)) >= 2015) +-- WHERE (cast(v["type"] as string) = 'WatchEvent') AND (year(cast(v["created_at"] as datetime)) >= 2015) -- GROUP BY -- repo, -- year diff --git a/regression-test/suites/variant_github_events_p0/howHasTheTotalNumberOfStarsChangedOverTime.sql b/regression-test/suites/variant_github_events_p0/howHasTheTotalNumberOfStarsChangedOverTime.sql index 97874a2d1e56c3..5291ab5100649a 100644 --- a/regression-test/suites/variant_github_events_p0/howHasTheTotalNumberOfStarsChangedOverTime.sql +++ b/regression-test/suites/variant_github_events_p0/howHasTheTotalNumberOfStarsChangedOverTime.sql @@ -1,2 +1,2 @@ -SELECT year(cast(v:created_at as datetime)) AS year, count() AS stars FROM github_events WHERE cast(v:type as string) = 'WatchEvent' GROUP BY year ORDER BY year +SELECT year(cast(v["created_at"] as datetime)) AS year, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY year ORDER BY year diff --git a/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments1.sql b/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments1.sql index 9f4e7db0a1bad8..0117055d53e7f6 100644 --- a/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments1.sql +++ b/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments1.sql @@ -1 +1 @@ -SELECT count() FROM github_events WHERE cast(v:type as string) = 'IssueCommentEvent' +SELECT count() FROM github_events WHERE cast(v["type"] as string) = 'IssueCommentEvent' diff --git a/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments2.sql b/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments2.sql index 293b171c133933..25e96fe731ebc7 100644 --- a/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments2.sql +++ b/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments2.sql @@ -1 +1 @@ -SELECT cast(v:repo.name as string), count() FROM github_events WHERE cast(v:type as string) = 'IssueCommentEvent' GROUP BY cast(v:repo.name as string) ORDER BY count() DESC, 1 LIMIT 50 +SELECT cast(v["repo"]["name"] as string), count() FROM github_events WHERE cast(v["type"] as string) = 'IssueCommentEvent' GROUP BY cast(v["repo"]["name"] as string) ORDER BY count() DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments3.sql b/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments3.sql index cb1926ad2094e8..c32210845e3a7b 100644 --- a/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments3.sql +++ b/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments3.sql @@ -6,12 +6,12 @@ SELECT FROM ( SELECT - cast(v:repo.name as string) as repo_name, + cast(v["repo"]["name"] as string) as repo_name, count() AS comments, - count(distinct cast(v:payload.issue.`number` as int)) AS issues + count(distinct cast(v["payload"]["issue"]["number"] as int)) AS issues FROM github_events - WHERE cast(v:type as string) = 'IssueCommentEvent' - GROUP BY cast(v:repo.name as string) + WHERE cast(v["type"] as string) = 'IssueCommentEvent' + GROUP BY cast(v["repo"]["name"] as string) ) t ORDER BY comments DESC, 1, 3, 4 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments4.sql b/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments4.sql index c9914fb203a456..ad8e5c104ccfc2 100644 --- a/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments4.sql +++ b/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments4.sql @@ -1,9 +1,9 @@ SELECT - cast(v:repo.name as string), - cast(v:payload.issue.`number` as int) as number, + cast(v["repo"]["name"] as string), + cast(v["payload"]["issue"]["number"] as int) as number, count() AS comments FROM github_events -WHERE cast(v:type as string) = 'IssueCommentEvent' AND (cast(v:payload.action as string) = 'created') -GROUP BY cast(v:repo.name as string), number +WHERE cast(v["type"] as string) = 'IssueCommentEvent' AND (cast(v["payload"]["action"] as string) = 'created') +GROUP BY cast(v["repo"]["name"] as string), number ORDER BY comments DESC, number ASC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments5.sql b/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments5.sql index 04a0f61fa027f5..0520ed0b8dc768 100644 --- a/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments5.sql +++ b/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments5.sql @@ -1,9 +1,9 @@ SELECT - cast(v:repo.name as string), - cast(v:payload.issue.`number` as int) as number, + cast(v["repo"]["name"] as string), + cast(v["payload"]["issue"]["number"] as int) as number, count() AS comments FROM github_events -WHERE cast(v:type as string) = 'IssueCommentEvent' AND (cast(v:payload.action as string) = 'created') AND (cast(v:payload.issue.`number` as int) > 10) -GROUP BY cast(v:repo.name as string), number -ORDER BY comments DESC, cast(v:repo.name as string), number +WHERE cast(v["type"] as string) = 'IssueCommentEvent' AND (cast(v["payload"]["action"] as string) = 'created') AND (cast(v["payload"]["issue"]["number"] as int) > 10) +GROUP BY cast(v["repo"]["name"] as string), number +ORDER BY comments DESC, cast(v["repo"]["name"] as string), number LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments6.sql b/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments6.sql index 155f6f695f8716..edab4d50e26300 100644 --- a/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments6.sql +++ b/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments6.sql @@ -1,11 +1,11 @@ SELECT - cast(v:repo.name as string), - cast(v:payload.issue.`number` as int) as number, + cast(v["repo"]["name"] as string), + cast(v["payload"]["issue"]["number"] as int) as number, count() AS comments, - count(distinct cast(v:actor.login as string)) AS authors + count(distinct cast(v["actor"]["login"] as string)) AS authors FROM github_events -WHERE cast(v:type as string) = 'IssueCommentEvent' AND (cast(v:payload.action as string) = 'created') AND (cast(v:payload.issue.`number` as int) > 10) -GROUP BY cast(v:repo.name as string), number +WHERE cast(v["type"] as string) = 'IssueCommentEvent' AND (cast(v["payload"]["action"] as string) = 'created') AND (cast(v["payload"]["issue"]["number"] as int) > 10) +GROUP BY cast(v["repo"]["name"] as string), number HAVING authors >= 4 -ORDER BY comments DESC, cast(v:repo.name as string) +ORDER BY comments DESC, cast(v["repo"]["name"] as string) LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments7.sql b/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments7.sql index 07b91250aa329b..047f2d7a1d48fe 100644 --- a/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments7.sql +++ b/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments7.sql @@ -1,9 +1,9 @@ SELECT - cast(v:repo.name as string), + cast(v["repo"]["name"] as string), count() AS comments, - count(distinct cast(v:actor.login as string)) AS authors + count(distinct cast(v["actor"]["login"] as string)) AS authors FROM github_events -WHERE cast(v:type as string) = 'CommitCommentEvent' -GROUP BY cast(v:repo.name as string) +WHERE cast(v["type"] as string) = 'CommitCommentEvent' +GROUP BY cast(v["repo"]["name"] as string) ORDER BY count() DESC, 1, 3 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments8.sql b/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments8.sql index 7a3696f803934c..e6890c1e23505f 100644 --- a/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments8.sql +++ b/regression-test/suites/variant_github_events_p0/issuesWithTheMostComments8.sql @@ -1,12 +1,12 @@ -- SELECT --- concat('https://github.com/', cast(v:repo.name as string), '/commit/', cast(v:payload.commit_id as string)) URL, --- cast(v:payload.commit_id as string) AS commit_id, +-- concat('https://github.com/', cast(v["repo"]["name"] as string), '/commit/', cast(v["payload"]["commit_id"] as string)) URL, +-- cast(v["payload"]["commit_id"] as string) AS commit_id, -- count() AS comments, --- count(distinct cast(v:actor.login as string)) AS authors +-- count(distinct cast(v["actor"]["login"] as string)) AS authors -- FROM github_events --- WHERE (cast(v:type as string) = 'CommitCommentEvent') AND commit_id != "" +-- WHERE (cast(v["type"] as string) = 'CommitCommentEvent') AND commit_id != "" -- GROUP BY --- cast(v:repo.name as string), +-- cast(v["repo"]["name"] as string), -- commit_id -- HAVING authors >= 10 -- ORDER BY count() DESC, URL, authors diff --git a/regression-test/suites/variant_github_events_p0/load.groovy b/regression-test/suites/variant_github_events_p0/load.groovy index e58f5f6afab392..889c4c6b07e4eb 100644 --- a/regression-test/suites/variant_github_events_p0/load.groovy +++ b/regression-test/suites/variant_github_events_p0/load.groovy @@ -69,6 +69,6 @@ suite("regression_test_variant_github_events_p0", "variant_type"){ load_json_data.call(table_name, """${getS3Url() + '/regression/gharchive.m/2022-11-07-22.json'}""") load_json_data.call(table_name, """${getS3Url() + '/regression/gharchive.m/2022-11-07-23.json'}""") // TODO fix compaction issue, this case could be stable - qt_sql """select cast(v:payload.pull_request.additions as int) from github_events where cast(v:repo.name as string) = 'xpressengine/xe-core' order by 1;""" + qt_sql """select cast(v["payload"]["pull_request"]["additions"] as int) from github_events where cast(v["repo"]["name"] as string) = 'xpressengine/xe-core' order by 1;""" // TODO add test case that some certain columns are materialized in some file while others are not materilized(sparse) } \ No newline at end of file diff --git a/regression-test/suites/variant_github_events_p0/mostForkedRepositories.sql b/regression-test/suites/variant_github_events_p0/mostForkedRepositories.sql index 85cf5ef0de9f2b..aab10cb79335a8 100644 --- a/regression-test/suites/variant_github_events_p0/mostForkedRepositories.sql +++ b/regression-test/suites/variant_github_events_p0/mostForkedRepositories.sql @@ -1 +1 @@ -SELECT cast(v:repo.name as string), count() AS forks FROM github_events WHERE cast(v:type as string) = 'ForkEvent' GROUP BY cast(v:repo.name as string) ORDER BY forks DESC, 1 LIMIT 50 +SELECT cast(v["repo"]["name"] as string), count() AS forks FROM github_events WHERE cast(v["type"] as string) = 'ForkEvent' GROUP BY cast(v["repo"]["name"] as string) ORDER BY forks DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/mostPopularCommentsOnGithub.sql b/regression-test/suites/variant_github_events_p0/mostPopularCommentsOnGithub.sql index ff617de4a92408..c36efe7561b7e8 100644 --- a/regression-test/suites/variant_github_events_p0/mostPopularCommentsOnGithub.sql +++ b/regression-test/suites/variant_github_events_p0/mostPopularCommentsOnGithub.sql @@ -1 +1 @@ -SELECT cast(v:payload.comment.body as string), count() FROM github_events WHERE cast(v:payload.comment.body as string) != "" AND length(cast(v:payload.comment.body as string)) < 100 GROUP BY cast(v:payload.comment.body as string) ORDER BY count(), 1 DESC LIMIT 50 \ No newline at end of file +SELECT cast(v["payload"]["comment"]["body"] as string), count() FROM github_events WHERE cast(v["payload"]["comment"]["body"] as string) != "" AND length(cast(v["payload"]["comment"]["body"] as string)) < 100 GROUP BY cast(v["payload"]["comment"]["body"] as string) ORDER BY count(), 1 DESC LIMIT 50 \ No newline at end of file diff --git a/regression-test/suites/variant_github_events_p0/organizationsByTheNumberOfRepositories.sql b/regression-test/suites/variant_github_events_p0/organizationsByTheNumberOfRepositories.sql index b070f0714a629f..d943c07de6a45f 100644 --- a/regression-test/suites/variant_github_events_p0/organizationsByTheNumberOfRepositories.sql +++ b/regression-test/suites/variant_github_events_p0/organizationsByTheNumberOfRepositories.sql @@ -3,10 +3,10 @@ SELECT count(distinct repo_name) AS repos FROM ( - SELECT cast(v:repo.name as string) as repo_name + SELECT cast(v["repo"]["name"] as string) as repo_name FROM github_events - WHERE cast(v:type as string) = 'WatchEvent' - GROUP BY cast(v:repo.name as string) + WHERE cast(v["type"] as string) = 'WatchEvent' + GROUP BY cast(v["repo"]["name"] as string) HAVING count() >= 10 ) t GROUP BY org diff --git a/regression-test/suites/variant_github_events_p0/organizationsByTheNumberOfStars.sql b/regression-test/suites/variant_github_events_p0/organizationsByTheNumberOfStars.sql index e842751ba11d22..22f0a8cbba706e 100644 --- a/regression-test/suites/variant_github_events_p0/organizationsByTheNumberOfStars.sql +++ b/regression-test/suites/variant_github_events_p0/organizationsByTheNumberOfStars.sql @@ -1,8 +1,8 @@ SELECT - lower(split_part(cast(v:repo.name as string), '/', 1)) AS org, + lower(split_part(cast(v["repo"]["name"] as string), '/', 1)) AS org, count() AS stars FROM github_events -WHERE cast(v:type as string) = 'WatchEvent' +WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY org ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/organizationsByTheSizeOfCommunity.sql b/regression-test/suites/variant_github_events_p0/organizationsByTheSizeOfCommunity.sql index 8b3ae0baae4ec8..e445e7db3e9657 100644 --- a/regression-test/suites/variant_github_events_p0/organizationsByTheSizeOfCommunity.sql +++ b/regression-test/suites/variant_github_events_p0/organizationsByTheSizeOfCommunity.sql @@ -1,6 +1,6 @@ -- SELECT --- lower(split_part(cast(v:repo.name as string), '/', 1)) AS org, --- count(distinct cast(v:actor.login as string)) AS authors, +-- lower(split_part(cast(v["repo"]["name"] as string), '/', 1)) AS org, +-- count(distinct cast(v["actor"]["login"] as string)) AS authors, -- count(distinct pr_author) AS pr_authors, -- count(distinct issue_author) AS issue_authors, -- count(distinct comment_author) AS comment_authors, @@ -9,15 +9,15 @@ -- FROM -- ( -- SELECT --- cast(v:repo.name as string), --- cast(v:actor.login as string), --- CASE WHEN cast(v:type as string) = 'PullRequestEvent' THEN cast(v:actor.login as string) ELSE NULL END pr_author, --- CASE WHEN cast(v:type as string) = 'IssuesEvent' THEN cast(v:actor.login as string) ELSE NULL END issue_author, --- CASE WHEN cast(v:type as string) = 'IssueCommentEvent' THEN cast(v:actor.login as string) ELSE NULL END comment_author, --- CASE WHEN cast(v:type as string) = 'PullRequestReviewCommentEvent' THEN cast(v:actor.login as string) ELSE NULL END review_author, --- CASE WHEN cast(v:type as string) = 'PushEvent' THEN cast(v:actor.login as string) ELSE NULL END push_author +-- cast(v["repo"]["name"] as string), +-- cast(v["actor"]["login"] as string), +-- CASE WHEN cast(v["type"] as string) = 'PullRequestEvent' THEN cast(v["actor"]["login"] as string) ELSE NULL END pr_author, +-- CASE WHEN cast(v["type"] as string) = 'IssuesEvent' THEN cast(v["actor"]["login"] as string) ELSE NULL END issue_author, +-- CASE WHEN cast(v["type"] as string) = 'IssueCommentEvent' THEN cast(v["actor"]["login"] as string) ELSE NULL END comment_author, +-- CASE WHEN cast(v["type"] as string) = 'PullRequestReviewCommentEvent' THEN cast(v["actor"]["login"] as string) ELSE NULL END review_author, +-- CASE WHEN cast(v["type"] as string) = 'PushEvent' THEN cast(v["actor"]["login"] as string) ELSE NULL END push_author -- FROM github_events --- WHERE cast(v:type as string) IN ('PullRequestEvent', 'IssuesEvent', 'IssueCommentEvent', 'PullRequestReviewCommentEvent', 'PushEvent') +-- WHERE cast(v["type"] as string) IN ('PullRequestEvent', 'IssuesEvent', 'IssueCommentEvent', 'PullRequestReviewCommentEvent', 'PushEvent') -- ) t -- GROUP BY org -- ORDER BY authors DESC diff --git a/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks1.sql b/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks1.sql index b62668b9fa365d..65ab889b2511a6 100644 --- a/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks1.sql +++ b/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks1.sql @@ -6,11 +6,11 @@ SELECT FROM ( SELECT - cast(v:repo.name as string) as repo_name, - CASE WHEN cast(v:type as string) = 'ForkEvent' THEN 1 ELSE 0 END AS fork, - CASE WHEN cast(v:type as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star + cast(v["repo"]["name"] as string) as repo_name, + CASE WHEN cast(v["type"] as string) = 'ForkEvent' THEN 1 ELSE 0 END AS fork, + CASE WHEN cast(v["type"] as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star FROM github_events - WHERE cast(v:type as string) IN ('ForkEvent', 'WatchEvent') + WHERE cast(v["type"] as string) IN ('ForkEvent', 'WatchEvent') ) t GROUP BY repo_name ORDER BY forks DESC, 1, 3, 4 diff --git a/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks2.sql b/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks2.sql index fe286c489cf0a4..ffff95dfdc64c0 100644 --- a/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks2.sql +++ b/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks2.sql @@ -6,11 +6,11 @@ SELECT FROM ( SELECT - cast(v:repo.name as string) as repo_name, - CASE WHEN cast(v:type as string) = 'ForkEvent' THEN 1 ELSE 0 END AS fork, - CASE WHEN cast(v:type as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star + cast(v["repo"]["name"] as string) as repo_name, + CASE WHEN cast(v["type"] as string) = 'ForkEvent' THEN 1 ELSE 0 END AS fork, + CASE WHEN cast(v["type"] as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star FROM github_events - WHERE cast(v:type as string) IN ('ForkEvent', 'WatchEvent') + WHERE cast(v["type"] as string) IN ('ForkEvent', 'WatchEvent') ) t GROUP BY repo_name HAVING (stars > 20) AND (forks >= 10) diff --git a/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks3.sql b/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks3.sql index c8502f59f4c65a..f47c5163302b9c 100644 --- a/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks3.sql +++ b/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks3.sql @@ -6,11 +6,11 @@ SELECT FROM ( SELECT - cast(v:repo.name as string) as repo_name, - CASE WHEN cast(v:type as string) = 'ForkEvent' THEN 1 ELSE 0 END AS fork, - CASE WHEN cast(v:type as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star + cast(v["repo"]["name"] as string) as repo_name, + CASE WHEN cast(v["type"] as string) = 'ForkEvent' THEN 1 ELSE 0 END AS fork, + CASE WHEN cast(v["type"] as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star FROM github_events - WHERE cast(v:type as string) IN ('ForkEvent', 'WatchEvent') + WHERE cast(v["type"] as string) IN ('ForkEvent', 'WatchEvent') ) t GROUP BY repo_name HAVING (stars > 4) AND (forks > 4) diff --git a/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks4.sql b/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks4.sql index f1c405efcdd71c..66c67db1b86f7e 100644 --- a/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks4.sql +++ b/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks4.sql @@ -5,9 +5,9 @@ SELECT FROM ( SELECT - cast(v:repo.name as string), - CASE WHEN cast(v:type as string) = 'ForkEvent' THEN 1 ELSE 0 END AS fork, - CASE WHEN cast(v:type as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star + cast(v["repo"]["name"] as string), + CASE WHEN cast(v["type"] as string) = 'ForkEvent' THEN 1 ELSE 0 END AS fork, + CASE WHEN cast(v["type"] as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star FROM github_events - WHERE cast(v:type as string) IN ('ForkEvent', 'WatchEvent') + WHERE cast(v["type"] as string) IN ('ForkEvent', 'WatchEvent') ) t diff --git a/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks5.sql b/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks5.sql index 22606e7eefd701..3579b794114e08 100644 --- a/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks5.sql +++ b/regression-test/suites/variant_github_events_p0/proportionsBetweenStarsAndForks5.sql @@ -10,11 +10,11 @@ FROM FROM ( SELECT - cast(v:repo.name as string) as repo_name, - CASE WHEN cast(v:type as string) = 'ForkEvent' THEN 1 ELSE 0 END AS fork, - CASE WHEN cast(v:type as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star + cast(v["repo"]["name"] as string) as repo_name, + CASE WHEN cast(v["type"] as string) = 'ForkEvent' THEN 1 ELSE 0 END AS fork, + CASE WHEN cast(v["type"] as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star FROM github_events - WHERE cast(v:type as string) IN ('ForkEvent', 'WatchEvent') + WHERE cast(v["type"] as string) IN ('ForkEvent', 'WatchEvent') ) t GROUP BY repo_name HAVING stars > 10 diff --git a/regression-test/suites/variant_github_events_p0/repositoriesByAmountOfModifiedCode.sql b/regression-test/suites/variant_github_events_p0/repositoriesByAmountOfModifiedCode.sql index f27a32bbff7df1..6c1632769f3d9f 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesByAmountOfModifiedCode.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesByAmountOfModifiedCode.sql @@ -1,11 +1,11 @@ -SELECT - cast(v:repo.name as string) as repo_name, +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false,disable_streaming_preaggregations=false) */ + cast(v["repo"]["name"] as string) as repo_name, count() AS prs, - count(distinct cast(v:actor.login as string)) AS authors, - sum(cast(v:payload.pull_request.additions as int)) AS adds, - sum(cast(v:payload.pull_request.deletions as int)) AS dels + count(distinct cast(v["actor"]["login"] as string)) AS authors, + sum(cast(v["payload"]["pull_request"]["additions"] as int)) AS adds, + sum(cast(v["payload"]["pull_request"]["deletions"] as int)) AS dels FROM github_events -WHERE (cast(v:type as string) = 'PullRequestEvent') AND (cast(v:payload.action as string) = 'opened') AND (cast(v:payload.pull_request.additions as int) < 10000) AND (cast(v:payload.pull_request.deletions as int) < 10000) +WHERE (cast(v["type"] as string) = 'PullRequestEvent') AND (cast(v["payload"]["action"] as string) = 'opened') AND (cast(v["payload"]["pull_request"]["additions"] as int) < 10000) AND (cast(v["payload"]["pull_request"]["deletions"] as int) < 10000) GROUP BY repo_name HAVING (adds / dels) < 10 ORDER BY adds + dels DESC, 1 diff --git a/regression-test/suites/variant_github_events_p0/repositoriesByTheNumberOfPushes.sql b/regression-test/suites/variant_github_events_p0/repositoriesByTheNumberOfPushes.sql index 7eb47a659487ff..e37ced4083887d 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesByTheNumberOfPushes.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesByTheNumberOfPushes.sql @@ -1,17 +1,17 @@ SELECT - cast(v:repo.name as string), + cast(v["repo"]["name"] as string), count() AS pushes, - count(distinct cast(v:actor.login as string)) AS authors + count(distinct cast(v["actor"]["login"] as string)) AS authors FROM github_events -WHERE (cast(v:type as string) = 'PushEvent') AND (cast(v:repo.name as string) IN +WHERE (cast(v["type"] as string) = 'PushEvent') AND (cast(v["repo"]["name"] as string) IN ( - SELECT cast(v:repo.name as string) + SELECT cast(v["repo"]["name"] as string) FROM github_events - WHERE cast(v:type as string) = 'WatchEvent' - GROUP BY cast(v:repo.name as string) + WHERE cast(v["type"] as string) = 'WatchEvent' + GROUP BY cast(v["repo"]["name"] as string) ORDER BY count() DESC LIMIT 10000 )) -GROUP BY cast(v:repo.name as string) -ORDER BY count() DESC, cast(v:repo.name as string) +GROUP BY cast(v["repo"]["name"] as string) +ORDER BY count() DESC, cast(v["repo"]["name"] as string) LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithClickhouse_related_comments1.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithClickhouse_related_comments1.sql index af1faa72586f9d..1dba0577e78d9e 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithClickhouse_related_comments1.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithClickhouse_related_comments1.sql @@ -1 +1 @@ -SELECT cast(v:repo.name as string), count() FROM github_events WHERE lower(cast(v:payload.comment.body as string)) LIKE '%apache%' GROUP BY cast(v:repo.name as string) ORDER BY count() DESC, cast(v:repo.name as string) ASC LIMIT 50 \ No newline at end of file +SELECT cast(v["repo"]["name"] as string), count() FROM github_events WHERE lower(cast(v["payload"]["comment"]["body"] as string)) LIKE '%apache%' GROUP BY cast(v["repo"]["name"] as string) ORDER BY count() DESC, cast(v["repo"]["name"] as string) ASC LIMIT 50 \ No newline at end of file diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithClickhouse_related_comments2.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithClickhouse_related_comments2.sql index af974bcf669890..15b5adf3fb2bb8 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithClickhouse_related_comments2.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithClickhouse_related_comments2.sql @@ -5,11 +5,11 @@ SELECT FROM ( SELECT - cast(v:repo.name as string) as repo_name, - CASE WHEN cast(v:type as string) = 'WatchEvent' THEN 1 ELSE 0 END AS num_star, - CASE WHEN lower(cast(v:payload.comment.body as string)) LIKE '%apache%' THEN 1 ELSE 0 END AS num_comment + cast(v["repo"]["name"] as string) as repo_name, + CASE WHEN cast(v["type"] as string) = 'WatchEvent' THEN 1 ELSE 0 END AS num_star, + CASE WHEN lower(cast(v["payload"]["comment"]["body"] as string)) LIKE '%apache%' THEN 1 ELSE 0 END AS num_comment FROM github_events - WHERE (lower(cast(v:payload.comment.body as string)) LIKE '%apache%') OR (cast(v:type as string) = 'WatchEvent') + WHERE (lower(cast(v["payload"]["comment"]["body"] as string)) LIKE '%apache%') OR (cast(v["type"] as string) = 'WatchEvent') ) t GROUP BY repo_name HAVING num_comments > 0 diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithDoris_related_comments1.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithDoris_related_comments1.sql index 7c3aa1931ade51..15f7de0c3b9239 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithDoris_related_comments1.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithDoris_related_comments1.sql @@ -1 +1 @@ -SELECT cast(v:repo.name as string), count() FROM github_events WHERE lower(cast(v:payload.comment.body as string)) LIKE '%spark%' GROUP BY cast(v:repo.name as string) ORDER BY count() DESC, cast(v:repo.name as string) ASC LIMIT 50 \ No newline at end of file +SELECT cast(v["repo"]["name"] as string), count() FROM github_events WHERE lower(cast(v["payload"]["comment"]["body"] as string)) LIKE '%spark%' GROUP BY cast(v["repo"]["name"] as string) ORDER BY count() DESC, cast(v["repo"]["name"] as string) ASC LIMIT 50 \ No newline at end of file diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithDoris_related_comments2.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithDoris_related_comments2.sql index 76da89584b4d56..17a055f65495b4 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithDoris_related_comments2.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithDoris_related_comments2.sql @@ -5,11 +5,11 @@ SELECT FROM ( SELECT - cast(v:repo.name as string) as repo_name, - CASE WHEN cast(v:type as string) = 'WatchEvent' THEN 1 ELSE 0 END AS num_star, - CASE WHEN lower(cast(v:payload.comment.body as string)) LIKE '%spark%' THEN 1 ELSE 0 END AS num_comment + cast(v["repo"]["name"] as string) as repo_name, + CASE WHEN cast(v["type"] as string) = 'WatchEvent' THEN 1 ELSE 0 END AS num_star, + CASE WHEN lower(cast(v["payload"]["comment"]["body"] as string)) LIKE '%spark%' THEN 1 ELSE 0 END AS num_comment FROM github_events - WHERE (lower(cast(v:payload.comment.body as string)) LIKE '%spark%') OR (cast(v:type as string) = 'WatchEvent') + WHERE (lower(cast(v["payload"]["comment"]["body"] as string)) LIKE '%spark%') OR (cast(v["type"] as string) = 'WatchEvent') ) t GROUP BY repo_name HAVING num_comments > 0 diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithTheHighestGrowthYoY.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithTheHighestGrowthYoY.sql index e8ba7153a76336..b5270ee38f1098 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithTheHighestGrowthYoY.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithTheHighestGrowthYoY.sql @@ -7,12 +7,12 @@ SELECT FROM ( SELECT - cast(v:repo.name as string) as repo_name, - CASE year(cast(v:created_at as datetime)) WHEN 2022 THEN 1 ELSE 0 END AS created_at_2022, - CASE year(cast(v:created_at as datetime)) WHEN 2015 THEN 1 ELSE 0 END AS created_at_2015, - cast(v:created_at as datetime) as created_at + cast(v["repo"]["name"] as string) as repo_name, + CASE year(cast(v["created_at"] as datetime)) WHEN 2022 THEN 1 ELSE 0 END AS created_at_2022, + CASE year(cast(v["created_at"] as datetime)) WHEN 2015 THEN 1 ELSE 0 END AS created_at_2015, + cast(v["created_at"] as datetime) as created_at FROM github_events - WHERE cast(v:type as string) = 'WatchEvent' + WHERE cast(v["type"] as string) = 'WatchEvent' ) t GROUP BY repo_name HAVING (min(created_at) <= '2023-01-01 00:00:00') AND (stars2022 >= 1) and (stars2015 >= 1) diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfIssues1.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfIssues1.sql index c308adf4239bb2..93164a4cfe1d41 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfIssues1.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfIssues1.sql @@ -1 +1 @@ -SELECT cast(v:repo.name as string), count() AS c, count(distinct cast(v:actor.login as string)) AS u FROM github_events WHERE cast(v:type as string) = 'IssuesEvent' AND cast(v:payload.action as string) = 'opened' GROUP BY cast(v:repo.name as string) ORDER BY c DESC, cast(v:repo.name as string) LIMIT 50 +SELECT cast(v["repo"]["name"] as string), count() AS c, count(distinct cast(v["actor"]["login"] as string)) AS u FROM github_events WHERE cast(v["type"] as string) = 'IssuesEvent' AND cast(v["payload"]["action"] as string) = 'opened' GROUP BY cast(v["repo"]["name"] as string) ORDER BY c DESC, cast(v["repo"]["name"] as string) LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfIssues2.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfIssues2.sql index fb977cb8176186..cfddc738371827 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfIssues2.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfIssues2.sql @@ -6,12 +6,12 @@ SELECT FROM ( SELECT - cast(v:repo.name as string) as repo_name, - CASE WHEN (cast(v:type as string) = 'IssuesEvent') AND (cast(v:payload.action as string) = 'opened') THEN 1 ELSE 0 END AS issue_created, - CASE WHEN cast(v:type as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star, - CASE WHEN (cast(v:type as string) = 'IssuesEvent') AND (cast(v:payload.action as string) = 'opened') THEN cast(v:actor.login as string) ELSE NULL END AS actor_login + cast(v["repo"]["name"] as string) as repo_name, + CASE WHEN (cast(v["type"] as string) = 'IssuesEvent') AND (cast(v["payload"]["action"] as string) = 'opened') THEN 1 ELSE 0 END AS issue_created, + CASE WHEN cast(v["type"] as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star, + CASE WHEN (cast(v["type"] as string) = 'IssuesEvent') AND (cast(v["payload"]["action"] as string) = 'opened') THEN cast(v["actor"]["login"] as string) ELSE NULL END AS actor_login FROM github_events - WHERE cast(v:type as string) IN ('IssuesEvent', 'WatchEvent') + WHERE cast(v["type"] as string) IN ('IssuesEvent', 'WatchEvent') ) t GROUP BY repo_name ORDER BY c DESC, repo_name diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfIssues3.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfIssues3.sql index 370cd1ba45f108..60759a10199068 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfIssues3.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfIssues3.sql @@ -6,12 +6,12 @@ SELECT FROM ( SELECT - cast(v:repo.name as string) as repo_name, - CASE WHEN (cast(v:type as string) = 'IssuesEvent') AND (cast(v:payload.action as string) = 'opened') THEN 1 ELSE 0 END AS issue_created, - CASE WHEN cast(v:type as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star, - CASE WHEN (cast(v:type as string) = 'IssuesEvent') AND (cast(v:payload.action as string) = 'opened') THEN cast(v:actor.login as string) ELSE NULL END AS actor_login + cast(v["repo"]["name"] as string) as repo_name, + CASE WHEN (cast(v["type"] as string) = 'IssuesEvent') AND (cast(v["payload"]["action"] as string) = 'opened') THEN 1 ELSE 0 END AS issue_created, + CASE WHEN cast(v["type"] as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star, + CASE WHEN (cast(v["type"] as string) = 'IssuesEvent') AND (cast(v["payload"]["action"] as string) = 'opened') THEN cast(v["actor"]["login"] as string) ELSE NULL END AS actor_login FROM github_events - WHERE cast(v:type as string) IN ('IssuesEvent', 'WatchEvent') + WHERE cast(v["type"] as string) IN ('IssuesEvent', 'WatchEvent') ) t GROUP BY repo_name HAVING stars >= 10 diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfIssues4.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfIssues4.sql index 88d7dca5c33650..756e6f6bd95da5 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfIssues4.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfIssues4.sql @@ -6,12 +6,12 @@ SELECT FROM ( SELECT - cast(v:repo.name as string) as repo_name, - CASE WHEN (cast(v:type as string) = 'IssuesEvent') AND (cast(v:payload.action as string) = 'opened') THEN 1 ELSE 0 END AS issue_created, - CASE WHEN cast(v:type as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star, - CASE WHEN (cast(v:type as string) = 'IssuesEvent') AND (cast(v:payload.action as string) = 'opened') THEN cast(v:actor.login as string) ELSE NULL END AS actor_login + cast(v["repo"]["name"] as string) as repo_name, + CASE WHEN (cast(v["type"] as string) = 'IssuesEvent') AND (cast(v["payload"]["action"] as string) = 'opened') THEN 1 ELSE 0 END AS issue_created, + CASE WHEN cast(v["type"] as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star, + CASE WHEN (cast(v["type"] as string) = 'IssuesEvent') AND (cast(v["payload"]["action"] as string) = 'opened') THEN cast(v["actor"]["login"] as string) ELSE NULL END AS actor_login FROM github_events - WHERE cast(v:type as string) IN ('IssuesEvent', 'WatchEvent') + WHERE cast(v["type"] as string) IN ('IssuesEvent', 'WatchEvent') ) t GROUP BY repo_name ORDER BY u, c, stars DESC, 1 diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfPullRequests1.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfPullRequests1.sql index dab00b81300665..f0c505210633a6 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfPullRequests1.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfPullRequests1.sql @@ -1 +1 @@ -SELECT cast(v:repo.name as string) as repo_name, count(), count(distinct cast(v:actor.login as string)) FROM github_events WHERE cast(v:type as string) = 'PullRequestEvent' AND cast(v:payload.action as string) = 'opened' GROUP BY cast(v:repo.name as string) ORDER BY 2,1,3 DESC LIMIT 50 \ No newline at end of file +SELECT cast(v["repo"]["name"] as string) as repo_name, count(), count(distinct cast(v["actor"]["login"] as string)) FROM github_events WHERE cast(v["type"] as string) = 'PullRequestEvent' AND cast(v["payload"]["action"] as string) = 'opened' GROUP BY cast(v["repo"]["name"] as string) ORDER BY 2,1,3 DESC LIMIT 50 \ No newline at end of file diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfPullRequests2.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfPullRequests2.sql index 741607d4dfe191..bba2a4c898107d 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfPullRequests2.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumAmountOfPullRequests2.sql @@ -1 +1 @@ -SELECT cast(v:repo.name as string), count(), count(distinct cast(v:actor.login as string)) AS u FROM github_events WHERE cast(v:type as string) = 'PullRequestEvent' AND cast(v:payload.action as string) = 'opened' GROUP BY cast(v:repo.name as string) ORDER BY u DESC, 2 DESC, 1 LIMIT 50 +SELECT cast(v["repo"]["name"] as string), count(), count(distinct cast(v["actor"]["login"] as string)) AS u FROM github_events WHERE cast(v["type"] as string) = 'PullRequestEvent' AND cast(v["payload"]["action"] as string) = 'opened' GROUP BY cast(v["repo"]["name"] as string) ORDER BY u DESC, 2 DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumNumberOfAcceptedInvitations.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumNumberOfAcceptedInvitations.sql index 404b2cf7652900..36aa448c66acba 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumNumberOfAcceptedInvitations.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMaximumNumberOfAcceptedInvitations.sql @@ -5,11 +5,11 @@ SELECT FROM ( SELECT - cast(v:repo.name as string) as repo_name, - CASE WHEN cast(v:type as string) = 'MemberEvent' THEN 1 ELSE 0 END AS invitation, - CASE WHEN cast(v:type as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star + cast(v["repo"]["name"] as string) as repo_name, + CASE WHEN cast(v["type"] as string) = 'MemberEvent' THEN 1 ELSE 0 END AS invitation, + CASE WHEN cast(v["type"] as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star FROM github_events - WHERE cast(v:type as string) IN ('MemberEvent', 'WatchEvent') + WHERE cast(v["type"] as string) IN ('MemberEvent', 'WatchEvent') ) t GROUP BY repo_name HAVING stars >= 2 diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostPeopleWhoHavePushAccess1.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostPeopleWhoHavePushAccess1.sql index d94bcb149b54d3..329cfc908b6654 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostPeopleWhoHavePushAccess1.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostPeopleWhoHavePushAccess1.sql @@ -5,9 +5,9 @@ SELECT FROM ( SELECT - lower(cast(v:repo.name as string)) as repo_name, - CASE WHEN cast(v:type as string) = 'PushEvent' THEN cast(v:actor.login as string) ELSE NULL END AS actor_login, - CASE WHEN cast(v:type as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star - FROM github_events WHERE cast(v:type as string) IN ('PushEvent', 'WatchEvent') AND cast(v:repo.name as string) != '/' + lower(cast(v["repo"]["name"] as string)) as repo_name, + CASE WHEN cast(v["type"] as string) = 'PushEvent' THEN cast(v["actor"]["login"] as string) ELSE NULL END AS actor_login, + CASE WHEN cast(v["type"] as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star + FROM github_events WHERE cast(v["type"] as string) IN ('PushEvent', 'WatchEvent') AND cast(v["repo"]["name"] as string) != '/' ) t GROUP BY repo_name ORDER BY u, stars, repo_name DESC LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostPeopleWhoHavePushAccess2.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostPeopleWhoHavePushAccess2.sql index 88a92a06b6ba46..410f69c47a58c9 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostPeopleWhoHavePushAccess2.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostPeopleWhoHavePushAccess2.sql @@ -1,13 +1,13 @@ -- SELECT --- cast(v:repo.name as string), --- count(distinct cast(v:actor.login as string)) AS u, +-- cast(v["repo"]["name"] as string), +-- count(distinct cast(v["actor"]["login"] as string)) AS u, -- sum(star) AS stars -- FROM -- ( -- SELECT --- cast(v:repo.name as string), --- CASE WHEN cast(v:type as string) = 'PushEvent' AND (ref LIKE '%/master' OR ref LIKE '%/main') THEN cast(v:actor.login as string) ELSE NULL END AS cast(v:actor.login as string), --- CASE WHEN cast(v:type as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star --- FROM github_events WHERE cast(v:type as string) IN ('PushEvent', 'WatchEvent') AND cast(v:repo.name as string) != '/' +-- cast(v["repo"]["name"] as string), +-- CASE WHEN cast(v["type"] as string) = 'PushEvent' AND (ref LIKE '%/master' OR ref LIKE '%/main') THEN cast(v["actor"]["login"] as string) ELSE NULL END AS cast(v["actor"]["login"] as string), +-- CASE WHEN cast(v["type"] as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star +-- FROM github_events WHERE cast(v["type"] as string) IN ('PushEvent', 'WatchEvent') AND cast(v["repo"]["name"] as string) != '/' -- ) t --- GROUP BY cast(v:repo.name as string) ORDER BY u DESC LIMIT 50 +-- GROUP BY cast(v["repo"]["name"] as string) ORDER BY u DESC LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostPeopleWhoHavePushAccess3.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostPeopleWhoHavePushAccess3.sql index 28498c7a3edc0f..dbcf16db2ac195 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostPeopleWhoHavePushAccess3.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostPeopleWhoHavePushAccess3.sql @@ -1,16 +1,16 @@ -- SELECT --- cast(v:repo.name as string), --- count(distinct cast(v:actor.login as string)) AS u, +-- cast(v["repo"]["name"] as string), +-- count(distinct cast(v["actor"]["login"] as string)) AS u, -- sum(star) AS stars -- FROM -- ( -- SELECT --- cast(v:repo.name as string), --- CASE WHEN cast(v:type as string) = 'PushEvent' AND (ref LIKE '%/master' OR ref LIKE '%/main') THEN cast(v:actor.login as string) ELSE NULL END AS cast(v:actor.login as string), --- CASE WHEN cast(v:type as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star --- FROM github_events WHERE cast(v:type as string) IN ('PushEvent', 'WatchEvent') AND cast(v:repo.name as string) != '/' +-- cast(v["repo"]["name"] as string), +-- CASE WHEN cast(v["type"] as string) = 'PushEvent' AND (ref LIKE '%/master' OR ref LIKE '%/main') THEN cast(v["actor"]["login"] as string) ELSE NULL END AS cast(v["actor"]["login"] as string), +-- CASE WHEN cast(v["type"] as string) = 'WatchEvent' THEN 1 ELSE 0 END AS star +-- FROM github_events WHERE cast(v["type"] as string) IN ('PushEvent', 'WatchEvent') AND cast(v["repo"]["name"] as string) != '/' -- ) t --- GROUP BY cast(v:repo.name as string) +-- GROUP BY cast(v["repo"]["name"] as string) -- HAVING stars >= 100 -- ORDER BY u DESC -- LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostStarsOverOneDay1.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostStarsOverOneDay1.sql index c7b81b2408db36..1e6fdb4b769348 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostStarsOverOneDay1.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostStarsOverOneDay1.sql @@ -12,12 +12,12 @@ FROM FROM ( SELECT - cast(v:repo.name as string) as repo_name, - to_date(cast(v:created_at as datetime)) AS day, + cast(v["repo"]["name"] as string) as repo_name, + to_date(cast(v["created_at"] as datetime)) AS day, count() AS stars FROM github_events - WHERE cast(v:type as string) = 'WatchEvent' - GROUP BY cast(v:repo.name as string), day + WHERE cast(v["type"] as string) = 'WatchEvent' + GROUP BY cast(v["repo"]["name"] as string), day ) t1 ) t2 WHERE rank = 1 diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostStarsOverOneDay2.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostStarsOverOneDay2.sql index 9f07d2270d14a9..92a1c9a9c6e005 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostStarsOverOneDay2.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostStarsOverOneDay2.sql @@ -1,23 +1,23 @@ -- SELECT --- cast(v:repo.name as string), +-- cast(v["repo"]["name"] as string), -- day, -- stars -- FROM -- ( -- SELECT --- row_number() OVER (PARTITION BY cast(v:repo.name as string) ORDER BY stars DESC) AS rank, --- cast(v:repo.name as string), +-- row_number() OVER (PARTITION BY cast(v["repo"]["name"] as string) ORDER BY stars DESC) AS rank, +-- cast(v["repo"]["name"] as string), -- day, -- stars -- FROM -- ( -- SELECT --- cast(v:repo.name as string), --- to_date(cast(v:created_at as datetime)) AS day, +-- cast(v["repo"]["name"] as string), +-- to_date(cast(v["created_at"] as datetime)) AS day, -- count() AS stars -- FROM github_events --- WHERE cast(v:type as string) = 'WatchEvent' --- GROUP BY cast(v:repo.name as string), day +-- WHERE cast(v["type"] as string) = 'WatchEvent' +-- GROUP BY cast(v["repo"]["name"] as string), day -- ) t1 -- ) t2 -- WHERE rank = 1 diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostStarsOverOneDay3.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostStarsOverOneDay3.sql index c0ac82e9151339..29fd779ffa3b44 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostStarsOverOneDay3.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostStarsOverOneDay3.sql @@ -1 +1 @@ --- SELECT cast(v:repo.name as string), cast(v:created_at as datetime), count() AS stars FROM github_events WHERE cast(v:type as string) = 'WatchEvent' GROUP BY cast(v:repo.name as string), cast(v:created_at as datetime) ORDER BY count() DESC LIMIT 50 +-- SELECT cast(v["repo"]["name"] as string), cast(v["created_at"] as datetime), count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY cast(v["repo"]["name"] as string), cast(v["created_at"] as datetime) ORDER BY count() DESC LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostSteadyGrowthOverTime.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostSteadyGrowthOverTime.sql index 5c7d2d7c7b0b4d..5d05e3cb8db80c 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostSteadyGrowthOverTime.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithTheMostSteadyGrowthOverTime.sql @@ -6,11 +6,11 @@ SELECT FROM ( SELECT - cast(v:repo.name as string) as repo_name, - to_date(cast(v:created_at as datetime)) AS day, + cast(v["repo"]["name"] as string) as repo_name, + to_date(cast(v["created_at"] as datetime)) AS day, count() AS stars FROM github_events - WHERE cast(v:type as string) = 'WatchEvent' + WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY repo_name, day diff --git a/regression-test/suites/variant_github_events_p0/repositoriesWithTheWorstStagnation_order.sql b/regression-test/suites/variant_github_events_p0/repositoriesWithTheWorstStagnation_order.sql index 2265f4b5e4fe2b..f0019d643306fc 100644 --- a/regression-test/suites/variant_github_events_p0/repositoriesWithTheWorstStagnation_order.sql +++ b/regression-test/suites/variant_github_events_p0/repositoriesWithTheWorstStagnation_order.sql @@ -7,12 +7,12 @@ SELECT FROM ( SELECT - cast(v:repo.name as string) as repo_name, - CASE year(cast(v:created_at as datetime)) WHEN 2022 THEN 1 ELSE 0 END AS created_at_2022, - CASE year(cast(v:created_at as datetime)) WHEN 2015 THEN 1 ELSE 0 END AS created_at_2015, - cast(v:created_at as datetime) as created_at + cast(v["repo"]["name"] as string) as repo_name, + CASE year(cast(v["created_at"] as datetime)) WHEN 2022 THEN 1 ELSE 0 END AS created_at_2022, + CASE year(cast(v["created_at"] as datetime)) WHEN 2015 THEN 1 ELSE 0 END AS created_at_2015, + cast(v["created_at"] as datetime) as created_at FROM github_events - WHERE cast(v:type as string) = 'WatchEvent' + WHERE cast(v["type"] as string) = 'WatchEvent' ) t GROUP BY repo_name HAVING (min(created_at) <= '2019-01-01 00:00:00') AND (max(created_at) >= '2020-06-01 00:00:00') AND (stars2015 >= 2) diff --git a/regression-test/suites/variant_github_events_p0/repositoryAffinityList1.sql b/regression-test/suites/variant_github_events_p0/repositoryAffinityList1.sql index 99b9f28a2bd553..d1c3b8150d6a34 100644 --- a/regression-test/suites/variant_github_events_p0/repositoryAffinityList1.sql +++ b/regression-test/suites/variant_github_events_p0/repositoryAffinityList1.sql @@ -1,13 +1,13 @@ SELECT - cast(v:repo.name as string) as repo_name, + cast(v["repo"]["name"] as string) as repo_name, count() AS stars FROM github_events -WHERE (cast(v:type as string) = 'WatchEvent') AND (cast(v:actor.login as string) IN +WHERE (cast(v["type"] as string) = 'WatchEvent') AND (cast(v["actor"]["login"] as string) IN ( - SELECT cast(v:actor.login as string) + SELECT cast(v["actor"]["login"] as string) FROM github_events - WHERE (cast(v:type as string) = 'WatchEvent') AND (cast(v:repo.name as string) IN ('apache/spark', 'prakhar1989/awesome-courses')) -)) AND (cast(v:repo.name as string) NOT IN ('ClickHouse/ClickHouse', 'yandex/ClickHouse')) + WHERE (cast(v["type"] as string) = 'WatchEvent') AND (cast(v["repo"]["name"] as string) IN ('apache/spark', 'prakhar1989/awesome-courses')) +)) AND (cast(v["repo"]["name"] as string) NOT IN ('ClickHouse/ClickHouse', 'yandex/ClickHouse')) GROUP BY repo_name ORDER BY stars DESC, repo_name LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/repositoryAffinityList2.sql b/regression-test/suites/variant_github_events_p0/repositoryAffinityList2.sql index 4c7f36b518eb3a..293f4b90396189 100644 --- a/regression-test/suites/variant_github_events_p0/repositoryAffinityList2.sql +++ b/regression-test/suites/variant_github_events_p0/repositoryAffinityList2.sql @@ -5,19 +5,19 @@ SELECT FROM ( SELECT - cast(v:repo.name as string) as repo_name, - count(distinct cast(v:actor.login as string)) AS total_stars + cast(v["repo"]["name"] as string) as repo_name, + count(distinct cast(v["actor"]["login"] as string)) AS total_stars FROM github_events - WHERE (cast(v:type as string) = 'WatchEvent') AND (cast(v:repo.name as string) NOT IN ('apache/spark')) + WHERE (cast(v["type"] as string) = 'WatchEvent') AND (cast(v["repo"]["name"] as string) NOT IN ('apache/spark')) GROUP BY repo_name HAVING total_stars >= 10 ) t1 JOIN ( SELECT - count(distinct cast(v:actor.login as string)) AS spark_stars + count(distinct cast(v["actor"]["login"] as string)) AS spark_stars FROM github_events - WHERE (cast(v:type as string) = 'WatchEvent') AND (cast(v:repo.name as string) IN ('apache/spark')) + WHERE (cast(v["type"] as string) = 'WatchEvent') AND (cast(v["repo"]["name"] as string) IN ('apache/spark')) ) t2 ORDER BY ratio DESC, repo_name LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/starsFromHeavyGithubUsers1.sql b/regression-test/suites/variant_github_events_p0/starsFromHeavyGithubUsers1.sql index 01dfd4f0e8d50f..ba9f4ab2604644 100644 --- a/regression-test/suites/variant_github_events_p0/starsFromHeavyGithubUsers1.sql +++ b/regression-test/suites/variant_github_events_p0/starsFromHeavyGithubUsers1.sql @@ -1,13 +1,13 @@ SELECT - cast(v:repo.name as string), + cast(v["repo"]["name"] as string), count() FROM github_events -WHERE (cast(v:type as string) = 'WatchEvent') AND (cast(v:actor.login as string) IN +WHERE (cast(v["type"] as string) = 'WatchEvent') AND (cast(v["actor"]["login"] as string) IN ( - SELECT cast(v:actor.login as string) + SELECT cast(v["actor"]["login"] as string) FROM github_events - WHERE (cast(v:type as string) = 'PullRequestEvent') AND (cast(v:payload.action as string) = 'opened') + WHERE (cast(v["type"] as string) = 'PullRequestEvent') AND (cast(v["payload"]["action"] as string) = 'opened') )) -GROUP BY cast(v:repo.name as string) -ORDER BY count() DESC, cast(v:repo.name as string) +GROUP BY cast(v["repo"]["name"] as string) +ORDER BY count() DESC, cast(v["repo"]["name"] as string) LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/starsFromHeavyGithubUsers2.sql b/regression-test/suites/variant_github_events_p0/starsFromHeavyGithubUsers2.sql index 500ae5b9a00806..c55c37a294ad6e 100644 --- a/regression-test/suites/variant_github_events_p0/starsFromHeavyGithubUsers2.sql +++ b/regression-test/suites/variant_github_events_p0/starsFromHeavyGithubUsers2.sql @@ -1,15 +1,15 @@ SELECT - cast(v:repo.name as string), + cast(v["repo"]["name"] as string), count() FROM github_events -WHERE (cast(v:type as string) = 'WatchEvent') AND (cast(v:actor.login as string) IN +WHERE (cast(v["type"] as string) = 'WatchEvent') AND (cast(v["actor"]["login"] as string) IN ( - SELECT cast(v:actor.login as string) + SELECT cast(v["actor"]["login"] as string) FROM github_events - WHERE (cast(v:type as string) = 'PullRequestEvent') AND (cast(v:payload.action as string) = 'opened') - GROUP BY cast(v:actor.login as string) + WHERE (cast(v["type"] as string) = 'PullRequestEvent') AND (cast(v["payload"]["action"] as string) = 'opened') + GROUP BY cast(v["actor"]["login"] as string) HAVING count() >= 2 )) -GROUP BY cast(v:repo.name as string) +GROUP BY cast(v["repo"]["name"] as string) ORDER BY 1, count() DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/theLongestRepositoryNames1.sql b/regression-test/suites/variant_github_events_p0/theLongestRepositoryNames1.sql index 0603fec97bddee..117dc222667faa 100644 --- a/regression-test/suites/variant_github_events_p0/theLongestRepositoryNames1.sql +++ b/regression-test/suites/variant_github_events_p0/theLongestRepositoryNames1.sql @@ -1 +1 @@ -SELECT count(), cast(v:repo.name as string) FROM github_events WHERE cast(v:type as string) = 'WatchEvent' GROUP BY cast(v:repo.name as string) ORDER BY length(cast(v:repo.name as string)) DESC, cast(v:repo.name as string) LIMIT 50 +SELECT count(), cast(v["repo"]["name"] as string) FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY cast(v["repo"]["name"] as string) ORDER BY length(cast(v["repo"]["name"] as string)) DESC, cast(v["repo"]["name"] as string) LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/theLongestRepositoryNames2.sql b/regression-test/suites/variant_github_events_p0/theLongestRepositoryNames2.sql index 244f58e3fffe3c..203b253d8897e9 100644 --- a/regression-test/suites/variant_github_events_p0/theLongestRepositoryNames2.sql +++ b/regression-test/suites/variant_github_events_p0/theLongestRepositoryNames2.sql @@ -1 +1 @@ -SELECT cast(v:repo.name as string), count() FROM github_events WHERE cast(v:type as string) = 'WatchEvent' AND cast(v:repo.name as string) LIKE '%_/_%' GROUP BY cast(v:repo.name as string) ORDER BY length(cast(v:repo.name as string)) ASC, cast(v:repo.name as string) LIMIT 50 +SELECT cast(v["repo"]["name"] as string), count() FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND cast(v["repo"]["name"] as string) LIKE '%_/_%' GROUP BY cast(v["repo"]["name"] as string) ORDER BY length(cast(v["repo"]["name"] as string)) ASC, cast(v["repo"]["name"] as string) LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/theMostToughCodeReviews.sql b/regression-test/suites/variant_github_events_p0/theMostToughCodeReviews.sql index 46a896f79552dd..670a70ff725e63 100644 --- a/regression-test/suites/variant_github_events_p0/theMostToughCodeReviews.sql +++ b/regression-test/suites/variant_github_events_p0/theMostToughCodeReviews.sql @@ -1,10 +1,10 @@ SELECT - concat('https://github.com/', cast(v:repo.name as string), '/pull/') AS URL, - count(distinct cast(v:actor.login as string)) AS authors + concat('https://github.com/', cast(v["repo"]["name"] as string), '/pull/') AS URL, + count(distinct cast(v["actor"]["login"] as string)) AS authors FROM github_events -WHERE (cast(v:type as string) = 'PullRequestReviewCommentEvent') AND (cast(v:payload.action as string) = 'created') +WHERE (cast(v["type"] as string) = 'PullRequestReviewCommentEvent') AND (cast(v["payload"]["action"] as string) = 'created') GROUP BY - cast(v:repo.name as string), - cast(v:payload.issue.`number` as string) + cast(v["repo"]["name"] as string), + cast(v["payload"]["issue"]["number"] as string) ORDER BY authors DESC, URL ASC LIMIT 50 \ No newline at end of file diff --git a/regression-test/suites/variant_github_events_p0/theTotalNumberOfRepositoriesOnGithub.sql b/regression-test/suites/variant_github_events_p0/theTotalNumberOfRepositoriesOnGithub.sql index 1d29c3eeb4cb03..9fdc19bfcef5ad 100644 --- a/regression-test/suites/variant_github_events_p0/theTotalNumberOfRepositoriesOnGithub.sql +++ b/regression-test/suites/variant_github_events_p0/theTotalNumberOfRepositoriesOnGithub.sql @@ -1 +1 @@ -SELECT count(distinct cast(v:repo.name as string)) FROM github_events +SELECT count(distinct cast(v["repo"]["name"] as string)) FROM github_events diff --git a/regression-test/suites/variant_github_events_p0/theTotalNumberOfUsersOnGithub1.sql b/regression-test/suites/variant_github_events_p0/theTotalNumberOfUsersOnGithub1.sql index 044aa0470bc812..56f9ddf94732b7 100644 --- a/regression-test/suites/variant_github_events_p0/theTotalNumberOfUsersOnGithub1.sql +++ b/regression-test/suites/variant_github_events_p0/theTotalNumberOfUsersOnGithub1.sql @@ -1 +1 @@ -SELECT count(distinct cast(v:actor.login as string)) FROM github_events +SELECT count(distinct cast(v["actor"]["login"] as string)) FROM github_events diff --git a/regression-test/suites/variant_github_events_p0/theTotalNumberOfUsersOnGithub2.sql b/regression-test/suites/variant_github_events_p0/theTotalNumberOfUsersOnGithub2.sql index 12776f1bb23f38..f2ed81a78bd086 100644 --- a/regression-test/suites/variant_github_events_p0/theTotalNumberOfUsersOnGithub2.sql +++ b/regression-test/suites/variant_github_events_p0/theTotalNumberOfUsersOnGithub2.sql @@ -1 +1 @@ -SELECT count(distinct cast(v:actor.login as string)) FROM github_events WHERE cast(v:type as string) = 'WatchEvent' +SELECT count(distinct cast(v["actor"]["login"] as string)) FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' diff --git a/regression-test/suites/variant_github_events_p0/theTotalNumberOfUsersOnGithub3.sql b/regression-test/suites/variant_github_events_p0/theTotalNumberOfUsersOnGithub3.sql index 84546032778865..3a2dd0c08b3431 100644 --- a/regression-test/suites/variant_github_events_p0/theTotalNumberOfUsersOnGithub3.sql +++ b/regression-test/suites/variant_github_events_p0/theTotalNumberOfUsersOnGithub3.sql @@ -1 +1 @@ -SELECT count(distinct cast(v:actor.login as string)) FROM github_events WHERE cast(v:type as string) = 'PushEvent' +SELECT count(distinct cast(v["actor"]["login"] as string)) FROM github_events WHERE cast(v["type"] as string) = 'PushEvent' diff --git a/regression-test/suites/variant_github_events_p0/theTotalNumberOfUsersOnGithub4.sql b/regression-test/suites/variant_github_events_p0/theTotalNumberOfUsersOnGithub4.sql index 384b232f4fa751..59410fa57bc72d 100644 --- a/regression-test/suites/variant_github_events_p0/theTotalNumberOfUsersOnGithub4.sql +++ b/regression-test/suites/variant_github_events_p0/theTotalNumberOfUsersOnGithub4.sql @@ -1 +1 @@ -SELECT count(distinct cast(v:actor.login as string)) FROM github_events WHERE cast(v:type as string) = 'PullRequestEvent' AND cast(v:payload.action as string) = 'opened' +SELECT count(distinct cast(v["actor"]["login"] as string)) FROM github_events WHERE cast(v["type"] as string) = 'PullRequestEvent' AND cast(v["payload"]["action"] as string) = 'opened' diff --git a/regression-test/suites/variant_github_events_p0/topLabels1.sql b/regression-test/suites/variant_github_events_p0/topLabels1.sql index 152ec3ba3a8bbe..8e4ae36dd63ab3 100644 --- a/regression-test/suites/variant_github_events_p0/topLabels1.sql +++ b/regression-test/suites/variant_github_events_p0/topLabels1.sql @@ -3,7 +3,7 @@ -- count() AS c -- FROM github_events -- LATERAL VIEW explode_split(labels, ',') t AS label --- WHERE (cast(v:type as string) IN ('IssuesEvent', 'PullRequestEvent', 'IssueCommentEvent')) AND (action IN ('created', 'opened', 'labeled')) +-- WHERE (cast(v["type"] as string) IN ('IssuesEvent', 'PullRequestEvent', 'IssueCommentEvent')) AND (action IN ('created', 'opened', 'labeled')) -- GROUP BY label -- ORDER BY c DESC -- LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/topLabels2.sql b/regression-test/suites/variant_github_events_p0/topLabels2.sql index bf404d4da57037..302e08519a1e02 100644 --- a/regression-test/suites/variant_github_events_p0/topLabels2.sql +++ b/regression-test/suites/variant_github_events_p0/topLabels2.sql @@ -3,7 +3,7 @@ -- count() AS c -- FROM github_events -- LATERAL VIEW explode_split(labels, ',') t AS label --- WHERE (cast(v:type as string) IN ('IssuesEvent', 'PullRequestEvent', 'IssueCommentEvent')) AND (action IN ('created', 'opened', 'labeled')) AND ((lower(label) LIKE '%bug%') OR (lower(label) LIKE '%feature%')) +-- WHERE (cast(v["type"] as string) IN ('IssuesEvent', 'PullRequestEvent', 'IssueCommentEvent')) AND (action IN ('created', 'opened', 'labeled')) AND ((lower(label) LIKE '%bug%') OR (lower(label) LIKE '%feature%')) -- GROUP BY label -- ORDER BY c DESC -- LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/topLabels3.sql b/regression-test/suites/variant_github_events_p0/topLabels3.sql index 49e60861667719..30c6e7ee8be8d0 100644 --- a/regression-test/suites/variant_github_events_p0/topLabels3.sql +++ b/regression-test/suites/variant_github_events_p0/topLabels3.sql @@ -9,6 +9,6 @@ -- CASE WHEN lower(label) LIKE '%feature%' THEN 1 ELSE 0 END AS feature -- FROM github_events -- LATERAL VIEW explode_split(labels, ',') t AS label --- WHERE (cast(v:type as string) IN ('IssuesEvent', 'PullRequestEvent', 'IssueCommentEvent')) AND (action IN ('created', 'opened', 'labeled')) AND ((lower(label) LIKE '%bug%') OR (lower(label) LIKE '%feature%')) +-- WHERE (cast(v["type"] as string) IN ('IssuesEvent', 'PullRequestEvent', 'IssueCommentEvent')) AND (action IN ('created', 'opened', 'labeled')) AND ((lower(label) LIKE '%bug%') OR (lower(label) LIKE '%feature%')) -- ) t -- LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/topRepositoriesByStars.sql b/regression-test/suites/variant_github_events_p0/topRepositoriesByStars.sql index 3dfd35d9d6e036..8ca99e182b75d8 100644 --- a/regression-test/suites/variant_github_events_p0/topRepositoriesByStars.sql +++ b/regression-test/suites/variant_github_events_p0/topRepositoriesByStars.sql @@ -1 +1 @@ -SELECT cast(v:repo.name as string), count() AS stars FROM github_events WHERE cast(v:type as string) = 'WatchEvent' GROUP BY cast(v:repo.name as string) ORDER BY stars DESC, 1 LIMIT 50 +SELECT cast(v["repo"]["name"] as string), count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY cast(v["repo"]["name"] as string) ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/whatIsTheBestDayOfTheWeekToCatchAStar.sql b/regression-test/suites/variant_github_events_p0/whatIsTheBestDayOfTheWeekToCatchAStar.sql index 0c930308cf930e..116fe5ca57cc18 100644 --- a/regression-test/suites/variant_github_events_p0/whatIsTheBestDayOfTheWeekToCatchAStar.sql +++ b/regression-test/suites/variant_github_events_p0/whatIsTheBestDayOfTheWeekToCatchAStar.sql @@ -1 +1 @@ -SELECT dayofweek(cast(v:created_at as datetime)) AS day, count() AS stars FROM github_events WHERE cast(v:type as string) = 'WatchEvent' GROUP BY day ORDER BY day +SELECT dayofweek(cast(v["created_at"] as datetime)) AS day, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY day ORDER BY day diff --git a/regression-test/suites/variant_github_events_p0/whoAreAllThosePeopleGivingStars1.sql b/regression-test/suites/variant_github_events_p0/whoAreAllThosePeopleGivingStars1.sql index 63a4dfd15f00d2..445853c2efa15a 100644 --- a/regression-test/suites/variant_github_events_p0/whoAreAllThosePeopleGivingStars1.sql +++ b/regression-test/suites/variant_github_events_p0/whoAreAllThosePeopleGivingStars1.sql @@ -1 +1 @@ -SELECT cast(v:actor.login as string), count() AS stars FROM github_events WHERE cast(v:type as string) = 'WatchEvent' GROUP BY cast(v:actor.login as string) ORDER BY stars DESC, 1 LIMIT 50 +SELECT cast(v["actor"]["login"] as string), count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY cast(v["actor"]["login"] as string) ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/whoAreAllThosePeopleGivingStars2.sql b/regression-test/suites/variant_github_events_p0/whoAreAllThosePeopleGivingStars2.sql index 0aa67b56d2a00f..1fc9a6158edf48 100644 --- a/regression-test/suites/variant_github_events_p0/whoAreAllThosePeopleGivingStars2.sql +++ b/regression-test/suites/variant_github_events_p0/whoAreAllThosePeopleGivingStars2.sql @@ -1 +1 @@ -SELECT cast(v:actor.login as string), count() AS stars FROM github_events WHERE cast(v:type as string) = 'WatchEvent' AND cast(v:actor.login as string) = 'cliffordfajardo' GROUP BY cast(v:actor.login as string) ORDER BY stars DESC LIMIT 50 +SELECT cast(v["actor"]["login"] as string), count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND cast(v["actor"]["login"] as string) = 'cliffordfajardo' GROUP BY cast(v["actor"]["login"] as string) ORDER BY stars DESC LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0/whoAreAllThosePeopleGivingStars3.sql b/regression-test/suites/variant_github_events_p0/whoAreAllThosePeopleGivingStars3.sql index a1e9dab32e4f82..43426a2c9e4b81 100644 --- a/regression-test/suites/variant_github_events_p0/whoAreAllThosePeopleGivingStars3.sql +++ b/regression-test/suites/variant_github_events_p0/whoAreAllThosePeopleGivingStars3.sql @@ -1,13 +1,13 @@ SELECT - cast(v:repo.name as string), + cast(v["repo"]["name"] as string), count() AS stars FROM github_events -WHERE (cast(v:type as string) = 'WatchEvent') AND (cast(v:repo.name as string) IN +WHERE (cast(v["type"] as string) = 'WatchEvent') AND (cast(v["repo"]["name"] as string) IN ( - SELECT cast(v:repo.name as string) + SELECT cast(v["repo"]["name"] as string) FROM github_events - WHERE (cast(v:type as string) = 'WatchEvent') AND (cast(v:actor.login as string) = 'cliffordfajardo') + WHERE (cast(v["type"] as string) = 'WatchEvent') AND (cast(v["actor"]["login"] as string) = 'cliffordfajardo') )) -GROUP BY cast(v:repo.name as string) -ORDER BY stars DESC, cast(v:repo.name as string) +GROUP BY cast(v["repo"]["name"] as string) +ORDER BY stars DESC, cast(v["repo"]["name"] as string) LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0_new/sql/affinityByIssuesAndPRs1.sql b/regression-test/suites/variant_github_events_p0_new/sql/affinityByIssuesAndPRs1.sql index f677aca4b53ff1..043ff99f6a0ec4 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/affinityByIssuesAndPRs1.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/affinityByIssuesAndPRs1.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() AS prs, count(distinct cast(v["actor"]["login"] as string)) AS authors diff --git a/regression-test/suites/variant_github_events_p0_new/sql/affinityByIssuesAndPRs2.sql b/regression-test/suites/variant_github_events_p0_new/sql/affinityByIssuesAndPRs2.sql index 6af4ec0478e6af..b3cf37124fc802 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/affinityByIssuesAndPRs2.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/affinityByIssuesAndPRs2.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() AS prs, count(distinct cast(v["actor"]["login"] as string)) AS authors diff --git a/regression-test/suites/variant_github_events_p0_new/sql/authorsWithTheMostPushes.sql b/regression-test/suites/variant_github_events_p0_new/sql/authorsWithTheMostPushes.sql index a6da4899386e27..637dba7f6206e8 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/authorsWithTheMostPushes.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/authorsWithTheMostPushes.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["actor"]["login"] as string) as actor_login, count() AS c, count(distinct cast(v["repo"]["name"] as string)) AS repos diff --git a/regression-test/suites/variant_github_events_p0_new/sql/countingStar1.sql b/regression-test/suites/variant_github_events_p0_new/sql/countingStar1.sql index 8b2d615acd052e..cae7d585bf0784 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/countingStar1.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/countingStar1.sql @@ -1 +1 @@ -SELECT count() FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ count() FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' diff --git a/regression-test/suites/variant_github_events_p0_new/sql/countingStar2.sql b/regression-test/suites/variant_github_events_p0_new/sql/countingStar2.sql index afc07c67fe0ff0..15bc6efe16961b 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/countingStar2.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/countingStar2.sql @@ -1 +1 @@ -SELECT cast(v["payload"]["action"] as string) as payload_action, count() FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY payload_action \ No newline at end of file +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["payload"]["action"] as string) as payload_action, count() FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY payload_action \ No newline at end of file diff --git a/regression-test/suites/variant_github_events_p0_new/sql/countingStar3.sql b/regression-test/suites/variant_github_events_p0_new/sql/countingStar3.sql index 9b5f41288901d7..172967acbfdd24 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/countingStar3.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/countingStar3.sql @@ -1 +1 @@ -SELECT count() FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND cast(v["repo"]["name"] as string) IN ('apache/spark', 'GunZi200/Memory-Colour', 'isohuntto/openbay', 'wasabeef/awesome-android-ui') GROUP BY cast(v["payload"]["action"] as string) \ No newline at end of file +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ count() FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND cast(v["repo"]["name"] as string) IN ('apache/spark', 'GunZi200/Memory-Colour', 'isohuntto/openbay', 'wasabeef/awesome-android-ui') GROUP BY cast(v["payload"]["action"] as string) \ No newline at end of file diff --git a/regression-test/suites/variant_github_events_p0_new/sql/distributionOfRepositoriesByStarCount.sql b/regression-test/suites/variant_github_events_p0_new/sql/distributionOfRepositoriesByStarCount.sql index e89ca8b7e3e90a..5dbec453df93ef 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/distributionOfRepositoriesByStarCount.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/distributionOfRepositoriesByStarCount.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ pow(10, floor(log10(c))) AS stars, count(distinct repo) FROM diff --git a/regression-test/suites/variant_github_events_p0_new/sql/githubRoulette.sql b/regression-test/suites/variant_github_events_p0_new/sql/githubRoulette.sql index 0b9ea42f77d8ea..20cd59b11ecccc 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/githubRoulette.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/githubRoulette.sql @@ -1 +1 @@ -SELECT cast(v["repo"]["name"] as string) FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' ORDER BY cast(v["created_at"] as datetime), cast(v["repo"]["name"] as string) LIMIT 50 \ No newline at end of file +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' ORDER BY cast(v["created_at"] as datetime), cast(v["repo"]["name"] as string) LIMIT 50 \ No newline at end of file diff --git a/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears1.sql b/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears1.sql index 9a891798550d1c..e3f1053a6be1c2 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears1.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears1.sql @@ -1 +1 @@ -SELECT cast(v["repo"]["name"] as string) as repo_name, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND year(cast(v["created_at"] as datetime)) = '2015' GROUP BY repo_name ORDER BY stars DESC, 1 LIMIT 50 +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND year(cast(v["created_at"] as datetime)) = '2015' GROUP BY repo_name ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears2.sql b/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears2.sql index 9a891798550d1c..e3f1053a6be1c2 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears2.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears2.sql @@ -1 +1 @@ -SELECT cast(v["repo"]["name"] as string) as repo_name, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND year(cast(v["created_at"] as datetime)) = '2015' GROUP BY repo_name ORDER BY stars DESC, 1 LIMIT 50 +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND year(cast(v["created_at"] as datetime)) = '2015' GROUP BY repo_name ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears3.sql b/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears3.sql index 20654cb10c119c..f68bdcfbf0e57a 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears3.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears3.sql @@ -1 +1 @@ -SELECT cast(v["repo"]["name"] as string) as repo_name, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND year(cast(v["created_at"] as datetime)) = '2015' GROUP BY repo_name ORDER BY stars, repo_name DESC LIMIT 50 +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND year(cast(v["created_at"] as datetime)) = '2015' GROUP BY repo_name ORDER BY stars, repo_name DESC LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears4.sql b/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears4.sql index 9a891798550d1c..e3f1053a6be1c2 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears4.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears4.sql @@ -1 +1 @@ -SELECT cast(v["repo"]["name"] as string) as repo_name, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND year(cast(v["created_at"] as datetime)) = '2015' GROUP BY repo_name ORDER BY stars DESC, 1 LIMIT 50 +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND year(cast(v["created_at"] as datetime)) = '2015' GROUP BY repo_name ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears5.sql b/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears5.sql index 9a891798550d1c..e3f1053a6be1c2 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears5.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears5.sql @@ -1 +1 @@ -SELECT cast(v["repo"]["name"] as string) as repo_name, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND year(cast(v["created_at"] as datetime)) = '2015' GROUP BY repo_name ORDER BY stars DESC, 1 LIMIT 50 +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND year(cast(v["created_at"] as datetime)) = '2015' GROUP BY repo_name ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears6.sql b/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears6.sql index 9a891798550d1c..e3f1053a6be1c2 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears6.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears6.sql @@ -1 +1 @@ -SELECT cast(v["repo"]["name"] as string) as repo_name, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND year(cast(v["created_at"] as datetime)) = '2015' GROUP BY repo_name ORDER BY stars DESC, 1 LIMIT 50 +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND year(cast(v["created_at"] as datetime)) = '2015' GROUP BY repo_name ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears7.sql b/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears7.sql index ee2fbef43b3f53..8f7e3f7b36fbfa 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears7.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/howHasTheListOfTopRepositoriesChangedOverTheYears7.sql @@ -1,5 +1,5 @@ -- FIXME: UNSTABLE --- SELECT +-- SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ -- repo, -- year, -- cnt diff --git a/regression-test/suites/variant_github_events_p0_new/sql/howHasTheTotalNumberOfStarsChangedOverTime.sql b/regression-test/suites/variant_github_events_p0_new/sql/howHasTheTotalNumberOfStarsChangedOverTime.sql index 5291ab5100649a..f0d95d00ead3fe 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/howHasTheTotalNumberOfStarsChangedOverTime.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/howHasTheTotalNumberOfStarsChangedOverTime.sql @@ -1,2 +1,2 @@ -SELECT year(cast(v["created_at"] as datetime)) AS year, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY year ORDER BY year +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ year(cast(v["created_at"] as datetime)) AS year, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY year ORDER BY year diff --git a/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments1.sql b/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments1.sql index 0117055d53e7f6..5c0e58e47ef961 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments1.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments1.sql @@ -1 +1 @@ -SELECT count() FROM github_events WHERE cast(v["type"] as string) = 'IssueCommentEvent' +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ count() FROM github_events WHERE cast(v["type"] as string) = 'IssueCommentEvent' diff --git a/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments2.sql b/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments2.sql index 9241442e151e28..bb12557117b2c7 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments2.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments2.sql @@ -1 +1 @@ -SELECT cast(v["repo"]["name"] as string) as repo_name, count() FROM github_events WHERE cast(v["type"] as string) = 'IssueCommentEvent' GROUP BY repo_name ORDER BY count() DESC, 1 LIMIT 50 +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() FROM github_events WHERE cast(v["type"] as string) = 'IssueCommentEvent' GROUP BY repo_name ORDER BY count() DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments3.sql b/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments3.sql index 959069cc3964d3..1ab1e2969bfdb4 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments3.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments3.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ repo_name, comments, issues, diff --git a/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments4.sql b/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments4.sql index a7e97979c51c9c..62bba924a9926c 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments4.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments4.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, cast(v["payload"]["issue"]["number"] as int) as number, count() AS comments diff --git a/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments5.sql b/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments5.sql index 653cf392f236ce..fb8f3866328549 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments5.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments5.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, cast(v["payload"]["issue"]["number"] as int) as number, count() AS comments diff --git a/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments6.sql b/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments6.sql index 8f72376fc7539c..3782b46cd001c0 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments6.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments6.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, cast(v["payload"]["issue"]["number"] as int) as number, count() AS comments, diff --git a/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments7.sql b/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments7.sql index 89961358a9fb89..b429dcc8bfe4f7 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments7.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments7.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() AS comments, count(distinct cast(v["actor"]["login"] as string)) AS authors diff --git a/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments8.sql b/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments8.sql index e6890c1e23505f..762a7dec440a63 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments8.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/issuesWithTheMostComments8.sql @@ -1,4 +1,4 @@ --- SELECT +-- SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ -- concat('https://github.com/', cast(v["repo"]["name"] as string), '/commit/', cast(v["payload"]["commit_id"] as string)) URL, -- cast(v["payload"]["commit_id"] as string) AS commit_id, -- count() AS comments, diff --git a/regression-test/suites/variant_github_events_p0_new/sql/mostForkedRepositories.sql b/regression-test/suites/variant_github_events_p0_new/sql/mostForkedRepositories.sql index ad09d333395bcb..f0ccb6e2c3d8fd 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/mostForkedRepositories.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/mostForkedRepositories.sql @@ -1 +1 @@ -SELECT cast(v["repo"]["name"] as string) as repo_name, count() AS forks FROM github_events WHERE cast(v["type"] as string) = 'ForkEvent' GROUP BY repo_name ORDER BY forks DESC, 1 LIMIT 50 +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() AS forks FROM github_events WHERE cast(v["type"] as string) = 'ForkEvent' GROUP BY repo_name ORDER BY forks DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0_new/sql/mostPopularCommentsOnGithub.sql b/regression-test/suites/variant_github_events_p0_new/sql/mostPopularCommentsOnGithub.sql index 34c0ee5d84302b..8b7094ac153b9f 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/mostPopularCommentsOnGithub.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/mostPopularCommentsOnGithub.sql @@ -1 +1 @@ -SELECT cast(v["payload"]["comment"]["body"] as string) as comment_body, count() FROM github_events WHERE cast(v["payload"]["comment"]["body"] as string) != "" AND length(cast(v["payload"]["comment"]["body"] as string)) < 100 GROUP BY comment_body ORDER BY count(), 1 DESC LIMIT 50 \ No newline at end of file +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["payload"]["comment"]["body"] as string) as comment_body, count() FROM github_events WHERE cast(v["payload"]["comment"]["body"] as string) != "" AND length(cast(v["payload"]["comment"]["body"] as string)) < 100 GROUP BY comment_body ORDER BY count(), 1 DESC LIMIT 50 \ No newline at end of file diff --git a/regression-test/suites/variant_github_events_p0_new/sql/organizationsByTheNumberOfRepositories.sql b/regression-test/suites/variant_github_events_p0_new/sql/organizationsByTheNumberOfRepositories.sql index 97582f18724558..f6d653413c3dc5 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/organizationsByTheNumberOfRepositories.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/organizationsByTheNumberOfRepositories.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ lower(split_part(repo_name, '/', 1)) AS org, count(distinct repo_name) AS repos FROM diff --git a/regression-test/suites/variant_github_events_p0_new/sql/organizationsByTheNumberOfStars.sql b/regression-test/suites/variant_github_events_p0_new/sql/organizationsByTheNumberOfStars.sql index 22f0a8cbba706e..04b55d39e51291 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/organizationsByTheNumberOfStars.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/organizationsByTheNumberOfStars.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ lower(split_part(cast(v["repo"]["name"] as string), '/', 1)) AS org, count() AS stars FROM github_events diff --git a/regression-test/suites/variant_github_events_p0_new/sql/organizationsByTheSizeOfCommunity.sql b/regression-test/suites/variant_github_events_p0_new/sql/organizationsByTheSizeOfCommunity.sql index e445e7db3e9657..e0352afc55fa0f 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/organizationsByTheSizeOfCommunity.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/organizationsByTheSizeOfCommunity.sql @@ -1,4 +1,4 @@ --- SELECT +-- SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ -- lower(split_part(cast(v["repo"]["name"] as string), '/', 1)) AS org, -- count(distinct cast(v["actor"]["login"] as string)) AS authors, -- count(distinct pr_author) AS pr_authors, diff --git a/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks1.sql b/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks1.sql index 65ab889b2511a6..9e3f2875ef2e10 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks1.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks1.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ repo_name, sum(fork) AS forks, sum(star) AS stars, diff --git a/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks2.sql b/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks2.sql index ffff95dfdc64c0..2e1cb1b9c1f4e5 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks2.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks2.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ repo_name, sum(fork) AS forks, sum(star) AS stars, diff --git a/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks3.sql b/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks3.sql index f47c5163302b9c..6f91ab15eb9823 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks3.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks3.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ repo_name, sum(fork) AS forks, sum(star) AS stars, diff --git a/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks4.sql b/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks4.sql index 66c67db1b86f7e..8be41f0949737f 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks4.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks4.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ sum(fork) AS forks, sum(star) AS stars, round(sum(star) / sum(fork), 2) AS ratio diff --git a/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks5.sql b/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks5.sql index 3579b794114e08..26bfb2ac6302ee 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks5.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/proportionsBetweenStarsAndForks5.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ sum(forks) AS forks, sum(stars) AS stars, round(sum(stars) / sum(forks), 2) AS ratio diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesByAmountOfModifiedCode.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesByAmountOfModifiedCode.sql index c092aadf037f67..6c1632769f3d9f 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesByAmountOfModifiedCode.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesByAmountOfModifiedCode.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false,disable_streaming_preaggregations=false) */ cast(v["repo"]["name"] as string) as repo_name, count() AS prs, count(distinct cast(v["actor"]["login"] as string)) AS authors, diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesByTheNumberOfPushes.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesByTheNumberOfPushes.sql index ab431701c547e3..6db36e257c5d45 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesByTheNumberOfPushes.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesByTheNumberOfPushes.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() AS pushes, count(distinct cast(v["actor"]["login"] as string)) AS authors diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithClickhouse_related_comments1.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithClickhouse_related_comments1.sql index ed248f5df46474..254888d0e11901 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithClickhouse_related_comments1.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithClickhouse_related_comments1.sql @@ -1 +1 @@ -SELECT cast(v["repo"]["name"] as string) as repo_name, count() FROM github_events WHERE lower(cast(v["payload"]["comment"]["body"] as string)) LIKE '%apache%' GROUP BY repo_name ORDER BY count() DESC, repo_name ASC LIMIT 50 \ No newline at end of file +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() FROM github_events WHERE lower(cast(v["payload"]["comment"]["body"] as string)) LIKE '%apache%' GROUP BY repo_name ORDER BY count() DESC, repo_name ASC LIMIT 50 \ No newline at end of file diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithClickhouse_related_comments2.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithClickhouse_related_comments2.sql index 15b5adf3fb2bb8..90ef187ba3520c 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithClickhouse_related_comments2.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithClickhouse_related_comments2.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ repo_name, sum(num_star) AS num_stars, sum(num_comment) AS num_comments diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithDoris_related_comments1.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithDoris_related_comments1.sql index 5592d4b4d152ac..90a73db9ca3897 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithDoris_related_comments1.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithDoris_related_comments1.sql @@ -1 +1 @@ -SELECT cast(v["repo"]["name"] as string) as repo_name, count() FROM github_events WHERE lower(cast(v["payload"]["comment"]["body"] as string)) LIKE '%spark%' GROUP BY repo_name ORDER BY count() DESC, repo_name ASC LIMIT 50 \ No newline at end of file +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() FROM github_events WHERE lower(cast(v["payload"]["comment"]["body"] as string)) LIKE '%spark%' GROUP BY repo_name ORDER BY count() DESC, repo_name ASC LIMIT 50 \ No newline at end of file diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithDoris_related_comments2.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithDoris_related_comments2.sql index 17a055f65495b4..28c44705455d23 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithDoris_related_comments2.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithDoris_related_comments2.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ repo_name, sum(num_star) AS num_stars, sum(num_comment) AS num_comments diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheHighestGrowthYoY.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheHighestGrowthYoY.sql index b5270ee38f1098..47d3ad8417dc4f 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheHighestGrowthYoY.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheHighestGrowthYoY.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ repo_name, sum(created_at_2022) AS stars2022, sum(created_at_2015) AS stars2015, diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfIssues1.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfIssues1.sql index 89907a1feae7e4..d93b20c783fe11 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfIssues1.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfIssues1.sql @@ -1 +1 @@ -SELECT cast(v["repo"]["name"] as string) as repo_name, count() AS c, count(distinct cast(v["actor"]["login"] as string)) AS u FROM github_events WHERE cast(v["type"] as string) = 'IssuesEvent' AND cast(v["payload"]["action"] as string) = 'opened' GROUP BY repo_name ORDER BY c DESC, repo_name LIMIT 50 +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() AS c, count(distinct cast(v["actor"]["login"] as string)) AS u FROM github_events WHERE cast(v["type"] as string) = 'IssuesEvent' AND cast(v["payload"]["action"] as string) = 'opened' GROUP BY repo_name ORDER BY c DESC, repo_name LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfIssues2.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfIssues2.sql index cfddc738371827..5703e50af8f5d9 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfIssues2.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfIssues2.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ repo_name, sum(issue_created) AS c, count(distinct actor_login) AS u, diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfIssues3.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfIssues3.sql index 60759a10199068..32014cb4c195bc 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfIssues3.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfIssues3.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ repo_name, sum(issue_created) AS c, count(distinct actor_login) AS u, diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfIssues4.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfIssues4.sql index 756e6f6bd95da5..484d8b50ea8ccd 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfIssues4.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfIssues4.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ repo_name, sum(issue_created) AS c, count(distinct actor_login) AS u, diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfPullRequests1.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfPullRequests1.sql index ad96c5135e62b8..688d42ec6a94b4 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfPullRequests1.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfPullRequests1.sql @@ -1 +1 @@ -SELECT cast(v["repo"]["name"] as string) as repo_name, count(), count(distinct cast(v["actor"]["login"] as string)) FROM github_events WHERE cast(v["type"] as string) = 'PullRequestEvent' AND cast(v["payload"]["action"] as string) = 'opened' GROUP BY repo_name ORDER BY 2,1,3 DESC LIMIT 50 \ No newline at end of file +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count(), count(distinct cast(v["actor"]["login"] as string)) FROM github_events WHERE cast(v["type"] as string) = 'PullRequestEvent' AND cast(v["payload"]["action"] as string) = 'opened' GROUP BY repo_name ORDER BY 2,1,3 DESC LIMIT 50 \ No newline at end of file diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfPullRequests2.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfPullRequests2.sql index 20d9743fdec9ce..e4b3b388e24159 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfPullRequests2.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumAmountOfPullRequests2.sql @@ -1 +1 @@ -SELECT cast(v["repo"]["name"] as string) as repo_name, count(), count(distinct cast(v["actor"]["login"] as string)) AS u FROM github_events WHERE cast(v["type"] as string) = 'PullRequestEvent' AND cast(v["payload"]["action"] as string) = 'opened' GROUP BY repo_name ORDER BY u DESC, 2 DESC, 1 LIMIT 50 +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count(), count(distinct cast(v["actor"]["login"] as string)) AS u FROM github_events WHERE cast(v["type"] as string) = 'PullRequestEvent' AND cast(v["payload"]["action"] as string) = 'opened' GROUP BY repo_name ORDER BY u DESC, 2 DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumNumberOfAcceptedInvitations.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumNumberOfAcceptedInvitations.sql index 36aa448c66acba..f6672875578f47 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumNumberOfAcceptedInvitations.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMaximumNumberOfAcceptedInvitations.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ repo_name, sum(invitation) AS invitations, sum(star) AS stars diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostPeopleWhoHavePushAccess1.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostPeopleWhoHavePushAccess1.sql index 329cfc908b6654..d31a0f38a54a13 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostPeopleWhoHavePushAccess1.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostPeopleWhoHavePushAccess1.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ repo_name, count(distinct actor_login) AS u, sum(star) AS stars diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostPeopleWhoHavePushAccess2.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostPeopleWhoHavePushAccess2.sql index 410f69c47a58c9..5849b3527d3a55 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostPeopleWhoHavePushAccess2.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostPeopleWhoHavePushAccess2.sql @@ -1,4 +1,4 @@ --- SELECT +-- SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ -- cast(v["repo"]["name"] as string), -- count(distinct cast(v["actor"]["login"] as string)) AS u, -- sum(star) AS stars diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostPeopleWhoHavePushAccess3.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostPeopleWhoHavePushAccess3.sql index dbcf16db2ac195..b3b2133eb2991c 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostPeopleWhoHavePushAccess3.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostPeopleWhoHavePushAccess3.sql @@ -1,4 +1,4 @@ --- SELECT +-- SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ -- cast(v["repo"]["name"] as string), -- count(distinct cast(v["actor"]["login"] as string)) AS u, -- sum(star) AS stars diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostStarsOverOneDay1.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostStarsOverOneDay1.sql index 6416c785aa2b4c..dcf6eb23235a69 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostStarsOverOneDay1.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostStarsOverOneDay1.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ repo_name, day, stars diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostStarsOverOneDay2.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostStarsOverOneDay2.sql index 92a1c9a9c6e005..66a7ab7cba55fd 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostStarsOverOneDay2.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostStarsOverOneDay2.sql @@ -1,4 +1,4 @@ --- SELECT +-- SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ -- cast(v["repo"]["name"] as string), -- day, -- stars diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostStarsOverOneDay3.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostStarsOverOneDay3.sql index 29fd779ffa3b44..1bfa7869399474 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostStarsOverOneDay3.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostStarsOverOneDay3.sql @@ -1 +1 @@ --- SELECT cast(v["repo"]["name"] as string), cast(v["created_at"] as datetime), count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY cast(v["repo"]["name"] as string), cast(v["created_at"] as datetime) ORDER BY count() DESC LIMIT 50 +-- SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string), cast(v["created_at"] as datetime), count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY cast(v["repo"]["name"] as string), cast(v["created_at"] as datetime) ORDER BY count() DESC LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostSteadyGrowthOverTime.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostSteadyGrowthOverTime.sql index 5d05e3cb8db80c..d1abdfd9dd4e0e 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostSteadyGrowthOverTime.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheMostSteadyGrowthOverTime.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ repo_name, max(stars) AS daily_stars, sum(stars) AS total_stars, diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheWorstStagnation_order.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheWorstStagnation_order.sql index f0019d643306fc..a4c09020695e9d 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheWorstStagnation_order.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoriesWithTheWorstStagnation_order.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ repo_name, sum(created_at_2022) AS stars2022, sum(created_at_2015) AS stars2015, diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoryAffinityList1.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoryAffinityList1.sql index d1c3b8150d6a34..f75b3d0d493adb 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoryAffinityList1.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoryAffinityList1.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() AS stars FROM github_events diff --git a/regression-test/suites/variant_github_events_p0_new/sql/repositoryAffinityList2.sql b/regression-test/suites/variant_github_events_p0_new/sql/repositoryAffinityList2.sql index 293f4b90396189..6f5ae4cbb33dc7 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/repositoryAffinityList2.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/repositoryAffinityList2.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ repo_name, total_stars, round(spark_stars / total_stars, 2) AS ratio diff --git a/regression-test/suites/variant_github_events_p0_new/sql/starsFromHeavyGithubUsers1.sql b/regression-test/suites/variant_github_events_p0_new/sql/starsFromHeavyGithubUsers1.sql index 7980447a6ba0d7..0cd0b5ade503a3 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/starsFromHeavyGithubUsers1.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/starsFromHeavyGithubUsers1.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() FROM github_events diff --git a/regression-test/suites/variant_github_events_p0_new/sql/starsFromHeavyGithubUsers2.sql b/regression-test/suites/variant_github_events_p0_new/sql/starsFromHeavyGithubUsers2.sql index a8218d9f916f7a..d230a3186fbe93 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/starsFromHeavyGithubUsers2.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/starsFromHeavyGithubUsers2.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() FROM github_events diff --git a/regression-test/suites/variant_github_events_p0_new/sql/theLongestRepositoryNames1.sql b/regression-test/suites/variant_github_events_p0_new/sql/theLongestRepositoryNames1.sql index 72526c022a437c..4644f27b54f784 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/theLongestRepositoryNames1.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/theLongestRepositoryNames1.sql @@ -1 +1 @@ -SELECT count(), cast(v["repo"]["name"] as string) as repo_name FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY repo_name ORDER BY length(repo_name) DESC, repo_name LIMIT 50 +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ count(), cast(v["repo"]["name"] as string) as repo_name FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY repo_name ORDER BY length(repo_name) DESC, repo_name LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0_new/sql/theLongestRepositoryNames2.sql b/regression-test/suites/variant_github_events_p0_new/sql/theLongestRepositoryNames2.sql index eb66a0835d9d0a..ee34ddfaae05a1 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/theLongestRepositoryNames2.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/theLongestRepositoryNames2.sql @@ -1 +1 @@ -SELECT cast(v["repo"]["name"] as string) as repo_name, count() FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND cast(v["repo"]["name"] as string) LIKE '%_/_%' GROUP BY repo_name ORDER BY length(repo_name) ASC, repo_name LIMIT 50 +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND cast(v["repo"]["name"] as string) LIKE '%_/_%' GROUP BY repo_name ORDER BY length(repo_name) ASC, repo_name LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0_new/sql/theMostToughCodeReviews.sql b/regression-test/suites/variant_github_events_p0_new/sql/theMostToughCodeReviews.sql index 670a70ff725e63..29cf3d807c3760 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/theMostToughCodeReviews.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/theMostToughCodeReviews.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ concat('https://github.com/', cast(v["repo"]["name"] as string), '/pull/') AS URL, count(distinct cast(v["actor"]["login"] as string)) AS authors FROM github_events diff --git a/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfRepositoriesOnGithub.sql b/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfRepositoriesOnGithub.sql index 9fdc19bfcef5ad..e10d25749b48bc 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfRepositoriesOnGithub.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfRepositoriesOnGithub.sql @@ -1 +1 @@ -SELECT count(distinct cast(v["repo"]["name"] as string)) FROM github_events +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ count(distinct cast(v["repo"]["name"] as string)) FROM github_events diff --git a/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfUsersOnGithub1.sql b/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfUsersOnGithub1.sql index 56f9ddf94732b7..fe5f1956c7948a 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfUsersOnGithub1.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfUsersOnGithub1.sql @@ -1 +1 @@ -SELECT count(distinct cast(v["actor"]["login"] as string)) FROM github_events +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ count(distinct cast(v["actor"]["login"] as string)) FROM github_events diff --git a/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfUsersOnGithub2.sql b/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfUsersOnGithub2.sql index f2ed81a78bd086..72dccfb12d697e 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfUsersOnGithub2.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfUsersOnGithub2.sql @@ -1 +1 @@ -SELECT count(distinct cast(v["actor"]["login"] as string)) FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ count(distinct cast(v["actor"]["login"] as string)) FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' diff --git a/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfUsersOnGithub3.sql b/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfUsersOnGithub3.sql index 3a2dd0c08b3431..ce96a89bd27105 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfUsersOnGithub3.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfUsersOnGithub3.sql @@ -1 +1 @@ -SELECT count(distinct cast(v["actor"]["login"] as string)) FROM github_events WHERE cast(v["type"] as string) = 'PushEvent' +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ count(distinct cast(v["actor"]["login"] as string)) FROM github_events WHERE cast(v["type"] as string) = 'PushEvent' diff --git a/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfUsersOnGithub4.sql b/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfUsersOnGithub4.sql index 59410fa57bc72d..53e611219f3dd0 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfUsersOnGithub4.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/theTotalNumberOfUsersOnGithub4.sql @@ -1 +1 @@ -SELECT count(distinct cast(v["actor"]["login"] as string)) FROM github_events WHERE cast(v["type"] as string) = 'PullRequestEvent' AND cast(v["payload"]["action"] as string) = 'opened' +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ count(distinct cast(v["actor"]["login"] as string)) FROM github_events WHERE cast(v["type"] as string) = 'PullRequestEvent' AND cast(v["payload"]["action"] as string) = 'opened' diff --git a/regression-test/suites/variant_github_events_p0_new/sql/topLabels1.sql b/regression-test/suites/variant_github_events_p0_new/sql/topLabels1.sql index 8e4ae36dd63ab3..eb6dd56d26c556 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/topLabels1.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/topLabels1.sql @@ -1,4 +1,4 @@ --- SELECT +-- SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ -- label, -- count() AS c -- FROM github_events diff --git a/regression-test/suites/variant_github_events_p0_new/sql/topLabels2.sql b/regression-test/suites/variant_github_events_p0_new/sql/topLabels2.sql index 302e08519a1e02..d04bded901d30c 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/topLabels2.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/topLabels2.sql @@ -1,4 +1,4 @@ --- SELECT +-- SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ -- label, -- count() AS c -- FROM github_events diff --git a/regression-test/suites/variant_github_events_p0_new/sql/topLabels3.sql b/regression-test/suites/variant_github_events_p0_new/sql/topLabels3.sql index 30c6e7ee8be8d0..f35116aaa6d27f 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/topLabels3.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/topLabels3.sql @@ -1,4 +1,4 @@ --- SELECT +-- SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ -- sum(bug) AS bugs, -- sum(feature) AS feature, -- sum(bug) / sum(feature) AS ratio diff --git a/regression-test/suites/variant_github_events_p0_new/sql/topRepositoriesByStars.sql b/regression-test/suites/variant_github_events_p0_new/sql/topRepositoriesByStars.sql index 995ce42d851eed..41eec01ee97809 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/topRepositoriesByStars.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/topRepositoriesByStars.sql @@ -1 +1 @@ -SELECT cast(v["repo"]["name"] as string) as repo_name, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY repo_name ORDER BY stars DESC, 1 LIMIT 50 +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY repo_name ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0_new/sql/whatIsTheBestDayOfTheWeekToCatchAStar.sql b/regression-test/suites/variant_github_events_p0_new/sql/whatIsTheBestDayOfTheWeekToCatchAStar.sql index 116fe5ca57cc18..c0d4576ce60088 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/whatIsTheBestDayOfTheWeekToCatchAStar.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/whatIsTheBestDayOfTheWeekToCatchAStar.sql @@ -1 +1 @@ -SELECT dayofweek(cast(v["created_at"] as datetime)) AS day, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY day ORDER BY day +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ dayofweek(cast(v["created_at"] as datetime)) AS day, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY day ORDER BY day diff --git a/regression-test/suites/variant_github_events_p0_new/sql/whoAreAllThosePeopleGivingStars1.sql b/regression-test/suites/variant_github_events_p0_new/sql/whoAreAllThosePeopleGivingStars1.sql index 0ec138f65b27d4..91f186645603d6 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/whoAreAllThosePeopleGivingStars1.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/whoAreAllThosePeopleGivingStars1.sql @@ -1 +1 @@ -SELECT cast(v["actor"]["login"] as string) as actor_login, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY actor_login ORDER BY stars DESC, 1 LIMIT 50 +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["actor"]["login"] as string) as actor_login, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' GROUP BY actor_login ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0_new/sql/whoAreAllThosePeopleGivingStars2.sql b/regression-test/suites/variant_github_events_p0_new/sql/whoAreAllThosePeopleGivingStars2.sql index 17d0db5c5a01f9..30a9ea294ccf9e 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/whoAreAllThosePeopleGivingStars2.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/whoAreAllThosePeopleGivingStars2.sql @@ -1 +1 @@ -SELECT cast(v["actor"]["login"] as string) as actor_login, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND cast(v["actor"]["login"] as string) = 'cliffordfajardo' GROUP BY actor_login ORDER BY stars DESC LIMIT 50 +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["actor"]["login"] as string) as actor_login, count() AS stars FROM github_events WHERE cast(v["type"] as string) = 'WatchEvent' AND cast(v["actor"]["login"] as string) = 'cliffordfajardo' GROUP BY actor_login ORDER BY stars DESC LIMIT 50 diff --git a/regression-test/suites/variant_github_events_p0_new/sql/whoAreAllThosePeopleGivingStars3.sql b/regression-test/suites/variant_github_events_p0_new/sql/whoAreAllThosePeopleGivingStars3.sql index 00df1277e72a6d..524737737b6bac 100644 --- a/regression-test/suites/variant_github_events_p0_new/sql/whoAreAllThosePeopleGivingStars3.sql +++ b/regression-test/suites/variant_github_events_p0_new/sql/whoAreAllThosePeopleGivingStars3.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ cast(v["repo"]["name"] as string) as repo_name, count() AS stars FROM github_events diff --git a/regression-test/suites/variant_p0/column_name.groovy b/regression-test/suites/variant_p0/column_name.groovy index 69ec1a31d1ec5d..658be673c69c62 100644 --- a/regression-test/suites/variant_p0/column_name.groovy +++ b/regression-test/suites/variant_p0/column_name.groovy @@ -31,17 +31,16 @@ suite("regression_test_variant_column_name", "variant_type"){ // sql "set experimental_enable_nereids_planner = false" sql """insert into ${table_name} values (1, '{"中文" : "中文", "\\\u4E2C\\\u6587": "unicode"}')""" - qt_sql """select v:中文, v:`\\\u4E2C\\\u6587` from ${table_name}""" + qt_sql """select v['中文'], v['\\\u4E2C\\\u6587'] from ${table_name}""" // sql """insert into ${table_name} values (2, '{}')""" sql "truncate table ${table_name}" sql """insert into ${table_name} values (3, '{"": ""}')""" - qt_sql """select v:`` from ${table_name} order by k""" + qt_sql """select v[''] from ${table_name} order by k""" sql """insert into ${table_name} values (4, '{"!@#^&*()": "11111"}')""" qt_sql """select cast(v["!@#^&*()"] as string) from ${table_name} order by k""" sql """insert into ${table_name} values (5, '{"123": "456", "789": "012"}')""" qt_sql """select cast(v["123"] as string) from ${table_name} order by k""" // sql """insert into ${table_name} values (6, '{"\\n123": "t123", "\\\"123": "123"}')""" - // qt_sql """select v:`\\n` from ${table_name} order by k""" sql """insert into ${table_name} values (7, '{"AA": "UPPER CASE", "aa": "lower case"}')""" qt_sql """select cast(v["AA"] as string), cast(v["aa"] as string) from ${table_name} order by k""" diff --git a/regression-test/suites/variant_p0/compaction/test_compaction.groovy b/regression-test/suites/variant_p0/compaction/test_compaction.groovy index 3b4b751b2df649..582c476386d72d 100644 --- a/regression-test/suites/variant_p0/compaction/test_compaction.groovy +++ b/regression-test/suites/variant_p0/compaction/test_compaction.groovy @@ -74,10 +74,9 @@ suite("test_compaction_variant") { insert.call(); insert.call(); qt_sql_1 "SELECT * FROM ${tableName} ORDER BY k, cast(v as string); " - qt_sql_2 "select k, cast(v:a as array) from ${tableName} where size(cast(v:a as array)) > 0 order by k" - qt_sql_3 "select k, v:a, cast(v:b as string) from ${tableName} where length(cast(v:b as string)) > 4 order by k" - // qt_sql_4 "select k, cast(v:b as string), cast(v:a as string), cast(v:c as string) from ${tableName} where order by k limit 5" - qt_sql_5 "select cast(v:b as string), cast(v:b.c as string) from ${tableName} where cast(v:b as string) != 'null' or cast(v:b as string) != '{}' order by k desc, 1, 2 limit 10;" + qt_sql_2 "select k, cast(v['a'] as array) from ${tableName} where size(cast(v['a'] as array)) > 0 order by k" + qt_sql_3 "select k, v['a'], cast(v['b'] as string) from ${tableName} where length(cast(v['b'] as string)) > 4 order by k" + qt_sql_5 "select cast(v['b'] as string), cast(v['b']['c'] as string) from ${tableName} where cast(v['b'] as string) != 'null' or cast(v['b'] as string) != '{}' order by k desc, 1, 2 limit 10;" //TabletId,ReplicaId,BackendId,SchemaHash,Version,LstSuccessVersion,LstFailedVersion,LstFailedTime,LocalDataSize,RemoteDataSize,RowCount,State,LstConsistencyCheckTime,CheckVersion,VersionCount,QueryHits,PathHash,MetaUrl,CompactionStatus @@ -131,10 +130,9 @@ suite("test_compaction_variant") { } // assert (rowCount < 8) qt_sql_11 "SELECT * FROM ${tableName} ORDER BY k, cast(v as string); " - qt_sql_22 "select k, cast(v:a as array) from ${tableName} where size(cast(v:a as array)) > 0 order by k" - qt_sql_33 "select k, v:a, cast(v:b as string) from ${tableName} where length(cast(v:b as string)) > 4 order by k" - // qt_sql_44 "select k, cast(v:b as string), cast(v:a as string), cast(v:c as string) from ${tableName} order by k limit 5" - qt_sql_55 "select cast(v:b as string), cast(v:b.c as string) from ${tableName} where cast(v:b as string) != 'null' and cast(v:b as string) != '{}' order by k desc limit 10;" + qt_sql_22 "select k, cast(v['a'] as array) from ${tableName} where size(cast(v['a'] as array)) > 0 order by k" + qt_sql_33 "select k, v['a'], cast(v['b'] as string) from ${tableName} where length(cast(v['b'] as string)) > 4 order by k" + qt_sql_55 "select cast(v['b'] as string), cast(v['b']['c'] as string) from ${tableName} where cast(v['b'] as string) != 'null' and cast(v['b'] as string) != '{}' order by k desc limit 10;" } } finally { diff --git a/regression-test/suites/variant_p0/complexjson.groovy b/regression-test/suites/variant_p0/complexjson.groovy index 67a4e86fd53e5a..cd6a0716fda75c 100644 --- a/regression-test/suites/variant_p0/complexjson.groovy +++ b/regression-test/suites/variant_p0/complexjson.groovy @@ -29,7 +29,6 @@ suite("regression_test_variant_complexjson", "variant_type_complex_json") { properties("replication_num" = "1", "disable_auto_compaction" = "true"); """ } - sql "set experimental_enable_nereids_planner = false" table_name = "complexjson" create_table table_name sql """insert into ${table_name} values (1, '{ @@ -62,8 +61,6 @@ suite("regression_test_variant_complexjson", "variant_type_complex_json") { } ] }')""" - // qt_sql """SELECT v:key_0.key_1.key_3.key_4, v:key_0.key_1.key_3.key_5, \ - // v:key_0.key_1.key_3.key_6, v:key_0.key_1.key_3.key_7 FROM ${table_name} ORDER BY v:id""" qt_sql """SELECT * from ${table_name} order by cast(v["id"] as int)""" table_name = "complexjson2" @@ -92,19 +89,12 @@ suite("regression_test_variant_complexjson", "variant_type_complex_json") { } ] }')""" - // qt_sql """SELECT \ - // v:key_1.key_2.key_3.key_8, \ - // v:key_1.key_2.key_3.key_4.key_5, \ - // v:key_1.key_2.key_3.key_4.key_6, \ - // v:key_1.key_2.key_3.key_4.key_7 \ - // FROM ${table_name} ORDER BY v:id""" qt_sql """SELECT * from ${table_name} order by cast(v["id"] as int)""" table_name = "complexjson3" create_table table_name sql """INSERT INTO ${table_name} VALUES (1, '{"key_10":65536,"key_11":"anve","key_0":{"key_1":{"key_2":1025,"key_3":1},"key_4":1,"key_5":256}}')""" sql """INSERT INTO ${table_name} VALUES (2, '{"key_0":[{"key_12":"buwvq","key_11":0.0000000255}]}')""" - // qt_sql """SELECT k, v:key_10, v:key_11, v:key_0.key_1.key_2, v:key_0.key_1.key_3, v:key_0.key_4, v:key_0.key_5, v:key_0.key_12, v:key_0.key_11 FROM complexjson3 ORDER BY k;""" qt_sql """SELECT * from ${table_name} order by k""" table_name = "complexjson4" @@ -116,12 +106,6 @@ suite("regression_test_variant_complexjson", "variant_type_complex_json") { {"key_10":10.23,"key_0":922337203.685} ] }')""" - // qt_sql """SELECT \ - // v:key_0.key_1.key_2, \ - // v:key_0.key_1.key_8, \ - // v:key_0.key_10, \ - // v:key_0.key_0 \ - // FROM ${table_name} ORDER BY v:id""" qt_sql """SELECT * from ${table_name} order by cast(v["id"] as int)""" table_name = "complexjson5" @@ -149,12 +133,5 @@ suite("regression_test_variant_complexjson", "variant_type_complex_json") { } ] }')""" - // qt_sql """SELECT \ - // v:key_0.key_1.key_2.key_3.key_4, - // v:key_0.key_1.key_2.key_3.key_6, - // v:key_0.key_1.key_2.key_3.key_7, - // v:key_0.key_1.key_2.key_5.key_6, \ - // v:key_0.key_1.key_2.key_5.key_7 - // FROM ${table_name} ORDER BY v:id""" qt_sql """SELECT * from ${table_name} order by cast(v["id"] as int)""" } \ No newline at end of file diff --git a/regression-test/suites/variant_p0/desc.groovy b/regression-test/suites/variant_p0/desc.groovy index f97d4e8e8989bb..78c9f078c9f2e5 100644 --- a/regression-test/suites/variant_p0/desc.groovy +++ b/regression-test/suites/variant_p0/desc.groovy @@ -78,14 +78,16 @@ suite("regression_test_variant_desc", "nonConcurrent"){ } def set_be_config = { key, value -> - String backend_id; + // String backend_id; def backendId_to_backendIP = [:] def backendId_to_backendHttpPort = [:] getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort); - backend_id = backendId_to_backendIP.keySet()[0] - def (code, out, err) = update_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), key, value) - logger.info("update config: code=" + code + ", out=" + out + ", err=" + err) + // backend_id = backendId_to_backendIP.keySet()[0] + for (backend_id in backendId_to_backendIP.keySet()) { + def (code, out, err) = update_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), key, value) + logger.info("update config: code=" + code + ", out=" + out + ", err=" + err) + } } try { diff --git a/regression-test/suites/variant_p0/load.groovy b/regression-test/suites/variant_p0/load.groovy index 29182573f524a2..85e8bfe865ca54 100644 --- a/regression-test/suites/variant_p0/load.groovy +++ b/regression-test/suites/variant_p0/load.groovy @@ -73,6 +73,8 @@ suite("regression_test_variant", "nonConcurrent"){ def (code, out, err) = update_be_config(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), key, value) logger.info("update config: code=" + code + ", out=" + out + ", err=" + err) } + sql "set experimental_enable_nereids_planner=true" + sql "set enable_fallback_to_original_planner=false" try { set_be_config.call("variant_ratio_of_defaults_as_sparse_column", "0.95") @@ -93,15 +95,13 @@ suite("regression_test_variant", "nonConcurrent"){ sql """insert into ${table_name} values (10, '1000000'),(1, '{"a" : 1, "b" : {"c" : [{"a" : 1}]}}');""" sql """insert into ${table_name} values (11, '[123.0]'),(1999, '{"a" : 1, "b" : {"c" : 1}}'),(19921, '{"a" : 1, "b" : 10}');""" sql """insert into ${table_name} values (12, '[123.2]'),(1022, '{"a" : 1, "b" : 10}'),(1029, '{"a" : 1, "b" : {"c" : 1}}');""" - qt_sql "select k, cast(v:a as array) from ${table_name} where size(cast(v:a as array)) > 0 order by k, cast(v:a as string) asc" - // cast v:b as int should be correct + qt_sql "select k, cast(v['a'] as array) from ${table_name} where size(cast(v['a'] as array)) > 0 order by k, cast(v['a'] as string) asc" // FIXME: unstable, todo use qt_sql - sql "select k, v, cast(v:b as string) from ${table_name} where length(cast(v:b as string)) > 4 order by k, cast(v as string)" + sql "select k, v, cast(v['b'] as string) from ${table_name} where length(cast(v['b'] as string)) > 4 order by k, cast(v as string)" sql "select k, v from ${table_name} order by k, cast(v as string) limit 5" - sql "select v:b, v:b.c, v from ${table_name} order by k,cast(v as string) desc limit 10000;" - // sql "select k, v, v:b.c, v:a from ${table_name} where k > 10 order by k desc limit 10000;" - sql "select v:b from ${table_name} where cast(v:b as int) > 0;" - sql "select cast(v:b as string) from ${table_name} order by k" + sql "select v['b'], v['b']['c'], v from ${table_name} order by k,cast(v as string) desc limit 10000;" + sql "select v['b'] from ${table_name} where cast(v['b'] as int) > 0;" + sql "select cast(v['b'] as string) from ${table_name} order by k" // verify table_name } // FIXME @@ -135,12 +135,11 @@ suite("regression_test_variant", "nonConcurrent"){ sql """insert into ${table_name} values (2, '{"A" : 1}');""" sql """insert into ${table_name} values (4, '{"A" : 123456}');""" sql """insert into ${table_name} values (8, '{"A" : 123456789101112}');""" - qt_sql_2 "select v:A from ${table_name} order by cast(v:A as bigint)" + qt_sql_2 "select v['A'] from ${table_name} order by cast(v['A'] as bigint)" sql """insert into ${table_name} values (12, '{"AA" : [123456]}');""" sql """insert into ${table_name} values (14, '{"AA" : [123456789101112]}');""" - // qt_sql_3 "select v:AA from ${table_name} where size(v:AA) > 0 order by k" - qt_sql_4 "select cast(v:A as string), v:AA, v from ${table_name} order by k" - qt_sql_5 "select v:A, v:AA, v, v from ${table_name} where cast(v:A as bigint) > 123 order by k" + qt_sql_4 "select cast(v['A'] as string), v['AA'], v from ${table_name} order by k" + qt_sql_5 "select v['A'], v['AA'], v, v from ${table_name} where cast(v['A'] as bigint) > 123 order by k" sql """insert into ${table_name} values (16, '{"a" : 123.0, "A" : 191191, "c": 123}');""" sql """insert into ${table_name} values (18, '{"a" : "123", "c" : 123456}');""" @@ -148,45 +147,30 @@ suite("regression_test_variant", "nonConcurrent"){ // sql """insert into ${table_name} values (12, '{"a" : [123]}, "c": "123456"');""" sql """insert into ${table_name} values (22, '{"a" : 1.1111, "A" : 17211, "c" : 111111}');""" sql "sync" - qt_sql_6 "select cast(v:a as string), v:A from ${table_name} order by cast(v:A as bigint), k" - qt_sql_7 "select k, v:A from ${table_name} where cast(v:A as bigint) >= 1 order by cast(v:A as bigint), k" + qt_sql_6 "select cast(v['a'] as string), v['A'] from ${table_name} order by cast(v['A'] as bigint), k" + qt_sql_7 "select k, v['A'] from ${table_name} where cast(v['A'] as bigint) >= 1 order by cast(v['A'] as bigint), k" - // FIXME: if not cast, then v:a could return "123" or 123 which is none determinately - qt_sql_8 "select cast(v:a as string), v:A from ${table_name} where cast(v:a as json) is null order by k" - // qt_sql_9 "select cast(v:a as string), v:A from ${table_name} where cast(v:A as json) is null order by k" + qt_sql_8 "select cast(v['a'] as string), v['A'] from ${table_name} where cast(v['a'] as json) is null order by k" - // !!! Not found cast function String to Float64 - // qt_sql_10 "select v:a, v:A from ${table_name} where cast(v:a as double) > 0 order by k" - qt_sql_11 "select v:A from ${table_name} where cast(v:A as bigint) > 1 order by k" + qt_sql_11 "select v['A'] from ${table_name} where cast(v['A'] as bigint) > 1 order by k" // ----%%---- - qt_sql_12 "select v:A, v from ${table_name} where cast(v:A as bigint) > 1 order by k" + qt_sql_12 "select v['A'], v from ${table_name} where cast(v['A'] as bigint) > 1 order by k" // ----%%---- - qt_sql_13 "select v:a, v:A from simple_select_variant where 1=1 and cast(v:a as json) is null and cast(v:A as bigint) >= 1 order by k;" - qt_sql_14 """select v:a, v:A, v from simple_select_variant where cast(v:A as bigint) > 0 and cast(v:A as bigint) = 123456 limit 1;""" - - // !!! Not found cast function String to Float64 - // qt_sql_15 "select v:a, v:A from ${table_name} where 1=1 and cast(v:a as double) > 0 and v:A is not null order by k" - // qt_sql_16 "select v:a, v:A, v:c from ${table_name} where 1=1 and cast(v:a as double) > 0 and v:A is not null order by k" - - // FIXME: if not cast, then v:a could return "123" or 123 which is none determinately - // not stable at present - // qt_sql_17 "select cast(v:a as json), v:A, v, v:AA from simple_select_variant where cast(v:A as bigint) is null order by k;" + qt_sql_13 "select v['a'], v['A'] from simple_select_variant where 1=1 and cast(v['a'] as json) is null and cast(v['A'] as bigint) >= 1 order by k;" + qt_sql_14 """select v['a'], v['A'], v from simple_select_variant where cast(v['A'] as bigint) > 0 and cast(v['A'] as bigint) = 123456 limit 1;""" sql """insert into simple_select_variant values (12, '{"oamama": 1.1}')""" - qt_sql_18 "select cast(v:a as text), v:A, v, v:oamama from simple_select_variant where cast(v:oamama as double) is null order by k;" - qt_sql_19 """select v:a, v:A, v, v:oamama from simple_select_variant where cast(v:oamama as double) is not null order by k""" - qt_sql_20 """select v:A from simple_select_variant where cast(v:A as bigint) > 0 and cast(v:A as bigint) = 123456 limit 1;""" - - // !!! Not found cast function String to Float64 - // qt_sql_21 """select v:A, v:a, v from simple_select_variant where cast(v:A as bigint) > 0 and cast(v:a as double) > 1 order by cast(v:A as bigint);""" + qt_sql_18 "select cast(v['a'] as text), v['A'], v, v['oamama'] from simple_select_variant where cast(v['oamama'] as double) is null order by k;" + qt_sql_19 """select v['a'], v['A'], v, v['oamama'] from simple_select_variant where cast(v['oamama'] as double) is not null order by k""" + qt_sql_20 """select v['A'] from simple_select_variant where cast(v['A'] as bigint) > 0 and cast(v['A'] as bigint) = 123456 limit 1;""" sql "truncate table simple_select_variant" sql """insert into simple_select_variant values (11, '{"x": [123456]}');""" sql """insert into simple_select_variant values (12, '{"x": [123456789101112]}');""" sql """insert into simple_select_variant values (12, '{"xxx" : 123, "yyy" : 456}');""" - qt_sql_21_1 """select * from simple_select_variant where cast(v:x as json) is null""" - qt_sql_21_2 """select cast(v:x as json) from simple_select_variant where cast(v:x as json) is not null order by k;""" + qt_sql_21_1 """select * from simple_select_variant where cast(v['x'] as json) is null""" + qt_sql_21_2 """select cast(v['x'] as json) from simple_select_variant where cast(v['x'] as json) is not null order by k;""" // 4. multi variant in single table table_name = "multi_variant" @@ -208,15 +192,15 @@ suite("regression_test_variant", "nonConcurrent"){ sql """insert into ${table_name} values (3, '{"C" : "123"}', '{"C" : [123]}', '{"E" : "789"}');""" sql "sync" verify table_name - qt_sql_22 "select v1:A from multi_variant order by k;" - qt_sql_23 "select v2:D from multi_variant order by k;" - qt_sql_24 "select v2:C from multi_variant order by k;" + qt_sql_22 "select v1['A'] from multi_variant order by k;" + qt_sql_23 "select v2['D'] from multi_variant order by k;" + qt_sql_24 "select v2['C'] from multi_variant order by k;" // 5. multi tablets concurrent load table_name = "t_json_parallel" create_table table_name sql """INSERT INTO t_json_parallel SELECT *, '{"k1":1, "k2": "some", "k3" : [1234], "k4" : 1.10000, "k5" : [[123]]}' FROM numbers("number" = "50000");""" - qt_sql_25 """ SELECT sum(cast(v:k1 as int)), sum(cast(v:k4 as double)), sum(cast(json_extract(v:k5, "\$.[0].[0]") as int)) from t_json_parallel; """ + qt_sql_25 """ SELECT sum(cast(v['k1'] as int)), sum(cast(v['k4'] as double)), sum(cast(json_extract(v['k5'], "\$.[0].[0]") as int)) from t_json_parallel; """ //50000 61700000 55000.00000000374 6150000 // 7. gh data table_name = "ghdata" @@ -268,9 +252,9 @@ suite("regression_test_variant", "nonConcurrent"){ // sql """insert into ${table_name} values (8, '{"a" : [123, 111........]}')""" sql """insert into ${table_name} values (9, '{"a" : [123, {"a" : 1}]}')""" sql """insert into ${table_name} values (10, '{"a" : [{"a" : 1}, 123]}')""" - qt_sql_29 "select cast(v:a as string) from ${table_name} order by k" + qt_sql_29 "select cast(v['a'] as string) from ${table_name} order by k" // b? 7.111 [123,{"xx":1}] {"b":{"c":456,"e":7.111}} 456 - qt_sql_30 "select v:b.e, v:a, v:b, v:b.c from jsonb_values where cast(v:b.e as double) > 1;" + qt_sql_30 "select v['b']['e'], v['a'], v['b'], v['b']['c'] from jsonb_values where cast(v['b']['e'] as double) > 1;" // 13. sparse columns table_name = "sparse_columns" @@ -292,14 +276,14 @@ suite("regression_test_variant", "nonConcurrent"){ set_be_config.call("variant_ratio_of_defaults_as_sparse_column", "1.0") load_json_data.call(table_name, """${getS3Url() + '/load/logdata.json'}""") qt_sql_32 """ select json_extract(v, "\$.json.parseFailed") from logdata where json_extract(v, "\$.json.parseFailed") != 'null' order by k limit 1;""" - qt_sql_32_1 """select cast(v:json.parseFailed as string) from logdata where cast(v:json.parseFailed as string) is not null and k = 162 limit 1;""" + qt_sql_32_1 """select cast(v['json']['parseFailed'] as string) from logdata where cast(v['json']['parseFailed'] as string) is not null and k = 162 limit 1;""" sql "truncate table ${table_name}" // 0.95 default ratio set_be_config.call("variant_ratio_of_defaults_as_sparse_column", "0.95") load_json_data.call(table_name, """${getS3Url() + '/load/logdata.json'}""") qt_sql_33 """ select json_extract(v,"\$.json.parseFailed") from logdata where json_extract(v,"\$.json.parseFailed") != 'null' order by k limit 1;""" - qt_sql_33_1 """select cast(v:json.parseFailed as string) from logdata where cast(v:json.parseFailed as string) is not null and k = 162 limit 1;""" + qt_sql_33_1 """select cast(v['json']['parseFailed'] as string) from logdata where cast(v['json']['parseFailed'] as string) is not null and k = 162 limit 1;""" sql "truncate table ${table_name}" // always sparse column @@ -308,7 +292,7 @@ suite("regression_test_variant", "nonConcurrent"){ qt_sql_34 """ select json_extract(v, "\$.json.parseFailed") from logdata where json_extract(v,"\$.json.parseFailed") != 'null' order by k limit 1;""" sql "truncate table ${table_name}" qt_sql_35 """select json_extract(v,"\$.json.parseFailed") from logdata where k = 162 and json_extract(v,"\$.json.parseFailed") != 'null';""" - qt_sql_35_1 """select cast(v:json.parseFailed as string) from logdata where cast(v:json.parseFailed as string) is not null and k = 162 limit 1;""" + qt_sql_35_1 """select cast(v['json']['parseFailed'] as string) from logdata where cast(v['json']['parseFailed'] as string) is not null and k = 162 limit 1;""" // TODO add test case that some certain columns are materialized in some file while others are not materilized(sparse) // unique table @@ -337,7 +321,7 @@ suite("regression_test_variant", "nonConcurrent"){ sql """insert into ${table_name} values (6, '{"j" : 1}'), (1, '{"a" : 1}')""" sql """insert into ${table_name} values (6, '{"k" : 1}'), (1, '{"a" : 1}')""" sql "select * from ${table_name}" - qt_sql_36_1 "select cast(v:a as int), cast(v:b as int), cast(v:c as int) from ${table_name} order by k limit 10" + qt_sql_36_1 "select cast(v['a'] as int), cast(v['b'] as int), cast(v['c'] as int) from ${table_name} order by k limit 10" sql "DELETE FROM ${table_name} WHERE k=1" sql "select * from ${table_name}" qt_sql_36_2 """select k, json_extract(cast(v as text), "\$.repo") from ${table_name} where k > 3 order by k desc limit 10""" @@ -392,7 +376,7 @@ suite("regression_test_variant", "nonConcurrent"){ set_be_config.call("variant_ratio_of_defaults_as_sparse_column", "0.95") sql """insert into sparse_columns select 0, '{"a": 1123, "b" : [123, {"xx" : 1}], "c" : {"c" : 456, "d" : null, "e" : 7.111}, "zzz" : null, "oooo" : {"akakaka" : null, "xxxx" : {"xxx" : 123}}}' as json_str union all select 0, '{"a" : 1234, "xxxx" : "kaana", "ddd" : {"aaa" : 123, "mxmxm" : [456, "789"]}}' as json_str from numbers("number" = "4096") limit 4096 ;""" - qt_sql_31 """select cast(v:xxxx as string) from sparse_columns where cast(v:xxxx as string) != 'null' order by k limit 1;""" + qt_sql_31 """select cast(v['xxxx'] as string) from sparse_columns where cast(v['xxxx'] as string) != 'null' order by k limit 1;""" sql "truncate table sparse_columns" set_be_config.call("variant_ratio_of_defaults_as_sparse_column", "0.95") } finally { diff --git a/regression-test/suites/variant_p0/schema_change/schema_change.groovy b/regression-test/suites/variant_p0/schema_change/schema_change.groovy index ff4ed1b56af9f7..fe593553fda9f0 100644 --- a/regression-test/suites/variant_p0/schema_change/schema_change.groovy +++ b/regression-test/suites/variant_p0/schema_change/schema_change.groovy @@ -45,18 +45,18 @@ suite("regression_test_variant_schema_change", "variant_type"){ assertTrue(useTime <= OpTimeout, "wait_for_latest_op_on_table_finish timeout") } - sql "set experimental_enable_nereids_planner = true" + // sql "set experimental_enable_nereids_planner = true" // add, drop columns sql """INSERT INTO ${table_name} SELECT *, '{"k1":1, "k2": "hello world", "k3" : [1234], "k4" : 1.10000, "k5" : [[123]]}' FROM numbers("number" = "4096")""" sql "alter table ${table_name} add column v2 variant default null" sql """INSERT INTO ${table_name} SELECT k, v, v from ${table_name}""" sql "alter table ${table_name} drop column v2" sql """INSERT INTO ${table_name} SELECT k, v from ${table_name}""" - qt_sql """select v:k1 from ${table_name} order by k limit 10""" + qt_sql """select v['k1'] from ${table_name} order by k limit 10""" sql "alter table ${table_name} add column vs string default null" sql """INSERT INTO ${table_name} SELECT k, v, v from ${table_name}""" - qt_sql """select v:k1 from ${table_name} order by k desc limit 10""" - qt_sql """select v:k1, cast(v:k2 as string) from ${table_name} order by k desc limit 10""" + qt_sql """select v['k1'] from ${table_name} order by k desc limit 10""" + qt_sql """select v['k1'], cast(v['k2'] as string) from ${table_name} order by k desc limit 10""" // sql "set experimental_enable_nereids_planner = true" // add, drop index @@ -67,10 +67,8 @@ suite("regression_test_variant_schema_change", "variant_type"){ sql "drop index btm_idxk on ${table_name};" sql """INSERT INTO ${table_name} SELECT k, v, v from ${table_name} limit 1024""" wait_for_latest_op_on_table_finish(table_name, timeout) - qt_sql """select v:k1 from ${table_name} order by k desc limit 10""" - qt_sql """select v:k1, cast(v:k2 as string) from ${table_name} order by k desc limit 10""" - - sql "set experimental_enable_nereids_planner = false" + qt_sql """select v['k1'] from ${table_name} order by k desc limit 10""" + qt_sql """select v['k1'], cast(v['k2'] as string) from ${table_name} order by k desc limit 10""" // add, drop materialized view createMV("""create materialized view var_order as select vs, k, v from ${table_name} order by vs""") @@ -79,5 +77,6 @@ suite("regression_test_variant_schema_change", "variant_type"){ sql """INSERT INTO ${table_name} SELECT k, v, v from ${table_name} limit 8101""" sql """DROP MATERIALIZED VIEW var_cnt ON ${table_name}""" sql """INSERT INTO ${table_name} SELECT k, v,v from ${table_name} limit 1111""" - qt_sql """select v:k1, cast(v:k2 as string) from ${table_name} order by k desc limit 10""" + // TODO support select from mv + // qt_sql """select v['k1'], cast(v['k2'] as string) from ${table_name} order by k desc limit 10""" } \ No newline at end of file diff --git a/regression-test/suites/variant_p0/schema_change/test_double_write_when_schema_change.groovy b/regression-test/suites/variant_p0/schema_change/test_double_write_when_schema_change.groovy index 335d4f9901298b..923f7ee49da7e0 100644 --- a/regression-test/suites/variant_p0/schema_change/test_double_write_when_schema_change.groovy +++ b/regression-test/suites/variant_p0/schema_change/test_double_write_when_schema_change.groovy @@ -101,16 +101,16 @@ suite("double_write_schema_change_with_variant") { } } - qt_sql "select v:type, v:id, v:created_at from ${table_name} where cast(v:id as bigint) != 25061216922 order by k, cast(v:id as bigint) limit 10" + qt_sql "select v['type'], v['id'], v['created_at'] from ${table_name} where cast(v['id'] as bigint) != 25061216922 order by k, cast(v['id'] as bigint) limit 10" sql """ ALTER TABLE ${table_name} modify COLUMN change_column text""" double_write.call() sql """ALTER TABLE ${table_name} drop index idx_var""" double_write.call() - qt_sql "select v:type, v:id, v:created_at from ${table_name} where cast(v:id as bigint) != 25061216922 order by k, cast(v:id as bigint) limit 10" + qt_sql "select v['type'], v['id'], v['created_at'] from ${table_name} where cast(v['id'] as bigint) != 25061216922 order by k, cast(v['id'] as bigint) limit 10" createMV("create materialized view xxx as select k, sum(k) from ${table_name} group by k order by k;") - qt_sql "select v:type, v:id, v:created_at from ${table_name} where cast(v:id as bigint) != 25061216922 order by k, cast(v:id as bigint) limit 10" + qt_sql "select v['type'], v['id'], v['created_at'] from ${table_name} where cast(v['id'] as bigint) != 25061216922 order by k, cast(v['id'] as bigint) limit 10" set_be_config.call("memory_limitation_per_thread_for_schema_change_bytes", "2147483648") } diff --git a/regression-test/suites/variant_p0/sql/rewrite_or_to_in.sql b/regression-test/suites/variant_p0/sql/rewrite_or_to_in.sql index e8fd6ac56052c0..35f3bbdc171e8e 100644 --- a/regression-test/suites/variant_p0/sql/rewrite_or_to_in.sql +++ b/regression-test/suites/variant_p0/sql/rewrite_or_to_in.sql @@ -1,6 +1,6 @@ set rewrite_or_to_in_predicate_threshold = 2; select - cast(v:type as string), cast(v:repo.name as string), cast(v:created_at as string) + cast(v["type"] as string), cast(v["repo"]["name"] as string), cast(v['created_at'] as string) from ghdata -where cast(v:type as string) = 'Delete' or cast(v:repo.name as string) = 'megan777/calculator' or cast(v:created_as as string) = '2021-01-02T16:37:26Z' +where cast(v["type"] as string) = 'Delete' or cast(v["repo"]["name"] as string) = 'megan777/calculator' or cast(v["created_as"] as string) = '2021-01-02T16:37:26Z' order by k limit 10; \ No newline at end of file diff --git a/regression-test/suites/variant_p0/tpch/load.groovy b/regression-test/suites/variant_p0/tpch/load.groovy index 664754a2a9ab0a..ae202c05a7c5ca 100644 --- a/regression-test/suites/variant_p0/tpch/load.groovy +++ b/regression-test/suites/variant_p0/tpch/load.groovy @@ -25,7 +25,7 @@ // Note: To filter out tables from sql files, use the following one-liner comamnd // sed -nr 's/.*tables: (.*)$/\1/gp' /path/to/*.sql | sed -nr 's/,/\n/gp' | sort | uniq -suite("load_tpch") { +suite("load") { def tables = ["customer", "lineitem", "nation", diff --git a/regression-test/suites/variant_p0/tpch/sql/q01_trans.sql b/regression-test/suites/variant_p0/tpch/sql/q01_trans.sql index 31702bbc43a7ee..39e0c33367f6c2 100644 --- a/regression-test/suites/variant_p0/tpch/sql/q01_trans.sql +++ b/regression-test/suites/variant_p0/tpch/sql/q01_trans.sql @@ -1,5 +1,5 @@ -- TABLES: lineitem -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ CAST(var["L_RETURNFLAG"] AS TEXT), CAST(var["L_LINESTATUS"] AS TEXT), SUM(CAST(var["L_QUANTITY"] AS DOUBLE)) AS SUM_QTY, diff --git a/regression-test/suites/variant_p0/tpch/sql/q02_trans.sql b/regression-test/suites/variant_p0/tpch/sql/q02_trans.sql index d6fd9ba6e7b31b..06694cd68b0dd7 100644 --- a/regression-test/suites/variant_p0/tpch/sql/q02_trans.sql +++ b/regression-test/suites/variant_p0/tpch/sql/q02_trans.sql @@ -1,5 +1,5 @@ -- TABLES: part,SUPPLIER,partsupp,NATION,REGION -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ CAST(SS.var["S_ACCTBAL"] AS DOUBLE), CAST(SS.var["S_NAME"] AS TEXT), CAST(NN.var["N_NAME"] AS TEXT), diff --git a/regression-test/suites/variant_p0/tpch/sql/q03_trans.sql b/regression-test/suites/variant_p0/tpch/sql/q03_trans.sql index 6bbf319f9f2550..9450e42fe22da7 100644 --- a/regression-test/suites/variant_p0/tpch/sql/q03_trans.sql +++ b/regression-test/suites/variant_p0/tpch/sql/q03_trans.sql @@ -1,6 +1,6 @@ -- TABLES: customer,orders,lineitem -- ERROR: not stable -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ CAST(L.var["L_ORDERKEY"] AS INT), SUM(CAST(L.var["L_EXTENDEDPRICE"] AS DOUBLE) * (1 - CAST(L.var["L_DISCOUNT"] AS DOUBLE))) AS REVENUE, CAST(O.var["O_ORDERDATE"] AS TEXT), diff --git a/regression-test/suites/variant_p0/tpch/sql/q05_trans.sql b/regression-test/suites/variant_p0/tpch/sql/q05_trans.sql index e7a40478c20dfc..f62776da6d0e2d 100644 --- a/regression-test/suites/variant_p0/tpch/sql/q05_trans.sql +++ b/regression-test/suites/variant_p0/tpch/sql/q05_trans.sql @@ -1,5 +1,5 @@ -- TABLES: customer,orders,lineitem,SUPPLIER,NATION,REGION -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ CAST(N.var["N_NAME"] AS TEXT), SUM(CAST(L.var["L_EXTENDEDPRICE"] AS DOUBLE) * (1 - CAST(L.var["L_DISCOUNT"] AS DOUBLE))) AS REVENUE FROM diff --git a/regression-test/suites/variant_p0/tpch/sql/q06_trans.sql b/regression-test/suites/variant_p0/tpch/sql/q06_trans.sql index 8aae769866f122..8ee005f8e56e44 100644 --- a/regression-test/suites/variant_p0/tpch/sql/q06_trans.sql +++ b/regression-test/suites/variant_p0/tpch/sql/q06_trans.sql @@ -1,6 +1,6 @@ -- TABLES: lineitem - -SELECT SUM(CAST(var["L_EXTENDEDPRICE"] AS DOUBLE) * CAST(var["L_DISCOUNT"] AS DOUBLE)) AS REVENUE +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ +SUM(CAST(var["L_EXTENDEDPRICE"] AS DOUBLE) * CAST(var["L_DISCOUNT"] AS DOUBLE)) AS REVENUE FROM lineitem WHERE diff --git a/regression-test/suites/variant_p0/tpch/sql/q08_trans.sql b/regression-test/suites/variant_p0/tpch/sql/q08_trans.sql index 7dbb964d0a9651..5cae69badc8a79 100644 --- a/regression-test/suites/variant_p0/tpch/sql/q08_trans.sql +++ b/regression-test/suites/variant_p0/tpch/sql/q08_trans.sql @@ -1,6 +1,6 @@ -- TABLES: part,SUPPLIER,lineitem,orders,customer,NATION,REGION -- ERROR: not stable -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ O_YEAR, SUM(CASE WHEN NATION = 'BRAZIL' diff --git a/regression-test/suites/variant_p0/tpch/sql/q09_trans.sql b/regression-test/suites/variant_p0/tpch/sql/q09_trans.sql index 665d24997989c7..ddbc82812bc5b2 100644 --- a/regression-test/suites/variant_p0/tpch/sql/q09_trans.sql +++ b/regression-test/suites/variant_p0/tpch/sql/q09_trans.sql @@ -1,6 +1,6 @@ -- TABLES: part,SUPPLIER,lineitem,partsupp,orders,NATION -- ERROR: not stable -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ NATION, O_YEAR, SUM(AMOUNT) AS SUM_PROFIT diff --git a/regression-test/suites/variant_p0/tpch/sql/q10_trans.sql b/regression-test/suites/variant_p0/tpch/sql/q10_trans.sql index 293abc01e49943..cb3cdbf6ee51a0 100644 --- a/regression-test/suites/variant_p0/tpch/sql/q10_trans.sql +++ b/regression-test/suites/variant_p0/tpch/sql/q10_trans.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ CAST(C.var["C_CUSTKEY"] AS INT), CAST(C.var["C_NAME"] AS TEXT), SUM(CAST(L.var["L_EXTENDEDPRICE"] AS DOUBLE) * (1 - CAST(L.var["L_DISCOUNT"] AS DOUBLE))) AS REVENUE, diff --git a/regression-test/suites/variant_p0/tpch/sql/q12_trans.sql b/regression-test/suites/variant_p0/tpch/sql/q12_trans.sql index 5e2546e3622a1c..9df916cbc259ae 100644 --- a/regression-test/suites/variant_p0/tpch/sql/q12_trans.sql +++ b/regression-test/suites/variant_p0/tpch/sql/q12_trans.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ CAST(L.var["L_SHIPMODE"] AS TEXT), SUM(CASE WHEN CAST(O.var["O_ORDERPRIORITY"] AS TEXT) = '1-URGENT' diff --git a/regression-test/suites/variant_p0/tpch/sql/q13_trans.sql b/regression-test/suites/variant_p0/tpch/sql/q13_trans.sql index b9e36abe05d7e2..ef10868dcf3afe 100644 --- a/regression-test/suites/variant_p0/tpch/sql/q13_trans.sql +++ b/regression-test/suites/variant_p0/tpch/sql/q13_trans.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ C_COUNT, COUNT(*) AS CUSTDIST FROM ( diff --git a/regression-test/suites/variant_p0/tpch/sql/q14_trans.sql b/regression-test/suites/variant_p0/tpch/sql/q14_trans.sql index eada50d85729ca..ddf798cc338f75 100644 --- a/regression-test/suites/variant_p0/tpch/sql/q14_trans.sql +++ b/regression-test/suites/variant_p0/tpch/sql/q14_trans.sql @@ -1,4 +1,5 @@ -SELECT 100.00 * SUM(CASE +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ +100.00 * SUM(CASE WHEN CAST(P.var["P_TYPE"] AS TEXT) LIKE 'PROMO%' THEN CAST(L.var["L_EXTENDEDPRICE"] AS DOUBLE) * (1 - CAST(L.var["L_DISCOUNT"] AS DOUBLE)) ELSE 0 diff --git a/regression-test/suites/variant_p0/tpch/sql/q16_trans.sql b/regression-test/suites/variant_p0/tpch/sql/q16_trans.sql index 52efbc8c16d978..2819cc03a5aa03 100644 --- a/regression-test/suites/variant_p0/tpch/sql/q16_trans.sql +++ b/regression-test/suites/variant_p0/tpch/sql/q16_trans.sql @@ -1,4 +1,4 @@ -SELECT +SELECT /*+SET_VAR(enable_fallback_to_original_planner=false) */ CAST(P.var["P_BRAND"] AS TEXT), CAST(P.var["P_TYPE"] AS TEXT), CAST(P.var["P_SIZE"] AS INT), diff --git a/regression-test/suites/variant_p0/variant_hirachinal.groovy b/regression-test/suites/variant_p0/variant_hirachinal.groovy index 5ad12cdbeeaad1..c0529b6ca80580 100644 --- a/regression-test/suites/variant_p0/variant_hirachinal.groovy +++ b/regression-test/suites/variant_p0/variant_hirachinal.groovy @@ -39,7 +39,6 @@ suite("regression_test_variant_hirachinal", "variant_type"){ DISTRIBUTED BY HASH(k) BUCKETS 1 properties("replication_num" = "1", "disable_auto_compaction" = "false"); """ - sql "set experimental_enable_nereids_planner = false" sql """insert into ${table_name} values (-3, '{"a" : 1, "b" : 1.5, "c" : [1, 2, 3]}')""" sql """insert into ${table_name} select -2, '{"a": 11245, "b" : [123, {"xx" : 1}], "c" : {"c" : 456, "d" : "null", "e" : 7.111}}' as json_str union all select -1, '{"a": 1123}' as json_str union all select *, '{"a" : 1234, "xxxx" : "kaana"}' as json_str from numbers("number" = "4096") limit 4096 ;""" diff --git a/regression-test/suites/variant_p0/with_index/load.groovy b/regression-test/suites/variant_p0/with_index/load.groovy index 75a0e146a19ae4..548c376f36cfce 100644 --- a/regression-test/suites/variant_p0/with_index/load.groovy +++ b/regression-test/suites/variant_p0/with_index/load.groovy @@ -60,7 +60,7 @@ suite("regression_test_variant_with_index", "nonConcurrent"){ """ sql """insert into var_with_index values(1, '{"a" : 0, "b": 3}', 'hello world'), (2, '{"a" : 123}', 'world'),(3, '{"a" : 123}', 'hello world')""" qt_sql_inv_1 """select v["a"] from var_with_index where inv match 'hello' order by k""" - qt_sql_inv_2 """select v["a"] from var_with_index where inv match 'hello' and cast(v:a as int) > 0 order by k""" + qt_sql_inv_2 """select v["a"] from var_with_index where inv match 'hello' and cast(v['a'] as int) > 0 order by k""" qt_sql_inv_3 """select * from var_with_index where inv match 'hello' and cast(v["a"] as int) > 0 order by k""" sql "truncate table var_with_index" // set back configs @@ -78,7 +78,7 @@ suite("regression_test_variant_with_index", "nonConcurrent"){ wait_for_latest_op_on_table_finish(table_name, timeout) show_result = sql "show index from ${table_name}" assertEquals(show_result.size(), 0) - qt_sql_inv4 """select v["a1"] from ${table_name} where cast(v:a1 as int) = 0""" + qt_sql_inv4 """select v["a1"] from ${table_name} where cast(v['a1'] as int) = 0""" qt_sql_inv5 """select * from ${table_name} order by k""" sql "create index inv_idx on ${table_name}(`inv`) using inverted" wait_for_latest_op_on_table_finish(table_name, timeout) diff --git a/regression-test/suites/variant_p2/sql/authorsWithTheMostPushes.sql b/regression-test/suites/variant_p2/sql/authorsWithTheMostPushes.sql index 184d7fd6e84246..c4e6e645d8bf46 100644 --- a/regression-test/suites/variant_p2/sql/authorsWithTheMostPushes.sql +++ b/regression-test/suites/variant_p2/sql/authorsWithTheMostPushes.sql @@ -1,9 +1,9 @@ SELECT - cast(actor:login as string), + cast(actor['login'] as string), count() AS c, - count(distinct cast(repo:name as string)) AS repos + count(distinct cast(repo['name'] as string)) AS repos FROM github_events WHERE type = 'PushEvent' - GROUP BY cast(actor:login as string) + GROUP BY cast(actor['login'] as string) ORDER BY c DESC, 1, 3 LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/countingStar2.sql b/regression-test/suites/variant_p2/sql/countingStar2.sql index 85301adddfef93..0a8eccc2c47c54 100644 --- a/regression-test/suites/variant_p2/sql/countingStar2.sql +++ b/regression-test/suites/variant_p2/sql/countingStar2.sql @@ -1 +1 @@ -SELECT cast(payload:action as string), count() FROM github_events WHERE type = 'WatchEvent' GROUP BY cast(payload:action as string) \ No newline at end of file +SELECT cast(payload['action'] as string), count() FROM github_events WHERE type = 'WatchEvent' GROUP BY cast(payload['action'] as string) \ No newline at end of file diff --git a/regression-test/suites/variant_p2/sql/countingStar3.sql b/regression-test/suites/variant_p2/sql/countingStar3.sql index c1530e6c0abbdc..61dc050014a2bb 100644 --- a/regression-test/suites/variant_p2/sql/countingStar3.sql +++ b/regression-test/suites/variant_p2/sql/countingStar3.sql @@ -1 +1 @@ - SELECT count() FROM github_events WHERE type = 'WatchEvent' AND cast(repo:name as string) IN ('apache/spark', 'GunZi200/Memory-Colour', 'isohuntto/openbay', 'wasabeef/awesome-android-ui') GROUP BY cast(payload:action as string) \ No newline at end of file + SELECT count() FROM github_events WHERE type = 'WatchEvent' AND cast(repo["name"] as string) IN ('apache/spark', 'GunZi200/Memory-Colour', 'isohuntto/openbay', 'wasabeef/awesome-android-ui') GROUP BY cast(payload["action"] as string) \ No newline at end of file diff --git a/regression-test/suites/variant_p2/sql/distributionOfRepositoriesByStarCount.sql b/regression-test/suites/variant_p2/sql/distributionOfRepositoriesByStarCount.sql index 3cc0e2ea791781..06e96346e1cda1 100644 --- a/regression-test/suites/variant_p2/sql/distributionOfRepositoriesByStarCount.sql +++ b/regression-test/suites/variant_p2/sql/distributionOfRepositoriesByStarCount.sql @@ -4,11 +4,11 @@ SELECT FROM ( SELECT - cast(repo:name as string) as k, + cast(repo["name"] as string) as k, count() AS c FROM github_events WHERE type = 'WatchEvent' - GROUP BY cast(repo:name as string) + GROUP BY cast(repo["name"] as string) ) t GROUP BY stars ORDER BY stars ASC diff --git a/regression-test/suites/variant_p2/sql/githubRoulette.sql b/regression-test/suites/variant_p2/sql/githubRoulette.sql index 4fc2555cef6678..e45e7829ba5002 100644 --- a/regression-test/suites/variant_p2/sql/githubRoulette.sql +++ b/regression-test/suites/variant_p2/sql/githubRoulette.sql @@ -1 +1 @@ -SELECT cast(repo:name as string) FROM github_events WHERE type = 'WatchEvent' ORDER BY created_at, cast(repo:name as string) LIMIT 50 \ No newline at end of file +SELECT cast(repo["name"] as string) FROM github_events WHERE type = 'WatchEvent' ORDER BY created_at, cast(repo["name"] as string) LIMIT 50 \ No newline at end of file diff --git a/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears1.sql b/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears1.sql index 4f55826ff68b00..b262cd242c7310 100644 --- a/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears1.sql +++ b/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears1.sql @@ -1 +1 @@ -SELECT cast(repo:name as string), count() AS stars FROM github_events WHERE type = 'WatchEvent' AND year(created_at) = '2015' GROUP BY cast(repo:name as string) ORDER BY stars DESC, 1 LIMIT 50 +SELECT cast(repo["name"] as string), count() AS stars FROM github_events WHERE type = 'WatchEvent' AND year(created_at) = '2015' GROUP BY cast(repo["name"] as string) ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears2.sql b/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears2.sql index 4f55826ff68b00..b262cd242c7310 100644 --- a/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears2.sql +++ b/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears2.sql @@ -1 +1 @@ -SELECT cast(repo:name as string), count() AS stars FROM github_events WHERE type = 'WatchEvent' AND year(created_at) = '2015' GROUP BY cast(repo:name as string) ORDER BY stars DESC, 1 LIMIT 50 +SELECT cast(repo["name"] as string), count() AS stars FROM github_events WHERE type = 'WatchEvent' AND year(created_at) = '2015' GROUP BY cast(repo["name"] as string) ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears3.sql b/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears3.sql index 076aaf3054f829..b8a3c242706c49 100644 --- a/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears3.sql +++ b/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears3.sql @@ -1 +1 @@ -SELECT cast(repo:name as string), count() AS stars FROM github_events WHERE type = 'WatchEvent' AND year(created_at) = '2015' GROUP BY cast(repo:name as string) ORDER BY stars DESC, cast(repo:name as string) LIMIT 50 +SELECT cast(repo["name"] as string), count() AS stars FROM github_events WHERE type = 'WatchEvent' AND year(created_at) = '2015' GROUP BY cast(repo["name"] as string) ORDER BY stars DESC, cast(repo["name"] as string) LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears4.sql b/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears4.sql index 4f55826ff68b00..b262cd242c7310 100644 --- a/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears4.sql +++ b/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears4.sql @@ -1 +1 @@ -SELECT cast(repo:name as string), count() AS stars FROM github_events WHERE type = 'WatchEvent' AND year(created_at) = '2015' GROUP BY cast(repo:name as string) ORDER BY stars DESC, 1 LIMIT 50 +SELECT cast(repo["name"] as string), count() AS stars FROM github_events WHERE type = 'WatchEvent' AND year(created_at) = '2015' GROUP BY cast(repo["name"] as string) ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears5.sql b/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears5.sql index 4f55826ff68b00..b262cd242c7310 100644 --- a/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears5.sql +++ b/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears5.sql @@ -1 +1 @@ -SELECT cast(repo:name as string), count() AS stars FROM github_events WHERE type = 'WatchEvent' AND year(created_at) = '2015' GROUP BY cast(repo:name as string) ORDER BY stars DESC, 1 LIMIT 50 +SELECT cast(repo["name"] as string), count() AS stars FROM github_events WHERE type = 'WatchEvent' AND year(created_at) = '2015' GROUP BY cast(repo["name"] as string) ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears6.sql b/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears6.sql index 4f55826ff68b00..b262cd242c7310 100644 --- a/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears6.sql +++ b/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears6.sql @@ -1 +1 @@ -SELECT cast(repo:name as string), count() AS stars FROM github_events WHERE type = 'WatchEvent' AND year(created_at) = '2015' GROUP BY cast(repo:name as string) ORDER BY stars DESC, 1 LIMIT 50 +SELECT cast(repo["name"] as string), count() AS stars FROM github_events WHERE type = 'WatchEvent' AND year(created_at) = '2015' GROUP BY cast(repo["name"] as string) ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears7.sql b/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears7.sql index 836e3f24c10626..71ef817ecb4582 100644 --- a/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears7.sql +++ b/regression-test/suites/variant_p2/sql/howHasTheListOfTopRepositoriesChangedOverTheYears7.sql @@ -12,7 +12,7 @@ FROM FROM ( SELECT - lower(cast(repo:name as string)) AS repo_name, + lower(cast(repo["name"] as string)) AS repo_name, year(created_at) AS year, count() AS cnt FROM github_events diff --git a/regression-test/suites/variant_p2/sql/issuesWithTheMostComments2.sql b/regression-test/suites/variant_p2/sql/issuesWithTheMostComments2.sql index 3a96ad5804b1e1..093ecfa03b0c9b 100644 --- a/regression-test/suites/variant_p2/sql/issuesWithTheMostComments2.sql +++ b/regression-test/suites/variant_p2/sql/issuesWithTheMostComments2.sql @@ -1 +1 @@ -SELECT cast(repo:name as string), count() FROM github_events WHERE type = 'IssueCommentEvent' GROUP BY cast(repo:name as string) ORDER BY count() DESC, 1 LIMIT 50 +SELECT cast(repo["name"] as string), count() FROM github_events WHERE type = 'IssueCommentEvent' GROUP BY cast(repo["name"] as string) ORDER BY count() DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/issuesWithTheMostComments3.sql b/regression-test/suites/variant_p2/sql/issuesWithTheMostComments3.sql index 36c76fc9bc7a06..400fb1624cfcff 100644 --- a/regression-test/suites/variant_p2/sql/issuesWithTheMostComments3.sql +++ b/regression-test/suites/variant_p2/sql/issuesWithTheMostComments3.sql @@ -6,12 +6,12 @@ SELECT FROM ( SELECT - cast(repo:name as string) as repo_name, + cast(repo["name"] as string) as repo_name, count() AS comments, - count(distinct cast(payload:issue.`number` as int)) AS issues + count(distinct cast(payload["issue"]["number"] as int)) AS issues FROM github_events WHERE type = 'IssueCommentEvent' - GROUP BY cast(repo:name as string) + GROUP BY cast(repo["name"] as string) ) t ORDER BY comments DESC, 1, 3, 4 LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/issuesWithTheMostComments4.sql b/regression-test/suites/variant_p2/sql/issuesWithTheMostComments4.sql index 3375d63c66ee6b..28537972f55373 100644 --- a/regression-test/suites/variant_p2/sql/issuesWithTheMostComments4.sql +++ b/regression-test/suites/variant_p2/sql/issuesWithTheMostComments4.sql @@ -1,10 +1,10 @@ SELECT - cast(repo:name as string), - cast(payload:issue.`number` as int) as number, + cast(repo["name"] as string), + cast(payload["issue"]["number"] as int) as number, count() AS comments FROM github_events -WHERE type = 'IssueCommentEvent' AND (cast(payload:action as string) = 'created') -GROUP BY cast(repo:name as string), number +WHERE type = 'IssueCommentEvent' AND (cast(payload["action"] as string) = 'created') +GROUP BY cast(repo["name"] as string), number ORDER BY comments DESC, number ASC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/issuesWithTheMostComments5.sql b/regression-test/suites/variant_p2/sql/issuesWithTheMostComments5.sql index 71be66e5d82278..54f3f39052dfc6 100644 --- a/regression-test/suites/variant_p2/sql/issuesWithTheMostComments5.sql +++ b/regression-test/suites/variant_p2/sql/issuesWithTheMostComments5.sql @@ -1,9 +1,9 @@ SELECT - cast(repo:name as string), - cast(payload:issue.number as int) as number, + cast(repo["name"] as string), + cast(payload["issue"]["number"] as int) as number, count() AS comments FROM github_events -WHERE type = 'IssueCommentEvent' AND (cast(payload:action as string) = 'created') AND (cast(payload:issue.number as int) > 10) -GROUP BY cast(repo:name as string), number -ORDER BY comments DESC, cast(repo:name as string), number +WHERE type = 'IssueCommentEvent' AND (cast(payload["action"] as string) = 'created') AND (cast(payload["issue"]["number"] as int) > 10) +GROUP BY cast(repo["name"] as string), number +ORDER BY comments DESC, cast(repo["name"] as string), number LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/issuesWithTheMostComments6.sql b/regression-test/suites/variant_p2/sql/issuesWithTheMostComments6.sql index 80503c1e1d303e..c5aecddb9f8422 100644 --- a/regression-test/suites/variant_p2/sql/issuesWithTheMostComments6.sql +++ b/regression-test/suites/variant_p2/sql/issuesWithTheMostComments6.sql @@ -1,11 +1,11 @@ SELECT - cast(repo:name as string), - cast(payload:issue.`number` as int) as number, + cast(repo["name"] as string), + cast(payload["issue"]["number"] as int) as number, count() AS comments, - count(distinct cast(actor:login as string)) AS authors + count(distinct cast(actor["login"] as string)) AS authors FROM github_events -WHERE type = 'IssueCommentEvent' AND (cast(payload:action as string) = 'created') AND (cast(payload:issue.`number` as int) > 10) -GROUP BY cast(repo:name as string), number +WHERE type = 'IssueCommentEvent' AND (cast(payload["action"] as string) = 'created') AND (cast(payload["issue"]["number"] as int) > 10) +GROUP BY cast(repo["name"] as string), number HAVING authors >= 4 ORDER BY comments DESC, number LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/issuesWithTheMostComments7.sql b/regression-test/suites/variant_p2/sql/issuesWithTheMostComments7.sql index cd0a367522c3ac..e95ccbc23a0964 100644 --- a/regression-test/suites/variant_p2/sql/issuesWithTheMostComments7.sql +++ b/regression-test/suites/variant_p2/sql/issuesWithTheMostComments7.sql @@ -1,9 +1,9 @@ SELECT - cast(repo:name as string), + cast(repo["name"] as string), count() AS comments, - count(distinct cast(actor:login as string)) AS authors + count(distinct cast(actor["login"] as string)) AS authors FROM github_events WHERE type = 'CommitCommentEvent' -GROUP BY cast(repo:name as string) +GROUP BY cast(repo["name"] as string) ORDER BY count() DESC, 1, 3 LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/issuesWithTheMostComments8.sql b/regression-test/suites/variant_p2/sql/issuesWithTheMostComments8.sql index 3b26dd4b6db556..c5fa2c33cd46f4 100644 --- a/regression-test/suites/variant_p2/sql/issuesWithTheMostComments8.sql +++ b/regression-test/suites/variant_p2/sql/issuesWithTheMostComments8.sql @@ -1,12 +1,12 @@ SELECT - concat('https://github.com/', cast(repo:name as string), '/commit/', cast(payload:commit_id as string)) URL, - cast(payload:commit_id as string) AS commit_id, + concat('https://github.com/', cast(repo["name"] as string), '/commit/', cast(payload["commit_id"] as string)) URL, + cast(payload["commit_id"] as string) AS commit_id, count() AS comments, - count(distinct cast(actor:login as string)) AS authors + count(distinct cast(actor["login"] as string)) AS authors FROM github_events -WHERE (type = 'CommitCommentEvent') AND cast(payload:commit_id as string) != "" +WHERE (type = 'CommitCommentEvent') AND cast(payload["commit_id"] as string) != "" GROUP BY - cast(repo:name as string), + cast(repo["name"] as string), commit_id HAVING authors >= 10 ORDER BY count() DESC, URL, authors diff --git a/regression-test/suites/variant_p2/sql/mostForkedRepositories.sql b/regression-test/suites/variant_p2/sql/mostForkedRepositories.sql index 6dd01ef3fb0cc1..2aca03dea0225c 100644 --- a/regression-test/suites/variant_p2/sql/mostForkedRepositories.sql +++ b/regression-test/suites/variant_p2/sql/mostForkedRepositories.sql @@ -1 +1 @@ -SELECT cast(repo:name as string), count() AS forks FROM github_events WHERE type = 'ForkEvent' GROUP BY cast(repo:name as string) ORDER BY forks DESC, 1 LIMIT 50 +SELECT cast(repo["name"] as string), count() AS forks FROM github_events WHERE type = 'ForkEvent' GROUP BY cast(repo["name"] as string) ORDER BY forks DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/mostPopularCommentsOnGithub.sql b/regression-test/suites/variant_p2/sql/mostPopularCommentsOnGithub.sql index 2ca3979cfa87ce..1b2e41f66fb5f1 100644 --- a/regression-test/suites/variant_p2/sql/mostPopularCommentsOnGithub.sql +++ b/regression-test/suites/variant_p2/sql/mostPopularCommentsOnGithub.sql @@ -1 +1 @@ --- SELECT cast(payload:comment.body as string) as comment, count() FROM github_events WHERE cast(payload:comment.body as string) != "" AND length(cast(payload:comment.body as string)) < 100 GROUP BY comment ORDER BY count() DESC, comment, 1 LIMIT 1 \ No newline at end of file +-- SELECT cast(payload["comment"]["body"] as string) as comment, count() FROM github_events WHERE cast(payload["comment"]["body"] as string) != "" AND length(cast(payload["comment"]["body"] as string)) < 100 GROUP BY comment ORDER BY count() DESC, comment, 1 LIMIT 1 \ No newline at end of file diff --git a/regression-test/suites/variant_p2/sql/organizationsByTheNumberOfRepositories.sql b/regression-test/suites/variant_p2/sql/organizationsByTheNumberOfRepositories.sql index f7411c1e9f4926..c7f2265c217fc2 100644 --- a/regression-test/suites/variant_p2/sql/organizationsByTheNumberOfRepositories.sql +++ b/regression-test/suites/variant_p2/sql/organizationsByTheNumberOfRepositories.sql @@ -3,10 +3,10 @@ SELECT count(distinct repo_name) AS repos FROM ( - SELECT cast(repo:name as string) as repo_name + SELECT cast(repo["name"] as string) as repo_name FROM github_events WHERE type = 'WatchEvent' - GROUP BY cast(repo:name as string) + GROUP BY cast(repo["name"] as string) HAVING count() >= 10 ) t GROUP BY org diff --git a/regression-test/suites/variant_p2/sql/organizationsByTheNumberOfStars.sql b/regression-test/suites/variant_p2/sql/organizationsByTheNumberOfStars.sql index e6c1dd9e448bdb..7b4ea619c0f273 100644 --- a/regression-test/suites/variant_p2/sql/organizationsByTheNumberOfStars.sql +++ b/regression-test/suites/variant_p2/sql/organizationsByTheNumberOfStars.sql @@ -2,7 +2,7 @@ SELECT lower(split_part(repo_name, '/', 1)) AS org, count() AS stars FROM ( - SELECT cast(repo:name as string) as repo_name + SELECT cast(repo["name"] as string) as repo_name FROM github_events WHERE type = 'WatchEvent' ) t diff --git a/regression-test/suites/variant_p2/sql/organizationsByTheSizeOfCommunity.sql b/regression-test/suites/variant_p2/sql/organizationsByTheSizeOfCommunity.sql index f7f8d6bcde4dd0..5621413407050a 100644 --- a/regression-test/suites/variant_p2/sql/organizationsByTheSizeOfCommunity.sql +++ b/regression-test/suites/variant_p2/sql/organizationsByTheSizeOfCommunity.sql @@ -9,13 +9,13 @@ SELECT FROM ( SELECT - cast(repo:name as string) as repo_name, - cast(actor:login as string) as actor_login, - CASE WHEN type = 'PullRequestEvent' THEN cast(actor:login as string) ELSE NULL END pr_author, - CASE WHEN type = 'IssuesEvent' THEN cast(actor:login as string) ELSE NULL END issue_author, - CASE WHEN type = 'IssueCommentEvent' THEN cast(actor:login as string) ELSE NULL END comment_author, - CASE WHEN type = 'PullRequestReviewCommentEvent' THEN cast(actor:login as string) ELSE NULL END review_author, - CASE WHEN type = 'PushEvent' THEN cast(actor:login as string) ELSE NULL END push_author + cast(repo["name"] as string) as repo_name, + cast(actor["login"] as string) as actor_login, + CASE WHEN type = 'PullRequestEvent' THEN cast(actor["login"] as string) ELSE NULL END pr_author, + CASE WHEN type = 'IssuesEvent' THEN cast(actor["login"] as string) ELSE NULL END issue_author, + CASE WHEN type = 'IssueCommentEvent' THEN cast(actor["login"] as string) ELSE NULL END comment_author, + CASE WHEN type = 'PullRequestReviewCommentEvent' THEN cast(actor["login"] as string) ELSE NULL END review_author, + CASE WHEN type = 'PushEvent' THEN cast(actor["login"] as string) ELSE NULL END push_author FROM github_events WHERE type IN ('PullRequestEvent', 'IssuesEvent', 'IssueCommentEvent', 'PullRequestReviewCommentEvent', 'PushEvent') ) t diff --git a/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks1.sql b/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks1.sql index 738cc9a962e356..8800d1fbd5e4e1 100644 --- a/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks1.sql +++ b/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks1.sql @@ -6,7 +6,7 @@ SELECT FROM ( SELECT - cast(repo:name as string) as repo_name, + cast(repo["name"] as string) as repo_name, CASE WHEN type = 'ForkEvent' THEN 1 ELSE 0 END AS fork, CASE WHEN type = 'WatchEvent' THEN 1 ELSE 0 END AS star FROM github_events diff --git a/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks2.sql b/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks2.sql index 0d98ee9ce67098..6b8e977d8088ea 100644 --- a/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks2.sql +++ b/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks2.sql @@ -6,7 +6,7 @@ SELECT FROM ( SELECT - cast(repo:name as string) as repo_name, + cast(repo["name"] as string) as repo_name, CASE WHEN type = 'ForkEvent' THEN 1 ELSE 0 END AS fork, CASE WHEN type = 'WatchEvent' THEN 1 ELSE 0 END AS star FROM github_events diff --git a/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks3.sql b/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks3.sql index abd98d8f080265..fd2df7b4950041 100644 --- a/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks3.sql +++ b/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks3.sql @@ -6,7 +6,7 @@ SELECT FROM ( SELECT - cast(repo:name as string) as repo_name, + cast(repo["name"] as string) as repo_name, CASE WHEN type = 'ForkEvent' THEN 1 ELSE 0 END AS fork, CASE WHEN type = 'WatchEvent' THEN 1 ELSE 0 END AS star FROM github_events diff --git a/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks4.sql b/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks4.sql index b3c20be7e8ba39..ce19b32b379a08 100644 --- a/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks4.sql +++ b/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks4.sql @@ -5,7 +5,7 @@ SELECT FROM ( SELECT - cast(repo:name as string), + cast(repo["name"] as string), CASE WHEN type = 'ForkEvent' THEN 1 ELSE 0 END AS fork, CASE WHEN type = 'WatchEvent' THEN 1 ELSE 0 END AS star FROM github_events diff --git a/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks5.sql b/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks5.sql index 8eabb99d93981b..f301b41be5ffc4 100644 --- a/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks5.sql +++ b/regression-test/suites/variant_p2/sql/proportionsBetweenStarsAndForks5.sql @@ -10,7 +10,7 @@ FROM FROM ( SELECT - cast(repo:name as string) as repo_name, + cast(repo["name"] as string) as repo_name, CASE WHEN type = 'ForkEvent' THEN 1 ELSE 0 END AS fork, CASE WHEN type = 'WatchEvent' THEN 1 ELSE 0 END AS star FROM github_events diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithClickhouse_related_comments1.sql b/regression-test/suites/variant_p2/sql/repositoriesWithClickhouse_related_comments1.sql index fcf685b04947b5..cfe2b5407cedd0 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithClickhouse_related_comments1.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithClickhouse_related_comments1.sql @@ -1 +1 @@ --- SELECT cast(repo:name as string), count() FROM github_events WHERE lower(cast(payload:comment.body as string)) LIKE '%apache%' GROUP BY cast(repo:name as string) ORDER BY count() DESC, cast(repo:name as string) ASC LIMIT 50 \ No newline at end of file +-- SELECT cast(repo["name"] as string), count() FROM github_events WHERE lower(cast(payload["comment"]["body"] as string)) LIKE '%apache%' GROUP BY cast(repo["name"] as string) ORDER BY count() DESC, cast(repo["name"] as string) ASC LIMIT 50 \ No newline at end of file diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithClickhouse_related_comments2.sql b/regression-test/suites/variant_p2/sql/repositoriesWithClickhouse_related_comments2.sql index 991b6367ceb80c..2a070956fe9929 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithClickhouse_related_comments2.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithClickhouse_related_comments2.sql @@ -5,11 +5,11 @@ SELECT FROM ( SELECT - cast(repo:name as string) as repo_name, + cast(repo["name"] as string) as repo_name, CASE WHEN type = 'WatchEvent' THEN 1 ELSE 0 END AS num_star, - CASE WHEN lower(cast(payload:comment.body as string)) LIKE '%apache%' THEN 1 ELSE 0 END AS num_comment + CASE WHEN lower(cast(payload["comment"]["body"] as string)) LIKE '%apache%' THEN 1 ELSE 0 END AS num_comment FROM github_events - WHERE (lower(cast(payload:comment.body as string)) LIKE '%apache%') OR (type = 'WatchEvent') + WHERE (lower(cast(payload["comment"]["body"] as string)) LIKE '%apache%') OR (type = 'WatchEvent') ) t GROUP BY repo_name HAVING num_comments > 0 diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithDoris_related_comments1.sql b/regression-test/suites/variant_p2/sql/repositoriesWithDoris_related_comments1.sql index 1e8d859913705b..413fc6afa2ffdd 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithDoris_related_comments1.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithDoris_related_comments1.sql @@ -1 +1 @@ --- SELECT cast(repo:name as string), count() FROM github_events WHERE lower(cast(payload:comment.body as string)) LIKE '%spark%' GROUP BY cast(repo:name as string) ORDER BY count() DESC, cast(repo:name as string) ASC LIMIT 50 \ No newline at end of file +-- SELECT cast(repo["name"] as string), count() FROM github_events WHERE lower(cast(payload["comment"]["body"] as string)) LIKE '%spark%' GROUP BY cast(repo["name"] as string) ORDER BY count() DESC, cast(repo["name"] as string) ASC LIMIT 50 \ No newline at end of file diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithDoris_related_comments2.sql b/regression-test/suites/variant_p2/sql/repositoriesWithDoris_related_comments2.sql index 68f16782fa6fb9..87648f83043c89 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithDoris_related_comments2.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithDoris_related_comments2.sql @@ -5,11 +5,11 @@ -- FROM -- ( -- SELECT --- cast(repo:name as string) as repo_name, +-- cast(repo["name"] as string) as repo_name, -- CASE WHEN type = 'WatchEvent' THEN 1 ELSE 0 END AS num_star, --- CASE WHEN lower(cast(payload:comment.body as string)) LIKE '%spark%' THEN 1 ELSE 0 END AS num_comment +-- CASE WHEN lower(cast(payload["comment"]["body"] as string)) LIKE '%spark%' THEN 1 ELSE 0 END AS num_comment -- FROM github_events --- WHERE (lower(cast(payload:comment.body as string)) LIKE '%spark%') OR (type = 'WatchEvent') +-- WHERE (lower(cast(payload["comment"]["body"] as string)) LIKE '%spark%') OR (type = 'WatchEvent') -- ) t -- GROUP BY repo_name -- HAVING num_comments > 0 diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithTheHighestGrowthYoY.sql b/regression-test/suites/variant_p2/sql/repositoriesWithTheHighestGrowthYoY.sql index b490a1b2c90cdc..760b7e38c379ef 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithTheHighestGrowthYoY.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithTheHighestGrowthYoY.sql @@ -6,7 +6,7 @@ SELECT FROM ( SELECT - cast(repo:name as string) as repo_name, + cast(repo["name"] as string) as repo_name, CASE year(created_at) WHEN 2022 THEN 1 ELSE 0 END AS created_at_2022, CASE year(created_at) WHEN 2015 THEN 1 ELSE 0 END AS created_at_2015, created_at as created_at diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfIssues1.sql b/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfIssues1.sql index 798bde5e95a68a..396bcf09a34a62 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfIssues1.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfIssues1.sql @@ -1 +1 @@ -SELECT cast(repo:name as string), count() AS c, count(distinct cast(actor:login as string)) AS u FROM github_events WHERE type = 'IssuesEvent' AND cast(payload:action as string) = 'opened' GROUP BY cast(repo:name as string) ORDER BY c DESC, cast(repo:name as string) LIMIT 50 +SELECT cast(repo["name"] as string), count() AS c, count(distinct cast(actor["login"] as string)) AS u FROM github_events WHERE type = 'IssuesEvent' AND cast(payload["action"] as string) = 'opened' GROUP BY cast(repo["name"] as string) ORDER BY c DESC, cast(repo["name"] as string) LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfIssues2.sql b/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfIssues2.sql index 0abfec6ca85d91..fccdcbef53dc6b 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfIssues2.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfIssues2.sql @@ -6,10 +6,10 @@ SELECT FROM ( SELECT - cast(repo:name as string) as repo_name, - CASE WHEN (type = 'IssuesEvent') AND (cast(payload:action as string) = 'opened') THEN 1 ELSE 0 END AS issue_created, + cast(repo["name"] as string) as repo_name, + CASE WHEN (type = 'IssuesEvent') AND (cast(payload["action"] as string) = 'opened') THEN 1 ELSE 0 END AS issue_created, CASE WHEN type = 'WatchEvent' THEN 1 ELSE 0 END AS star, - CASE WHEN (type = 'IssuesEvent') AND (cast(payload:action as string) = 'opened') THEN cast(actor:login as string) ELSE NULL END AS actor_login + CASE WHEN (type = 'IssuesEvent') AND (cast(payload["action"] as string) = 'opened') THEN cast(actor["login"] as string) ELSE NULL END AS actor_login FROM github_events WHERE type IN ('IssuesEvent', 'WatchEvent') ) t diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfIssues3.sql b/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfIssues3.sql index 6cc8a508c53b21..30554f05a80e93 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfIssues3.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfIssues3.sql @@ -6,10 +6,10 @@ SELECT FROM ( SELECT - cast(repo:name as string) as repo_name, - CASE WHEN (type = 'IssuesEvent') AND (cast(payload:action as string) = 'opened') THEN 1 ELSE 0 END AS issue_created, + cast(repo["name"] as string) as repo_name, + CASE WHEN (type = 'IssuesEvent') AND (cast(payload["action"] as string) = 'opened') THEN 1 ELSE 0 END AS issue_created, CASE WHEN type = 'WatchEvent' THEN 1 ELSE 0 END AS star, - CASE WHEN (type = 'IssuesEvent') AND (cast(payload:action as string) = 'opened') THEN cast(actor:login as string) ELSE NULL END AS actor_login + CASE WHEN (type = 'IssuesEvent') AND (cast(payload["action"] as string) = 'opened') THEN cast(actor["login"] as string) ELSE NULL END AS actor_login FROM github_events WHERE type IN ('IssuesEvent', 'WatchEvent') ) t diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfIssues4.sql b/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfIssues4.sql index 3f85d7db482a97..4a9c6c680d9ab5 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfIssues4.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfIssues4.sql @@ -6,10 +6,10 @@ SELECT FROM ( SELECT - cast(repo:name as string) as repo_name, - CASE WHEN (type = 'IssuesEvent') AND (cast(payload:action as string) = 'opened') THEN 1 ELSE 0 END AS issue_created, + cast(repo["name"] as string) as repo_name, + CASE WHEN (type = 'IssuesEvent') AND (cast(payload["action"] as string) = 'opened') THEN 1 ELSE 0 END AS issue_created, CASE WHEN type = 'WatchEvent' THEN 1 ELSE 0 END AS star, - CASE WHEN (type = 'IssuesEvent') AND (cast(payload:action as string) = 'opened') THEN cast(actor:login as string) ELSE NULL END AS actor_login + CASE WHEN (type = 'IssuesEvent') AND (cast(payload["action"] as string) = 'opened') THEN cast(actor["login"] as string) ELSE NULL END AS actor_login FROM github_events WHERE type IN ('IssuesEvent', 'WatchEvent') ) t diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfPullRequests1.sql b/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfPullRequests1.sql index 233048b6a43e4b..993edff702ebc9 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfPullRequests1.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfPullRequests1.sql @@ -1 +1 @@ -SELECT cast(repo:name as string) as repo_name, count(), count(distinct cast(actor:login as string)) FROM github_events WHERE type = 'PullRequestEvent' AND cast(payload:action as string) = 'opened' GROUP BY cast(repo:name as string) ORDER BY 2,1,3 DESC LIMIT 50 \ No newline at end of file +SELECT cast(repo["name"] as string) as repo_name, count(), count(distinct cast(actor["login"] as string)) FROM github_events WHERE type = 'PullRequestEvent' AND cast(payload["action"] as string) = 'opened' GROUP BY cast(repo["name"] as string) ORDER BY 2,1,3 DESC LIMIT 50 \ No newline at end of file diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfPullRequests2.sql b/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfPullRequests2.sql index 7ec747419196ad..630d2d4d4521f7 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfPullRequests2.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumAmountOfPullRequests2.sql @@ -1 +1 @@ -SELECT cast(repo:name as string), count(), count(distinct cast(actor:login as string)) AS u FROM github_events WHERE type = 'PullRequestEvent' AND cast(payload:action as string) = 'opened' GROUP BY cast(repo:name as string) ORDER BY u DESC, 2 DESC, 1 LIMIT 50 +SELECT cast(repo["name"] as string), count(), count(distinct cast(actor["login"] as string)) AS u FROM github_events WHERE type = 'PullRequestEvent' AND cast(payload["action"] as string) = 'opened' GROUP BY cast(repo["name"] as string) ORDER BY u DESC, 2 DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumNumberOfAcceptedInvitations.sql b/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumNumberOfAcceptedInvitations.sql index 1a899f6a83f6ff..e7b536eccdd368 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumNumberOfAcceptedInvitations.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithTheMaximumNumberOfAcceptedInvitations.sql @@ -5,7 +5,7 @@ SELECT FROM ( SELECT - cast(repo:name as string) as repo_name, + cast(repo["name"] as string) as repo_name, CASE WHEN type = 'MemberEvent' THEN 1 ELSE 0 END AS invitation, CASE WHEN type = 'WatchEvent' THEN 1 ELSE 0 END AS star FROM github_events diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithTheMostPeopleWhoHavePushAccess1.sql b/regression-test/suites/variant_p2/sql/repositoriesWithTheMostPeopleWhoHavePushAccess1.sql index 6419fff814498f..9c1bb550a4f7a5 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithTheMostPeopleWhoHavePushAccess1.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithTheMostPeopleWhoHavePushAccess1.sql @@ -5,9 +5,9 @@ SELECT FROM ( SELECT - lower(cast(repo:name as string)) as repo_name, - CASE WHEN type = 'PushEvent' THEN cast(actor:login as string) ELSE NULL END AS actor_login, + lower(cast(repo["name"] as string)) as repo_name, + CASE WHEN type = 'PushEvent' THEN cast(actor["login"] as string) ELSE NULL END AS actor_login, CASE WHEN type = 'WatchEvent' THEN 1 ELSE 0 END AS star - FROM github_events WHERE type IN ('PushEvent', 'WatchEvent') AND cast(repo:name as string) != '/' + FROM github_events WHERE type IN ('PushEvent', 'WatchEvent') AND cast(repo["name"] as string) != '/' ) t GROUP BY repo_name ORDER BY u, stars, repo_name DESC LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithTheMostPeopleWhoHavePushAccess2.sql b/regression-test/suites/variant_p2/sql/repositoriesWithTheMostPeopleWhoHavePushAccess2.sql index b79bb47a711619..5785ea739c2938 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithTheMostPeopleWhoHavePushAccess2.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithTheMostPeopleWhoHavePushAccess2.sql @@ -5,9 +5,9 @@ SELECT FROM ( SELECT - cast(repo:name as string) as repo_name, - CASE WHEN type = 'PushEvent' AND (cast(payload:ref as string) LIKE '%/master' OR cast(payload:ref as string) LIKE '%/main') THEN cast(actor:login as string) ELSE NULL END AS actor_login, + cast(repo["name"] as string) as repo_name, + CASE WHEN type = 'PushEvent' AND (cast(payload["ref"] as string) LIKE '%/master' OR cast(payload["ref"] as string) LIKE '%/main') THEN cast(actor["login"] as string) ELSE NULL END AS actor_login, CASE WHEN type = 'WatchEvent' THEN 1 ELSE 0 END AS star - FROM github_events WHERE type IN ('PushEvent', 'WatchEvent') AND cast(repo:name as string) != '/' + FROM github_events WHERE type IN ('PushEvent', 'WatchEvent') AND cast(repo["name"] as string) != '/' ) t GROUP BY repo_name ORDER BY u, repo_name DESC LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithTheMostPeopleWhoHavePushAccess3.sql b/regression-test/suites/variant_p2/sql/repositoriesWithTheMostPeopleWhoHavePushAccess3.sql index 3a4747488ff895..4b2b5ef61ecf8f 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithTheMostPeopleWhoHavePushAccess3.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithTheMostPeopleWhoHavePushAccess3.sql @@ -5,10 +5,10 @@ SELECT FROM ( SELECT - cast(repo:name as string) as repo_name, - CASE WHEN type = 'PushEvent' AND (cast(payload:ref as string) LIKE '%/master' OR cast(payload:ref as string) LIKE '%/main') THEN cast(actor:login as string) ELSE NULL END AS actor_login, + cast(repo["name"] as string) as repo_name, + CASE WHEN type = 'PushEvent' AND (cast(payload["ref"] as string) LIKE '%/master' OR cast(payload["ref"] as string) LIKE '%/main') THEN cast(actor["login"] as string) ELSE NULL END AS actor_login, CASE WHEN type = 'WatchEvent' THEN 1 ELSE 0 END AS star - FROM github_events WHERE type IN ('PushEvent', 'WatchEvent') AND cast(repo:name as string) != '/' + FROM github_events WHERE type IN ('PushEvent', 'WatchEvent') AND cast(repo["name"] as string) != '/' ) t GROUP BY repo_name HAVING stars >= 100 diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithTheMostStarsOverOneDay1.sql b/regression-test/suites/variant_p2/sql/repositoriesWithTheMostStarsOverOneDay1.sql index 07f434c0ddc239..b04f41abd5fe18 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithTheMostStarsOverOneDay1.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithTheMostStarsOverOneDay1.sql @@ -10,11 +10,11 @@ FROM FROM ( SELECT - cast(repo:name as string) as repo_name, + cast(repo["name"] as string) as repo_name, count() AS stars FROM github_events WHERE type = 'WatchEvent' - GROUP BY cast(repo:name as string) + GROUP BY cast(repo["name"] as string) ) t1 ) t2 WHERE rank = 1 diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithTheMostStarsOverOneDay2.sql b/regression-test/suites/variant_p2/sql/repositoriesWithTheMostStarsOverOneDay2.sql index 71c7aaa529d79d..3c8519ccddc48d 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithTheMostStarsOverOneDay2.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithTheMostStarsOverOneDay2.sql @@ -10,11 +10,11 @@ FROM FROM ( SELECT - cast(repo:name as string) as repo_name, + cast(repo["name"] as string) as repo_name, count() AS stars FROM github_events WHERE type = 'WatchEvent' - GROUP BY cast(repo:name as string) + GROUP BY cast(repo["name"] as string) ) t1 ) t2 WHERE rank = 1 diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithTheMostStarsOverOneDay3.sql b/regression-test/suites/variant_p2/sql/repositoriesWithTheMostStarsOverOneDay3.sql index 9a95075695632a..c72d93e1810084 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithTheMostStarsOverOneDay3.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithTheMostStarsOverOneDay3.sql @@ -1 +1 @@ -SELECT cast(repo:name as string) as repo_name, count() AS stars FROM github_events WHERE type = 'WatchEvent' GROUP BY cast(repo:name as string) ORDER BY stars DESC, repo_name LIMIT 50 +SELECT cast(repo["name"] as string) as repo_name, count() AS stars FROM github_events WHERE type = 'WatchEvent' GROUP BY cast(repo["name"] as string) ORDER BY stars DESC, repo_name LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithTheMostSteadyGrowthOverTime.sql b/regression-test/suites/variant_p2/sql/repositoriesWithTheMostSteadyGrowthOverTime.sql index 13cb308f6491b3..4015a30823728b 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithTheMostSteadyGrowthOverTime.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithTheMostSteadyGrowthOverTime.sql @@ -6,7 +6,7 @@ SELECT FROM ( SELECT - cast(repo:name as string) as repo_name, + cast(repo["name"] as string) as repo_name, count() AS stars FROM github_events WHERE type = 'WatchEvent' diff --git a/regression-test/suites/variant_p2/sql/repositoriesWithTheWorstStagnation_order.sql b/regression-test/suites/variant_p2/sql/repositoriesWithTheWorstStagnation_order.sql index 1c140c45577856..cd8d3e200d75f3 100644 --- a/regression-test/suites/variant_p2/sql/repositoriesWithTheWorstStagnation_order.sql +++ b/regression-test/suites/variant_p2/sql/repositoriesWithTheWorstStagnation_order.sql @@ -6,7 +6,7 @@ SELECT FROM ( SELECT - cast(repo:name as string) as repo_name, + cast(repo["name"] as string) as repo_name, CASE year(created_at) WHEN 2022 THEN 1 ELSE 0 END AS created_at_2022, CASE year(created_at) WHEN 2015 THEN 1 ELSE 0 END AS created_at_2015, created_at as created_at diff --git a/regression-test/suites/variant_p2/sql/repositoryAffinityList2.sql b/regression-test/suites/variant_p2/sql/repositoryAffinityList2.sql index 3f0183145fec6c..bdb84f572d47e3 100644 --- a/regression-test/suites/variant_p2/sql/repositoryAffinityList2.sql +++ b/regression-test/suites/variant_p2/sql/repositoryAffinityList2.sql @@ -5,19 +5,19 @@ SELECT FROM ( SELECT - cast(repo:name as string) as repo_name, - count(distinct cast(actor:login as string)) AS total_stars + cast(repo["name"] as string) as repo_name, + count(distinct cast(actor["login"] as string)) AS total_stars FROM github_events - WHERE (type = 'WatchEvent') AND (cast(repo:name as string) NOT IN ('apache/spark')) + WHERE (type = 'WatchEvent') AND (cast(repo["name"] as string) NOT IN ('apache/spark')) GROUP BY repo_name HAVING total_stars >= 10 ) t1 JOIN ( SELECT - count(distinct cast(actor:login as string)) AS spark_stars + count(distinct cast(actor["login"] as string)) AS spark_stars FROM github_events - WHERE (type = 'WatchEvent') AND (cast(repo:name as string) IN ('apache/spark')) + WHERE (type = 'WatchEvent') AND (cast(repo["name"] as string) IN ('apache/spark')) ) t2 ORDER BY ratio DESC, repo_name LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/sql01.sql b/regression-test/suites/variant_p2/sql/sql01.sql index a9245641faacd8..06c2415b73b52a 100644 --- a/regression-test/suites/variant_p2/sql/sql01.sql +++ b/regression-test/suites/variant_p2/sql/sql01.sql @@ -1 +1 @@ -SELECT payload:commits FROM github_events where cast(payload:push_id as int) = 536740433; +SELECT payload["commits"] FROM github_events where cast(payload["push_id"] as int) = 536740433; diff --git a/regression-test/suites/variant_p2/sql/sql02.sql b/regression-test/suites/variant_p2/sql/sql02.sql index 5265fa7d8098e3..f89f17b1ecc3e6 100644 --- a/regression-test/suites/variant_p2/sql/sql02.sql +++ b/regression-test/suites/variant_p2/sql/sql02.sql @@ -1 +1 @@ -SELECT count(cast(payload:commits as string)) FROM github_events; \ No newline at end of file +SELECT count(cast(payload["commits"] as string)) FROM github_events; \ No newline at end of file diff --git a/regression-test/suites/variant_p2/sql/sql03.sql b/regression-test/suites/variant_p2/sql/sql03.sql index a69cd107d0cd67..43c07c07f137d8 100644 --- a/regression-test/suites/variant_p2/sql/sql03.sql +++ b/regression-test/suites/variant_p2/sql/sql03.sql @@ -1 +1 @@ -SELECT count(cast(payload:commits as string)) FROM github_events WHERE cast(payload:push_id as int) > 100; +SELECT count(cast(payload["commits"] as string)) FROM github_events WHERE cast(payload["push_id"] as int) > 100; diff --git a/regression-test/suites/variant_p2/sql/sql04.sql b/regression-test/suites/variant_p2/sql/sql04.sql index c87c9b0397c4da..e76828c39eb3ba 100644 --- a/regression-test/suites/variant_p2/sql/sql04.sql +++ b/regression-test/suites/variant_p2/sql/sql04.sql @@ -1 +1 @@ --- SELECT repo:id, payload:issue FROM github_events WHERE cast(payload:issue.state as string) = "open" order by cast(repo:id as int), id limit 10; +-- SELECT repo["id"], payload["issue"] FROM github_events WHERE cast(payload["issue"]["state"] as string) = "open" order by cast(repo["id"] as int), id limit 10; diff --git a/regression-test/suites/variant_p2/sql/sql05.sql b/regression-test/suites/variant_p2/sql/sql05.sql index c10f5c5940d9eb..fe0a9fba0c6060 100644 --- a/regression-test/suites/variant_p2/sql/sql05.sql +++ b/regression-test/suites/variant_p2/sql/sql05.sql @@ -1 +1 @@ --- SELECT count(cast(payload:issue as string)) FROM github_events; \ No newline at end of file +-- SELECT count(cast(payload["issue"] as string)) FROM github_events; \ No newline at end of file diff --git a/regression-test/suites/variant_p2/sql/sql06.sql b/regression-test/suites/variant_p2/sql/sql06.sql index cc955401285585..c6772b4c0de351 100644 --- a/regression-test/suites/variant_p2/sql/sql06.sql +++ b/regression-test/suites/variant_p2/sql/sql06.sql @@ -1 +1 @@ -SELECT count(cast(payload:issue as string)) FROM github_events where cast(payload:issue.state as string) = "closed"; \ No newline at end of file +SELECT count(cast(payload["issue"] as string)) FROM github_events where cast(payload["issue"]["state"] as string) = "closed"; \ No newline at end of file diff --git a/regression-test/suites/variant_p2/sql/sql07.sql b/regression-test/suites/variant_p2/sql/sql07.sql index c1e8b158676f96..19e8e88d3d3b78 100644 --- a/regression-test/suites/variant_p2/sql/sql07.sql +++ b/regression-test/suites/variant_p2/sql/sql07.sql @@ -1,2 +1,2 @@ set enable_two_phase_read_opt = false; -SELECT payload:commits FROM github_events order by id limit 10; \ No newline at end of file +SELECT payload["commits"] FROM github_events order by id limit 10; \ No newline at end of file diff --git a/regression-test/suites/variant_p2/sql/sql08.sql b/regression-test/suites/variant_p2/sql/sql08.sql index 37e47fb5af9443..cfd3030b9e9b80 100644 --- a/regression-test/suites/variant_p2/sql/sql08.sql +++ b/regression-test/suites/variant_p2/sql/sql08.sql @@ -1 +1 @@ -SELECT payload:issue.user FROM github_events WHERE cast(payload:issue.state as string) = "open" and cast(payload:issue.locked as int) = 0 order by cast(repo:id as int), id limit 10; +SELECT payload["issue"].user FROM github_events WHERE cast(payload["issue"]["state"] as string) = "open" and cast(payload["issue"].locked as int) = 0 order by cast(repo["id"] as int), id limit 10; diff --git a/regression-test/suites/variant_p2/sql/theLongestRepositoryNames1.sql b/regression-test/suites/variant_p2/sql/theLongestRepositoryNames1.sql index 0b99aac3437b42..9decf3c4a02b10 100644 --- a/regression-test/suites/variant_p2/sql/theLongestRepositoryNames1.sql +++ b/regression-test/suites/variant_p2/sql/theLongestRepositoryNames1.sql @@ -1 +1 @@ -SELECT count(), cast(repo:name as string) FROM github_events WHERE type = 'WatchEvent' GROUP BY cast(repo:name as string) ORDER BY length(cast(repo:name as string)) DESC, cast(repo:name as string) LIMIT 50 +SELECT count(), cast(repo["name"] as string) FROM github_events WHERE type = 'WatchEvent' GROUP BY cast(repo["name"] as string) ORDER BY length(cast(repo["name"] as string)) DESC, cast(repo["name"] as string) LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/theLongestRepositoryNames2.sql b/regression-test/suites/variant_p2/sql/theLongestRepositoryNames2.sql index 89c9a62955e30b..3155fc449c082e 100644 --- a/regression-test/suites/variant_p2/sql/theLongestRepositoryNames2.sql +++ b/regression-test/suites/variant_p2/sql/theLongestRepositoryNames2.sql @@ -1 +1 @@ -SELECT cast(repo:name as string), count() FROM github_events WHERE type = 'WatchEvent' AND cast(repo:name as string) LIKE '%_/_%' GROUP BY cast(repo:name as string) ORDER BY length(cast(repo:name as string)) ASC, cast(repo:name as string) LIMIT 50 +SELECT cast(repo["name"] as string), count() FROM github_events WHERE type = 'WatchEvent' AND cast(repo["name"] as string) LIKE '%_/_%' GROUP BY cast(repo["name"] as string) ORDER BY length(cast(repo["name"] as string)) ASC, cast(repo["name"] as string) LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/theMostToughCodeReviews.sql b/regression-test/suites/variant_p2/sql/theMostToughCodeReviews.sql index d7449fe8a4c3d3..a3dac2939dee27 100644 --- a/regression-test/suites/variant_p2/sql/theMostToughCodeReviews.sql +++ b/regression-test/suites/variant_p2/sql/theMostToughCodeReviews.sql @@ -1,10 +1,10 @@ SELECT - concat('https://github.com/', cast(repo:name as string), '/pull/') AS URL, - count(distinct cast(actor:login as string)) AS authors + concat('https://github.com/', cast(repo["name"] as string), '/pull/') AS URL, + count(distinct cast(actor["login"] as string)) AS authors FROM github_events -WHERE (type = 'PullRequestReviewCommentEvent') AND (cast(payload:action as string) = 'created') +WHERE (type = 'PullRequestReviewCommentEvent') AND (cast(payload["action"] as string) = 'created') GROUP BY - cast(repo:name as string), - cast(payload:issue.`number` as string) + cast(repo["name"] as string), + cast(payload["issue"]["number"] as string) ORDER BY authors DESC, URL ASC LIMIT 50 \ No newline at end of file diff --git a/regression-test/suites/variant_p2/sql/theTotalNumberOfRepositoriesOnGithub.sql b/regression-test/suites/variant_p2/sql/theTotalNumberOfRepositoriesOnGithub.sql index a67c50432f9e41..a2f6282b318813 100644 --- a/regression-test/suites/variant_p2/sql/theTotalNumberOfRepositoriesOnGithub.sql +++ b/regression-test/suites/variant_p2/sql/theTotalNumberOfRepositoriesOnGithub.sql @@ -1 +1 @@ -SELECT count(distinct cast(repo:name as string)) FROM github_events +SELECT count(distinct cast(repo["name"] as string)) FROM github_events diff --git a/regression-test/suites/variant_p2/sql/theTotalNumberOfUsersOnGithub1.sql b/regression-test/suites/variant_p2/sql/theTotalNumberOfUsersOnGithub1.sql index 74135944c32b32..5fdc4de6b14a14 100644 --- a/regression-test/suites/variant_p2/sql/theTotalNumberOfUsersOnGithub1.sql +++ b/regression-test/suites/variant_p2/sql/theTotalNumberOfUsersOnGithub1.sql @@ -1 +1 @@ -SELECT count(distinct cast(actor:login as string)) FROM github_events +SELECT count(distinct cast(actor["login"] as string)) FROM github_events diff --git a/regression-test/suites/variant_p2/sql/theTotalNumberOfUsersOnGithub2.sql b/regression-test/suites/variant_p2/sql/theTotalNumberOfUsersOnGithub2.sql index b02fd0d60f0a23..12d482ce704c00 100644 --- a/regression-test/suites/variant_p2/sql/theTotalNumberOfUsersOnGithub2.sql +++ b/regression-test/suites/variant_p2/sql/theTotalNumberOfUsersOnGithub2.sql @@ -1 +1 @@ -SELECT count(distinct cast(actor:login as string)) FROM github_events WHERE type = 'WatchEvent' +SELECT count(distinct cast(actor["login"] as string)) FROM github_events WHERE type = 'WatchEvent' diff --git a/regression-test/suites/variant_p2/sql/theTotalNumberOfUsersOnGithub3.sql b/regression-test/suites/variant_p2/sql/theTotalNumberOfUsersOnGithub3.sql index 58745489785eb3..f23dab9edb9d0a 100644 --- a/regression-test/suites/variant_p2/sql/theTotalNumberOfUsersOnGithub3.sql +++ b/regression-test/suites/variant_p2/sql/theTotalNumberOfUsersOnGithub3.sql @@ -1 +1 @@ -SELECT count(distinct cast(actor:login as string)) FROM github_events WHERE type = 'PushEvent' +SELECT count(distinct cast(actor["login"] as string)) FROM github_events WHERE type = 'PushEvent' diff --git a/regression-test/suites/variant_p2/sql/theTotalNumberOfUsersOnGithub4.sql b/regression-test/suites/variant_p2/sql/theTotalNumberOfUsersOnGithub4.sql index cc870d53aa65d5..ffd324c11d441b 100644 --- a/regression-test/suites/variant_p2/sql/theTotalNumberOfUsersOnGithub4.sql +++ b/regression-test/suites/variant_p2/sql/theTotalNumberOfUsersOnGithub4.sql @@ -1 +1 @@ -SELECT count(distinct cast(actor:login as string)) FROM github_events WHERE type = 'PullRequestEvent' AND cast(payload:action as string) = 'opened' +SELECT count(distinct cast(actor["login"] as string)) FROM github_events WHERE type = 'PullRequestEvent' AND cast(payload["action"] as string) = 'opened' diff --git a/regression-test/suites/variant_p2/sql/topLabels1.sql b/regression-test/suites/variant_p2/sql/topLabels1.sql index c45c3a90f8be61..3a0bbcafd187d0 100644 --- a/regression-test/suites/variant_p2/sql/topLabels1.sql +++ b/regression-test/suites/variant_p2/sql/topLabels1.sql @@ -4,7 +4,7 @@ -- count() AS c -- FROM github_events -- LATERAL VIEW explode_split(cast(payload:labels as string), ',') t AS label --- WHERE (type IN ('IssuesEvent', 'PullRequestEvent', 'IssueCommentEvent')) AND (cast(payload:action as string) IN ('created', 'opened', 'labeled')) +-- WHERE (type IN ('IssuesEvent', 'PullRequestEvent', 'IssueCommentEvent')) AND (cast(payload["action"] as string) IN ('created', 'opened', 'labeled')) -- GROUP BY label, id -- ORDER BY c, id DESC -- LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/topLabels2.sql b/regression-test/suites/variant_p2/sql/topLabels2.sql index 99941f28984a2f..83c8a60c3bc2f8 100644 --- a/regression-test/suites/variant_p2/sql/topLabels2.sql +++ b/regression-test/suites/variant_p2/sql/topLabels2.sql @@ -3,7 +3,7 @@ -- count() AS c -- FROM github_events -- LATERAL VIEW explode_split(cast(payload:labels as string), ',') t AS label --- WHERE (type IN ('IssuesEvent', 'PullRequestEvent', 'IssueCommentEvent')) AND (cast(payload:action as string) IN ('created', 'opened', 'labeled')) AND ((lower(label) LIKE '%bug%') OR (lower(label) LIKE '%feature%')) +-- WHERE (type IN ('IssuesEvent', 'PullRequestEvent', 'IssueCommentEvent')) AND (cast(payload["action"] as string) IN ('created', 'opened', 'labeled')) AND ((lower(label) LIKE '%bug%') OR (lower(label) LIKE '%feature%')) -- GROUP BY label -- ORDER BY c DESC -- LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/topLabels3.sql b/regression-test/suites/variant_p2/sql/topLabels3.sql index 205202e8026415..da36324118f9d7 100644 --- a/regression-test/suites/variant_p2/sql/topLabels3.sql +++ b/regression-test/suites/variant_p2/sql/topLabels3.sql @@ -9,6 +9,6 @@ -- CASE WHEN lower(cast(payload:labels as string)) LIKE '%feature%' THEN 1 ELSE 0 END AS feature -- FROM github_events -- LATERAL VIEW explode_split(cast(payload:labels as string), ',') t AS label --- WHERE (type IN ('IssuesEvent', 'PullRequestEvent', 'IssueCommentEvent')) AND (cast(payload:action as string) IN ('created', 'opened', 'labeled')) AND ((lower(label) LIKE '%bug%') OR (lower(label) LIKE '%feature%')) +-- WHERE (type IN ('IssuesEvent', 'PullRequestEvent', 'IssueCommentEvent')) AND (cast(payload["action"] as string) IN ('created', 'opened', 'labeled')) AND ((lower(label) LIKE '%bug%') OR (lower(label) LIKE '%feature%')) -- ) t -- LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/topRepositoriesByStars.sql b/regression-test/suites/variant_p2/sql/topRepositoriesByStars.sql index 36a87fa709caac..61d5f95d21eb4e 100644 --- a/regression-test/suites/variant_p2/sql/topRepositoriesByStars.sql +++ b/regression-test/suites/variant_p2/sql/topRepositoriesByStars.sql @@ -1 +1 @@ -SELECT cast(repo:name as string), count() AS stars FROM github_events WHERE type = 'WatchEvent' GROUP BY cast(repo:name as string) ORDER BY stars DESC, 1 LIMIT 50 +SELECT cast(repo["name"] as string), count() AS stars FROM github_events WHERE type = 'WatchEvent' GROUP BY cast(repo["name"] as string) ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/whoAreAllThosePeopleGivingStars1.sql b/regression-test/suites/variant_p2/sql/whoAreAllThosePeopleGivingStars1.sql index cb163ad2ccdf65..68498abe73b4c8 100644 --- a/regression-test/suites/variant_p2/sql/whoAreAllThosePeopleGivingStars1.sql +++ b/regression-test/suites/variant_p2/sql/whoAreAllThosePeopleGivingStars1.sql @@ -1 +1 @@ -SELECT cast(actor:login as string), count() AS stars FROM github_events WHERE type = 'WatchEvent' GROUP BY cast(actor:login as string) ORDER BY stars DESC, 1 LIMIT 50 +SELECT cast(actor["login"] as string), count() AS stars FROM github_events WHERE type = 'WatchEvent' GROUP BY cast(actor["login"] as string) ORDER BY stars DESC, 1 LIMIT 50 diff --git a/regression-test/suites/variant_p2/sql/whoAreAllThosePeopleGivingStars2.sql b/regression-test/suites/variant_p2/sql/whoAreAllThosePeopleGivingStars2.sql index a46da4812e813d..cbc896088f23ee 100644 --- a/regression-test/suites/variant_p2/sql/whoAreAllThosePeopleGivingStars2.sql +++ b/regression-test/suites/variant_p2/sql/whoAreAllThosePeopleGivingStars2.sql @@ -1 +1 @@ -SELECT cast(actor:login as string), count() AS stars FROM github_events WHERE type = 'WatchEvent' AND cast(actor:login as string) = 'cliffordfajardo' GROUP BY cast(actor:login as string) ORDER BY stars DESC LIMIT 50 +SELECT cast(actor["login"] as string), count() AS stars FROM github_events WHERE type = 'WatchEvent' AND cast(actor["login"] as string) = 'cliffordfajardo' GROUP BY cast(actor["login"] as string) ORDER BY stars DESC LIMIT 50 diff --git a/regression-test/suites/variant_p2/unresovled_sql/affinityByIssuesAndPRs1.sql b/regression-test/suites/variant_p2/unresovled_sql/affinityByIssuesAndPRs1.sql index 3a2009a53bdc14..e914aefc2e14a1 100644 --- a/regression-test/suites/variant_p2/unresovled_sql/affinityByIssuesAndPRs1.sql +++ b/regression-test/suites/variant_p2/unresovled_sql/affinityByIssuesAndPRs1.sql @@ -1,16 +1,16 @@ -- ERROR: unmatched column -- SELECT --- cast(repo:name as string), +-- cast(repo["name"] as string), -- count() AS prs, --- count(distinct cast(actor:login as string)) AS authors +-- count(distinct cast(actor["login"] as string)) AS authors -- FROM github_events --- WHERE (type = 'PullRequestEvent') AND (cast(payload:action as string) = 'opened') AND (cast(actor:login as string) IN +-- WHERE (type = 'PullRequestEvent') AND (cast(payload["action"] as string) = 'opened') AND (cast(actor["login"] as string) IN -- ( --- SELECT cast(actor:login as string) +-- SELECT cast(actor["login"] as string) -- FROM github_events --- WHERE (type = 'PullRequestEvent') AND (cast(payload:action as string)= 'opened') AND (cast(repo:name as string) IN ('rspec/rspec-core', 'golden-warning/giraffedraft-server', 'apache/spark')) --- )) AND (lower(cast(repo:name as string)) NOT LIKE '%clickhouse%') --- GROUP BY cast(repo:name as string) --- ORDER BY authors DESC, prs DESC, length(cast(repo:name as string)) DESC +-- WHERE (type = 'PullRequestEvent') AND (cast(payload["action"] as string)= 'opened') AND (cast(repo["name"] as string) IN ('rspec/rspec-core', 'golden-warning/giraffedraft-server', 'apache/spark')) +-- )) AND (lower(cast(repo["name"] as string)) NOT LIKE '%clickhouse%') +-- GROUP BY cast(repo["name"] as string) +-- ORDER BY authors DESC, prs DESC, length(cast(repo["name"] as string)) DESC -- LIMIT 50 -- \ No newline at end of file diff --git a/regression-test/suites/variant_p2/unresovled_sql/affinityByIssuesAndPRs2.sql b/regression-test/suites/variant_p2/unresovled_sql/affinityByIssuesAndPRs2.sql index 5d2f27531394e6..d620b238cc3ff0 100644 --- a/regression-test/suites/variant_p2/unresovled_sql/affinityByIssuesAndPRs2.sql +++ b/regression-test/suites/variant_p2/unresovled_sql/affinityByIssuesAndPRs2.sql @@ -1,15 +1,15 @@ -- ERROR: unmatched column -- SELECT --- cast(repo:name as string), +-- cast(repo["name"] as string), -- count() AS prs, --- count(distinct cast(actor:login as string)) AS authors +-- count(distinct cast(actor["login"] as string)) AS authors -- FROM github_events --- WHERE (type = 'IssuesEvent') AND (cast(payload:action as string) = 'opened') AND (cast(actor:login as string) IN +-- WHERE (type = 'IssuesEvent') AND (cast(payload["action"] as string) = 'opened') AND (cast(actor["login"] as string) IN -- ( --- SELECT cast(actor:login as string) +-- SELECT cast(actor["login"] as string) -- FROM github_events --- WHERE (type = 'IssuesEvent') AND (cast(payload:action as string) = 'opened') AND (cast(repo:name as string) IN ('No-CQRT/GooGuns', 'ivolunteerph/ivolunteerph', 'Tribler/tribler')) --- )) AND (lower(cast(repo:name as string)) NOT LIKE '%clickhouse%') --- GROUP BY cast(repo:name as string) --- ORDER BY authors DESC, prs DESC, cast(repo:name as string) ASC +-- WHERE (type = 'IssuesEvent') AND (cast(payload["action"] as string) = 'opened') AND (cast(repo["name"] as string) IN ('No-CQRT/GooGuns', 'ivolunteerph/ivolunteerph', 'Tribler/tribler')) +-- )) AND (lower(cast(repo["name"] as string)) NOT LIKE '%clickhouse%') +-- GROUP BY cast(repo["name"] as string) +-- ORDER BY authors DESC, prs DESC, cast(repo["name"] as string) ASC -- LIMIT 50 diff --git a/regression-test/suites/variant_p2/unresovled_sql/repositoriesByAmountOfModifiedCode.sql b/regression-test/suites/variant_p2/unresovled_sql/repositoriesByAmountOfModifiedCode.sql index f232a6f0328be3..fd2b80845648ee 100644 --- a/regression-test/suites/variant_p2/unresovled_sql/repositoriesByAmountOfModifiedCode.sql +++ b/regression-test/suites/variant_p2/unresovled_sql/repositoriesByAmountOfModifiedCode.sql @@ -1,12 +1,12 @@ -- ERROR missmatched result -- SELECT --- cast(repo:name as string) as repo_name, +-- cast(repo["name"] as string) as repo_name, -- count() AS prs, --- count(distinct cast(actor:login as string)) AS authors, +-- count(distinct cast(actor["login"] as string)) AS authors, -- sum(cast(payload:pull_request.additions as int)) AS adds, -- sum(cast(v:payload.pull_request.deletions as int)) AS dels -- FROM github_events --- WHERE (type = 'PullRequestEvent') AND (cast(payload:action as string) = 'opened') AND (cast(payload:pull_request.additions as int) < 10000) AND (cast(v:payload.pull_request.deletions as int) < 10000) +-- WHERE (type = 'PullRequestEvent') AND (cast(payload["action"] as string) = 'opened') AND (cast(payload:pull_request.additions as int) < 10000) AND (cast(v:payload.pull_request.deletions as int) < 10000) -- GROUP BY repo_name -- HAVING (adds / dels) < 10 -- ORDER BY adds + dels DESC, 1 diff --git a/regression-test/suites/variant_p2/unresovled_sql/repositoriesByTheNumberOfPushes.sql b/regression-test/suites/variant_p2/unresovled_sql/repositoriesByTheNumberOfPushes.sql index b5c9ac1fb21d7a..51dd0b3d9f141d 100644 --- a/regression-test/suites/variant_p2/unresovled_sql/repositoriesByTheNumberOfPushes.sql +++ b/regression-test/suites/variant_p2/unresovled_sql/repositoriesByTheNumberOfPushes.sql @@ -1,18 +1,18 @@ --ERROR: crash column.h:496] not support -- SELECT --- cast(repo:name as string), +-- cast(repo["name"] as string), -- count() AS pushes, --- count(distinct cast(actor:login as string)) AS authors +-- count(distinct cast(actor["login"] as string)) AS authors -- FROM github_events --- WHERE (type = 'PushEvent') AND (cast(repo:name as string) IN +-- WHERE (type = 'PushEvent') AND (cast(repo["name"] as string) IN -- ( --- SELECT cast(repo:name as string) +-- SELECT cast(repo["name"] as string) -- FROM github_events -- WHERE type = 'WatchEvent' --- GROUP BY cast(repo:name as string) +-- GROUP BY cast(repo["name"] as string) -- ORDER BY count() DESC -- LIMIT 10000 -- )) --- GROUP BY cast(repo:name as string) +-- GROUP BY cast(repo["name"] as string) -- ORDER BY count() DESC -- LIMIT 50 diff --git a/regression-test/suites/variant_p2/unresovled_sql/repositoryAffinityList1.sql b/regression-test/suites/variant_p2/unresovled_sql/repositoryAffinityList1.sql index 149e31e0318f5f..cd42a33efe0ac0 100644 --- a/regression-test/suites/variant_p2/unresovled_sql/repositoryAffinityList1.sql +++ b/regression-test/suites/variant_p2/unresovled_sql/repositoryAffinityList1.sql @@ -1,14 +1,14 @@ -- ERROR: unmatched column -- SELECT --- cast(repo:name as string) as repo_name, +-- cast(repo["name"] as string) as repo_name, -- count() AS stars -- FROM github_events --- WHERE (type = 'WatchEvent') AND (cast(actor:login as string) IN +-- WHERE (type = 'WatchEvent') AND (cast(actor["login"] as string) IN -- ( --- SELECT cast(actor:login as string) +-- SELECT cast(actor["login"] as string) -- FROM github_events --- WHERE (type = 'WatchEvent') AND (cast(repo:name as string) IN ('apache/spark', 'prakhar1989/awesome-courses')) --- )) AND (cast(repo:name as string) NOT IN ('ClickHouse/ClickHouse', 'yandex/ClickHouse')) +-- WHERE (type = 'WatchEvent') AND (cast(repo["name"] as string) IN ('apache/spark', 'prakhar1989/awesome-courses')) +-- )) AND (cast(repo["name"] as string) NOT IN ('ClickHouse/ClickHouse', 'yandex/ClickHouse')) -- GROUP BY repo_name -- ORDER BY stars DESC, repo_name -- LIMIT 50 diff --git a/regression-test/suites/variant_p2/unresovled_sql/starsFromHeavyGithubUsers1.sql b/regression-test/suites/variant_p2/unresovled_sql/starsFromHeavyGithubUsers1.sql index 0c5f159a8b98bf..097297f5c21a22 100644 --- a/regression-test/suites/variant_p2/unresovled_sql/starsFromHeavyGithubUsers1.sql +++ b/regression-test/suites/variant_p2/unresovled_sql/starsFromHeavyGithubUsers1.sql @@ -1,14 +1,14 @@ -- ERROR: unmatched column -- SELECT --- cast(repo:name as string), +-- cast(repo["name"] as string), -- count() -- FROM github_events --- WHERE (type = 'WatchEvent') AND (cast(actor:login as string) IN +-- WHERE (type = 'WatchEvent') AND (cast(actor["login"] as string) IN -- ( --- SELECT cast(actor:login as string) +-- SELECT cast(actor["login"] as string) -- FROM github_events --- WHERE (type = 'PullRequestEvent') AND (cast(payload:action as string) = 'opened') +-- WHERE (type = 'PullRequestEvent') AND (cast(payload["action"] as string) = 'opened') -- )) --- GROUP BY cast(repo:name as string) +-- GROUP BY cast(repo["name"] as string) -- ORDER BY count() DESC -- LIMIT 50 diff --git a/regression-test/suites/variant_p2/unresovled_sql/starsFromHeavyGithubUsers2.sql b/regression-test/suites/variant_p2/unresovled_sql/starsFromHeavyGithubUsers2.sql index e4ceb1b21bebf3..cb7f85cd4edf86 100644 --- a/regression-test/suites/variant_p2/unresovled_sql/starsFromHeavyGithubUsers2.sql +++ b/regression-test/suites/variant_p2/unresovled_sql/starsFromHeavyGithubUsers2.sql @@ -1,16 +1,16 @@ -- ERROR: crash not support replicate -- SELECT --- cast(repo:name as string), +-- cast(repo["name"] as string), -- count() -- FROM github_events --- WHERE (type = 'WatchEvent') AND (cast(actor:login as string) IN +-- WHERE (type = 'WatchEvent') AND (cast(actor["login"] as string) IN -- ( --- SELECT cast(actor:login as string) +-- SELECT cast(actor["login"] as string) -- FROM github_events --- WHERE (type = 'PullRequestEvent') AND (cast(payload:action as string) = 'opened') --- GROUP BY cast(actor:login as string) +-- WHERE (type = 'PullRequestEvent') AND (cast(payload["action"] as string) = 'opened') +-- GROUP BY cast(actor["login"] as string) -- HAVING count() >= 2 -- )) --- GROUP BY cast(repo:name as string) +-- GROUP BY cast(repo["name"] as string) -- ORDER BY 1, count() DESC, 1 -- LIMIT 50 diff --git a/regression-test/suites/variant_p2/unresovled_sql/whoAreAllThosePeopleGivingStars3.sql b/regression-test/suites/variant_p2/unresovled_sql/whoAreAllThosePeopleGivingStars3.sql index 58083528b5bf6d..c15bc39a51e61c 100644 --- a/regression-test/suites/variant_p2/unresovled_sql/whoAreAllThosePeopleGivingStars3.sql +++ b/regression-test/suites/variant_p2/unresovled_sql/whoAreAllThosePeopleGivingStars3.sql @@ -1,15 +1,15 @@ -- ERROR: unmatched column -- SELECT --- cast(repo:name as string), +-- cast(repo["name"] as string), -- count() AS stars -- FROM github_events --- WHERE (type = 'WatchEvent') AND (cast(repo:name as string) IN +-- WHERE (type = 'WatchEvent') AND (cast(repo["name"] as string) IN -- ( --- SELECT cast(repo:name as string) +-- SELECT cast(repo["name"] as string) -- FROM github_events --- WHERE (type = 'WatchEvent') AND (cast(actor:login as string) = 'cliffordfajardo') +-- WHERE (type = 'WatchEvent') AND (cast(actor["login"] as string) = 'cliffordfajardo') -- )) --- GROUP BY cast(repo:name as string) +-- GROUP BY cast(repo["name"] as string) -- ORDER BY stars DESC -- LIMIT 50