Skip to content

PHOENIX-6271: Effective DDL generated by SchemaExtractionTool should … - #1212

Merged
swaroopak merged 1 commit into
apache:4.xfrom
swaroopak:PHOENIX-6271
Apr 29, 2021
Merged

PHOENIX-6271: Effective DDL generated by SchemaExtractionTool should …#1212
swaroopak merged 1 commit into
apache:4.xfrom
swaroopak:PHOENIX-6271

Conversation

@swaroopak

Copy link
Copy Markdown
Contributor

…maintain the order of PK and other columns

@stoty

Copy link
Copy Markdown
Contributor

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 55sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
-1 ❌test4tests0m 0sThe 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.
_ 4.x Compile Tests _
+0 🆗mvndep5m 28sMaven dependency ordering for branch
+1 💚mvninstall11m 11s4.x passed
+1 💚compile1m 48s4.x passed
+1 💚checkstyle0m 58s4.x passed
+1 💚javadoc1m 12s4.x passed
+0 🆗spotbugs3m 57sphoenix-core in 4.x has 946 extant spotbugs warnings.
+0 🆗spotbugs0m 50sphoenix-tools in 4.x has 3 extant spotbugs warnings.
_ Patch Compile Tests _
+0 🆗mvndep0m 14sMaven dependency ordering for patch
+1 💚mvninstall7m 16sthe patch passed
+1 💚compile1m 54sthe patch passed
+1 💚javac1m 54sthe patch passed
-1 ❌checkstyle0m 45sphoenix-core: The patch generated 2 new + 719 unchanged - 3 fixed = 721 total (was 722)
-1 ❌checkstyle0m 16sphoenix-tools: The patch generated 11 new + 215 unchanged - 8 fixed = 226 total (was 223)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc1m 7sthe patch passed
+1 💚spotbugs5m 31sthe patch passed
_ Other Tests _
+1 💚unit241m 55sphoenix-core in the patch passed.
+1 💚unit4m 10sphoenix-tools in the patch passed.
+1 💚asflicense0m 20sThe patch does not generate ASF License warnings.
292m 15s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1212/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1212
JIRA IssuePHOENIX-6271
Optional Testsdupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile
unameLinux c6050475172b 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 toolmaven
Personalitydev/phoenix-personality.sh
git revision4.x / c3f166e
Default JavaPrivate Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08
checkstylehttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1212/1/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
checkstylehttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1212/1/artifact/yetus-general-check/output/diff-checkstyle-phoenix-tools.txt
Test Resultshttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1212/1/testReport/
Max. process+thread count4725 (vs. ulimit of 30000)
modulesC: phoenix-core phoenix-tools U: .
Console outputhttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1212/1/console
versionsgit=2.7.4 maven=3.3.9 spotbugs=4.1.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@gokcenigokceni left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

some nits

}
if(tableNameNeedsQuotes || schemaNameNeedsQuotes) {
pTableFullName = pSchemaName + "." + pTableName;
if (pSchemaName != null && !pSchemaName.isEmpty()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Strings.isNullOrEmpty

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also do you need to think about namespaceenabled? I am guessing no

private static boolean isQuotesNeeded(String name) {
// first char numeric or non-underscore
if(!Character.isAlphabetic(name.charAt(0)) && name.charAt(0)!='_') {
if (name == null || name.isEmpty()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Strings.isNullOrEmpty

@gjacoby126gjacoby126 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe I'm misunderstanding what you're trying to do in this patch, but the results for indexes look incorrect to me. The effective DDL of an index shouldn't contain the PK suffix inherited from the base table or parent view. (I can see it being useful to include such a thing in a SQL comment or something, but not the CREATE INDEX statement itself)

if (effectivePK.isEmpty()) {
effectivePK = indexPkSet;
// This is added because of PHOENIX-2340
if (dataPTable.isMultiTenant() && indexPKName.contains(dataPKName.get(0))) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: can we have a String tenantId = dataPKName.get(0); line and use that in the checks? I worry that if we ever implement PHOENIX-5248 that the current logic here will be too subtle for the implementer to realize that it needs to be changed if we can't depend on first column == tenantId.

@stoty

Copy link
Copy Markdown
Contributor

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 4sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
-1 ❌test4tests0m 0sThe 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.
_ 4.x Compile Tests _
+0 🆗mvndep5m 7sMaven dependency ordering for branch
+1 💚mvninstall9m 19s4.x passed
+1 💚compile1m 32s4.x passed
+1 💚checkstyle1m 2s4.x passed
+1 💚javadoc1m 0s4.x passed
+0 🆗spotbugs3m 0sphoenix-core in 4.x has 946 extant spotbugs warnings.
+0 🆗spotbugs0m 45sphoenix-tools in 4.x has 3 extant spotbugs warnings.
_ Patch Compile Tests _
+0 🆗mvndep0m 17sMaven dependency ordering for patch
+1 💚mvninstall6m 2sthe patch passed
+1 💚compile1m 32sthe patch passed
+1 💚javac1m 32sthe patch passed
-1 ❌checkstyle0m 45sphoenix-core: The patch generated 2 new + 719 unchanged - 3 fixed = 721 total (was 722)
-1 ❌checkstyle0m 15sphoenix-tools: The patch generated 34 new + 192 unchanged - 31 fixed = 226 total (was 223)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 57sthe patch passed
+1 💚spotbugs4m 5sthe patch passed
_ Other Tests _
+1 💚unit211m 55sphoenix-core in the patch passed.
+1 💚unit4m 18sphoenix-tools in the patch passed.
+1 💚asflicense0m 18sThe patch does not generate ASF License warnings.
254m 27s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1212/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#1212
JIRA IssuePHOENIX-6271
Optional Testsdupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile
unameLinux 0820657ae601 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 toolmaven
Personalitydev/phoenix-personality.sh
git revision4.x / c3f166e
Default JavaPrivate Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08
checkstylehttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1212/2/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
checkstylehttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1212/2/artifact/yetus-general-check/output/diff-checkstyle-phoenix-tools.txt
Test Resultshttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1212/2/testReport/
Max. process+thread count5094 (vs. ulimit of 30000)
modulesC: phoenix-core phoenix-tools U: .
Console outputhttps://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1212/2/console
versionsgit=2.7.4 maven=3.3.9 spotbugs=4.1.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@gjacoby126gjacoby126 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1, thanks for the patch and adding the extra test assertions, @swaroopak


import javax.annotation.Nullable;

import com.google.common.base.Strings;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remember that you'll have to use the shaded version when you port to master.

@swaroopak

Copy link
Copy Markdown
ContributorAuthor

Thank you for the review @gjacoby126@gokceni

@swaroopak
swaroopak merged commit 8d8be95 into apache:4.xApr 29, 2021
swaroopak added a commit that referenced this pull request May 21, 2021
…maintain the order of PK and other columns (#1212)
Co-authored-by: Swaroopa Kadam <s.kadam@apache.org>
stoty pushed a commit to stoty/phoenix that referenced this pull request Jun 18, 2021
…maintain the order of PK and other columns (apache#1212)
Co-authored-by: Swaroopa Kadam <s.kadam@apache.org>
asfgit pushed a commit that referenced this pull request Jun 18, 2021
…maintain the order of PK and other columns (#1212)
Co-authored-by: Swaroopa Kadam <s.kadam@apache.org>
Sign up for freeto 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

@swaroopak@stoty@gjacoby126@gokceni