[ https://issues.apache.org/jira/browse/PHOENIX-6498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17381845#comment-17381845 ]
ASF GitHub Bot commented on PHOENIX-6498: ----------------------------------------- stoty commented on pull request #1268: URL: https://github.com/apache/phoenix/pull/1268#issuecomment-881230767 :broken_heart: **-1 overall** | Vote | Subsystem | Runtime | Comment | |:----:|----------:|--------:|:--------| | +0 :ok: | reexec | 4m 57s | Docker mode activated. | ||| _ Prechecks _ | | +1 :green_heart: | dupname | 0m 0s | No case conflicting files found. | | +1 :green_heart: | hbaseanti | 0m 0s | Patch does not have any anti-patterns. | | +1 :green_heart: | @author | 0m 0s | The patch does not contain any @author tags. | | +1 :green_heart: | test4tests | 0m 0s | The patch appears to include 1 new or modified test files. | ||| _ 4.x Compile Tests _ | | +1 :green_heart: | mvninstall | 18m 13s | 4.x passed | | +1 :green_heart: | compile | 1m 1s | 4.x passed | | +1 :green_heart: | checkstyle | 0m 35s | 4.x passed | | +1 :green_heart: | javadoc | 0m 46s | 4.x passed | | +0 :ok: | spotbugs | 3m 0s | phoenix-core in 4.x has 954 extant spotbugs warnings. | ||| _ Patch Compile Tests _ | | +1 :green_heart: | mvninstall | 9m 50s | the patch passed | | +1 :green_heart: | compile | 1m 2s | the patch passed | | +1 :green_heart: | javac | 1m 2s | the patch passed | | -1 :x: | checkstyle | 0m 35s | phoenix-core: The patch generated 60 new + 294 unchanged - 43 fixed = 354 total (was 337) | | -1 :x: | whitespace | 0m 0s | The patch has 1 line(s) that end in whitespace. Use git apply --whitespace=fix <<patch_file>>. Refer https://git-scm.com/docs/git-apply | | +1 :green_heart: | javadoc | 0m 44s | the patch passed | | +1 :green_heart: | spotbugs | 3m 12s | the patch passed | ||| _ Other Tests _ | | +1 :green_heart: | unit | 207m 49s | phoenix-core in the patch passed. | | +1 :green_heart: | asflicense | 0m 11s | The patch does not generate ASF License warnings. | | | | 252m 55s | | | Subsystem | Report/Notes | |----------:|:-------------| | Docker | ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1268/1/artifact/yetus-general-check/output/Dockerfile | | GITHUB PR | https://github.com/apache/phoenix/pull/1268 | | Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile | | uname | Linux 2b8718e17ccd 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux | | Build tool | maven | | Personality | dev/phoenix-personality.sh | | git revision | 4.x / 4215de3 | | Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 | | checkstyle | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1268/1/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt | | whitespace | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1268/1/artifact/yetus-general-check/output/whitespace-eol.txt | | Test Results | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1268/1/testReport/ | | Max. process+thread count | 5024 (vs. ulimit of 30000) | | modules | C: phoenix-core U: phoenix-core | | Console output | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1268/1/console | | versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 | | Powered by | Apache Yetus 0.12.0 https://yetus.apache.org | This message was automatically generated. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@phoenix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Fix incorrect Correlated Exists Subquery rewrite when Subquery is aggregate > --------------------------------------------------------------------------- > > Key: PHOENIX-6498 > URL: https://issues.apache.org/jira/browse/PHOENIX-6498 > Project: Phoenix > Issue Type: Bug > Affects Versions: 4.16.1, 5.1.2 > Reporter: chenglei > Assignee: chenglei > Priority: Major > Fix For: 4.17.0, 5.2.0 > > > Given following tables : > {code:java} > create table item > (item_id varchar not null primary key, > name varchar, > price integer, > discount1 integer, > discount2 integer, > supplier_id varchar, > description varchar) > > create table order > (order_id varchar not null primary key, > customer_id varchar, > item_id varchar, > price integer, > quantity integer, > date timestamp) > {code} > for the correlated exists subquery: > {code:java} > SELECT item_id, name FROM item i WHERE exists > (SELECT 1 FROM order o where o.item_id = i.item_id > group by customer_id having count(order_id) > 1) ORDER BY name > {code} > Phoenix would throw following exception: > {code:java} > java.sql.SQLException: ERROR 1018 (42Y27): Aggregate may not contain columns > not in GROUP BY. ITEM_ID > at > org.apache.phoenix.exception.SQLExceptionCode$Factory$1.newException(SQLExceptionCode.java:606) > at > org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:217) > at > org.apache.phoenix.compile.ExpressionCompiler.throwNonAggExpressionInAggException(ExpressionCompiler.java:1090) > at > org.apache.phoenix.compile.ProjectionCompiler.compile(ProjectionCompiler.java:445) > at > org.apache.phoenix.compile.QueryCompiler.compileSingleFlatQuery(QueryCompiler.java:755) > at > org.apache.phoenix.compile.QueryCompiler.compileSingleQuery(QueryCompiler.java:674) > at > org.apache.phoenix.compile.QueryCompiler.compileSelect(QueryCompiler.java:251) > at > org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:178) > at > org.apache.phoenix.compile.QueryCompiler.compileSubquery(QueryCompiler.java:661) > at > org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:289) > at > org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:370) > at > org.apache.phoenix.compile.QueryCompiler.compileJoinQuery(QueryCompiler.java:302) > at > org.apache.phoenix.compile.QueryCompiler.compileSelect(QueryCompiler.java:249) > at > org.apache.phoenix.compile.QueryCompiler.compile(QueryCompiler.java:178) > at > org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:672) > at > org.apache.phoenix.jdbc.PhoenixStatement$ExecutableSelectStatement.compilePlan(PhoenixStatement.java:1) > at > org.apache.phoenix.jdbc.PhoenixStatement.compileQuery(PhoenixStatement.java:2011) > at > org.apache.phoenix.jdbc.PhoenixStatement.compileQuery(PhoenixStatement.java:2004) > at > org.apache.phoenix.jdbc.PhoenixStatement.optimizeQuery(PhoenixStatement.java:1998) > {code} > That is because Phoenix incorrectly rewrite the subquery as: > {code:java} > SELECT DISTINCT 1 $3,O.ITEM_ID $2 FROM ORDER_TABLE O GROUP BY CUSTOMER_ID > HAVING COUNT(ORDER_ID) > 1 > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)