Skip to content

Conversation

@richardantal
Copy link
Contributor

…ine Without It

I found out that when we had (local) index then we didn't have the CursorFetchPlan but it was optimized to a ScanPlan on the index.

@stoty
Copy link
Contributor

stoty commented Aug 17, 2021

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 6m 50s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ master Compile Tests _
+1 💚 mvninstall 24m 37s master passed
+0 hbaserecompile 33m 42s HBase recompiled.
+1 💚 compile 1m 7s master passed
+1 💚 checkstyle 1m 5s master passed
+1 💚 javadoc 0m 52s master passed
+0 🆗 spotbugs 3m 26s phoenix-core in master has 973 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚 mvninstall 16m 51s the patch passed
+0 hbaserecompile 27m 19s HBase recompiled.
+1 💚 compile 1m 6s the patch passed
+1 💚 javac 1m 6s the patch passed
-1 ❌ checkstyle 1m 7s phoenix-core: The patch generated 6 new + 212 unchanged - 3 fixed = 218 total (was 215)
-1 ❌ whitespace 0m 0s The patch 3 line(s) with tabs.
+1 💚 javadoc 0m 51s the patch passed
+1 💚 spotbugs 3m 29s the patch passed
_ Other Tests _
+1 💚 unit 120m 59s phoenix-core in the patch passed.
+1 💚 asflicense 0m 13s The patch does not generate ASF License warnings.
199m 53s
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-1287/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #1287
Optional Tests dupname asflicense javac javadoc unit spotbugs hbaserebuild hbaseanti checkstyle compile
uname Linux 1040f3c493cf 4.15.0-143-generic #147-Ubuntu SMP Wed Apr 14 16:10:11 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev/phoenix-personality.sh
git revision master / c4d297d
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-1287/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-1287/1/artifact/yetus-general-check/output/whitespace-tabs.txt
Test Results https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1287/1/testReport/
Max. process+thread count 9697 (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-1287/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.

throw new RowValueConstructorOffsetNotCoercibleException("No table or index could be coerced to the PK as the offset. Or an uncovered index was attempted");
}

if (applicablePlans.get(0) instanceof CursorFetchPlan) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather put in a generic query method if possible. This code seems to imply that the cursor fetch plan is always first followed by several normal execution plans. This special case handling seems awkward at best is. it possible to generalize this somehow either in initial plan creation ie create them as separate cursor plans or maybe as part of a general plan method? I probably am missing a bunch of details.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the review @dbwong !

@richardantal
Copy link
Contributor Author

The ScanPlan in CursorFetchPlan was not using the index when we called the optimize on the CursorFetchPlan it added a simple ScanPlan (using the index) to the applicablePlans and at the and it got selected as the best one.

I've updated the constructor to optimize the ScanPlan at the first place.

@stoty
Copy link
Contributor

