Uh oh!
There was an error while loading. Please reload this page.
PHOENIX-6271: Effective DDL generated by SchemaExtractionTool should … - #1212
Conversation
stoty
commented
Apr 27, 2021
💔 -1 overall
This message was automatically generated. |
| } | ||
| if(tableNameNeedsQuotes || schemaNameNeedsQuotes) { | ||
| pTableFullName = pSchemaName + "." + pTableName; | ||
| if (pSchemaName != null && !pSchemaName.isEmpty()) { |
There was a problem hiding this comment.
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()) { |
gjacoby126
left a comment
There was a problem hiding this comment.
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))) { |
There was a problem hiding this comment.
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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…maintain the order of PK and other columns
stoty
commented
Apr 29, 2021
💔 -1 overall
This message was automatically generated. |
gjacoby126
left a comment
There was a problem hiding this comment.
+1, thanks for the patch and adding the extra test assertions, @swaroopak
| import javax.annotation.Nullable; | ||
| import com.google.common.base.Strings; |
There was a problem hiding this comment.
Remember that you'll have to use the shaded version when you port to master.
Uh oh!
There was an error while loading. Please reload this page.
swaroopak
commented
Apr 29, 2021
Thank you for the review @gjacoby126@gokceni |
…maintain the order of PK and other columns (#1212) Co-authored-by: Swaroopa Kadam <s.kadam@apache.org>
…maintain the order of PK and other columns (apache#1212) Co-authored-by: Swaroopa Kadam <s.kadam@apache.org>
…maintain the order of PK and other columns (#1212) Co-authored-by: Swaroopa Kadam <s.kadam@apache.org>
…maintain the order of PK and other columns