stoty commented Aug 24, 2021

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 6m 32s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ master Compile Tests _
+1 💚 mvninstall 23m 47s master passed
+0 hbaserecompile 30m 52s HBase recompiled.
+1 💚 compile 1m 6s master passed
+1 💚 checkstyle 1m 2s master passed
+1 💚 javadoc 0m 53s master passed
+0 🆗 spotbugs 3m 21s phoenix-core in master has 972 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚 mvninstall 17m 10s the patch passed
+0 hbaserecompile 27m 34s HBase recompiled.
+1 💚 compile 1m 5s the patch passed
+1 💚 javac 1m 5s the patch passed
-1 ❌ checkstyle 1m 2s phoenix-core: The patch generated 2 new + 21 unchanged - 1 fixed = 23 total (was 22)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 52s the patch passed
+1 💚 spotbugs 3m 31s the patch passed
_ Other Tests _
-1 ❌ unit 120m 27s phoenix-core in the patch failed.
+1 💚 asflicense 0m 34s The patch does not generate ASF License warnings.
198m 29s
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-1287/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #1287
Optional Tests dupname asflicense javac javadoc unit spotbugs hbaserebuild hbaseanti checkstyle compile
uname Linux 99d9f524882d 4.15.0-153-generic #160-Ubuntu SMP Thu Jul 29 06:54:29 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev/phoenix-personality.sh
git revision master / 9dfb423
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-1287/2/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
unit https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1287/2/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt
Test Results https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1287/2/testReport/
Max. process+thread count 9240 (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-1287/2/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.

try {
compilePlan = statement.getConnection().getQueryServices().getOptimizer().optimize(statement, queryPlan);
} catch (SQLException e) {
e.printStackTrace();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use logger here.

QueryPlan compilePlan = queryPlan;
try {
compilePlan = statement.getConnection().getQueryServices().getOptimizer().optimize(statement, queryPlan);
} catch (SQLException e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we want to handle the exception, shouldn't we just propogate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to handle the exception to minimise the effect of this change in case the optimize() throws an Exception.
Even if we handle the exception here (in the DeclareCursorCompiler) later optimize() will be called on the CursorFetchPlan and the Exception would be thrown there so it doesn't really makes sense to handle it here probably.

@richardantal
Copy link
Contributor Author

Thank you @ankitsinghal for the review.
I've updated the PR.

@stoty
Copy link
Contributor

stoty commented Aug 25, 2021

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 7m 2s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ master Compile Tests _
+1 💚 mvninstall 27m 13s master passed
+0 hbaserecompile 35m 56s HBase recompiled.
+1 💚 compile 1m 20s master passed
+1 💚 checkstyle 1m 11s master passed
+1 💚 javadoc 1m 3s master passed
+0 🆗 spotbugs 4m 31s phoenix-core in master has 972 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚 mvninstall 19m 43s the patch passed
+0 hbaserecompile 32m 24s HBase recompiled.
+1 💚 compile 1m 25s the patch passed
+1 💚 javac 1m 25s the patch passed
-1 ❌ checkstyle 1m 14s phoenix-core: The patch generated 1 new + 21 unchanged - 1 fixed = 22 total (was 22)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 1m 0s the patch passed
+1 💚 spotbugs 4m 31s the patch passed
_ Other Tests _
-1 ❌ unit 117m 12s phoenix-core in the patch failed.
+1 💚 asflicense 0m 42s The patch does not generate ASF License warnings.
208m 39s
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-1287/3/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #1287
Optional Tests dupname asflicense javac javadoc unit spotbugs hbaserebuild hbaseanti checkstyle compile
uname Linux b0ce7ffc49e8 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 master / 9dfb423
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-1287/3/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
unit https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1287/3/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt
Test Results https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1287/3/testReport/
Max. process+thread count 14450 (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-1287/3/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.

Copy link
Contributor

@stoty stoty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits on the test.

this.statement = statement;
this.operation = operation;
this.queryPlan = queryPlan;
this.queryPlan = statement.getConnection().getQueryServices().getOptimizer()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this change help?
By pre-optimizing the query, we force the next optimization plan to be a No-Op ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change we optimize the plan inside the CursorFetchPlan.
Later when the next optimize is called, the original CursorFetchPlan will be selected as there won't be any better plans.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a code comment with this information and a reference to this ticket.

@stoty
Copy link
Contributor

stoty commented Sep 8, 2021

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 8m 50s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ master Compile Tests _
+1 💚 mvninstall 27m 29s master passed
+0 hbaserecompile 35m 49s HBase recompiled.
+1 💚 compile 1m 24s master passed
+1 💚 checkstyle 1m 20s master passed
+1 💚 javadoc 1m 1s master passed
+0 🆗 spotbugs 3m 54s phoenix-core in master has 972 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚 mvninstall 19m 43s the patch passed
+0 hbaserecompile 32m 40s HBase recompiled.
+1 💚 compile 1m 20s the patch passed
+1 💚 javac 1m 20s the patch passed
-1 ❌ checkstyle 1m 15s phoenix-core: The patch generated 1 new + 21 unchanged - 1 fixed = 22 total (was 22)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 1m 1s the patch passed
+1 💚 spotbugs 4m 22s the patch passed
_ Other Tests _
-1 ❌ unit 139m 42s phoenix-core in the patch failed.
+1 💚 asflicense 0m 37s The patch does not generate ASF License warnings.
232m 45s
Reason Tests
Failed junit tests phoenix.end2end.AuditLoggingIT
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-1287/4/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #1287
Optional Tests dupname asflicense javac javadoc unit spotbugs hbaserebuild hbaseanti checkstyle compile
uname Linux 48a473be5f8c 4.15.0-147-generic #151-Ubuntu SMP Fri Jun 18 19:21:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev/phoenix-personality.sh
git revision master / 19b2260
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-1287/4/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
unit https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1287/4/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt
Test Results https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1287/4/testReport/
Max. process+thread count 7881 (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-1287/4/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.

@richardantal richardantal requested a review from stoty September 9, 2021 08:23
Copy link
Contributor

@stoty stoty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 LGTM (but better check with @ankitsinghal too)

@stoty
Copy link
Contributor

stoty commented Sep 10, 2021

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 4m 36s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ master Compile Tests _
+1 💚 mvninstall 20m 54s master passed
+0 hbaserecompile 27m 25s HBase recompiled.
+1 💚 compile 1m 5s master passed
+1 💚 checkstyle 0m 56s master passed
+1 💚 javadoc 0m 53s master passed
+0 🆗 spotbugs 3m 8s phoenix-core in master has 972 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚 mvninstall 13m 35s the patch passed
+0 hbaserecompile 23m 24s HBase recompiled.
+1 💚 compile 1m 4s the patch passed
+1 💚 javac 1m 4s the patch passed
-1 ❌ checkstyle 0m 56s phoenix-core: The patch generated 3 new + 20 unchanged - 2 fixed = 23 total (was 22)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 javadoc 0m 50s the patch passed
+1 💚 spotbugs 3m 19s the patch passed
_ Other Tests _
-1 ❌ unit 112m 29s phoenix-core in the patch failed.
+1 💚 asflicense 0m 45s The patch does not generate ASF License warnings.
180m 53s
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-1287/5/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #1287
Optional Tests dupname asflicense javac javadoc unit spotbugs hbaserebuild hbaseanti checkstyle compile
uname Linux 13afcb19e82d 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 master / 19b2260
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-1287/5/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
unit https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1287/5/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt
Test Results https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1287/5/testReport/
Max. process+thread count 15556 (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-1287/5/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.

@richardantal richardantal merged commit c55b472 into apache:master Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants