[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-13 Thread Lars Hofhansl (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17344237#comment-17344237
 ] 

Lars Hofhansl commented on PHOENIX-6457:


I think. Thanks [~gjacoby]

> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-12 Thread Geoffrey Jacoby (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17343531#comment-17343531
 ] 

Geoffrey Jacoby commented on PHOENIX-6457:
--

[~larsh] - this changes the schema of System.Catalog, which makes it ineligible 
to be in a patch release. Hence it went in 4.x (4.17) and master (5.2) but not 
5.1 (5.1.2) or 4.16 (4.16.2)

> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-10 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17342168#comment-17342168
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

gjacoby126 merged pull request #1225:
URL: https://github.com/apache/phoenix/pull/1225


   


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-10 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17342167#comment-17342167
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

gjacoby126 commented on pull request #1225:
URL: https://github.com/apache/phoenix/pull/1225#issuecomment-837431600


   Merging without review since this is a trivial port of an approved PR #1216 


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-10 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17342166#comment-17342166
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

gjacoby126 commented on pull request #1225:
URL: https://github.com/apache/phoenix/pull/1225#issuecomment-837430064


   The initial 3 test failures from the first test run passed in the second. I 
verified that AuditLoggingIT (failed in the second test run) passed locally, so 
this appears to be a flapper. I also verified UpsertSelectIT from the initial 
test failure locally and it passed. 


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-10 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17342136#comment-17342136
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

stoty commented on pull request #1225:
URL: https://github.com/apache/phoenix/pull/1225#issuecomment-837305347


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | +0 :ok: |  reexec  |   0m 35s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  No case conflicting files 
found.  |
   | +1 :green_heart: |  hbaseanti  |   0m  1s |  Patch does not have any 
anti-patterns.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any 
@author tags.  |
   | -1 :x: |  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 :green_heart: |  mvninstall  |  19m 14s |  master passed  |
   | +0 |  hbaserecompile  |  28m 12s |  HBase recompiled.  |
   | +1 :green_heart: |  compile  |   1m 13s |  master passed  |
   | +1 :green_heart: |  checkstyle  |   3m 55s |  master passed  |
   | +1 :green_heart: |  javadoc  |   1m  3s |  master passed  |
   | +0 :ok: |  spotbugs  |   4m 10s |  phoenix-core in master has 959 extant 
spotbugs warnings.  |
   ||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  11m 31s |  the patch passed  |
   | +0 |  hbaserecompile  |  24m 17s |  HBase recompiled.  |
   | +1 :green_heart: |  compile  |   1m 24s |  the patch passed  |
   | +1 :green_heart: |  cc  |   1m 24s |  the patch passed  |
   | +1 :green_heart: |  javac  |   1m 24s |  the patch passed  |
   | -1 :x: |  checkstyle  |   4m 15s |  phoenix-core: The patch generated 102 
new + 10335 unchanged - 52 fixed = 10437 total (was 10387)  |
   | +1 :green_heart: |  prototool  |   0m  3s |  There were no new prototool 
issues.  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace 
issues.  |
   | +1 :green_heart: |  javadoc  |   1m  1s |  the patch passed  |
   | -1 :x: |  spotbugs  |   4m 31s |  phoenix-core generated 1 new + 958 
unchanged - 1 fixed = 959 total (was 959)  |
   ||| _ Other Tests _ |
   | -1 :x: |  unit  | 115m 38s |  phoenix-core in the patch failed.  |
   | +1 :green_heart: |  asflicense  |   0m 46s |  The patch does not generate 
ASF License warnings.  |
   |  |   | 190m 20s |   |
   
   
   | Reason | Tests |
   |---:|:--|
   | FindBugs | module:phoenix-core |
   |  |  org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SCHEMA_VERSION_BYTES 
is a mutable array  At MetaDataEndpointImpl.java: At 
MetaDataEndpointImpl.java:[line 352] |
   | 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-1225/2/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/phoenix/pull/1225 |
   | Optional Tests | dupname asflicense javac javadoc unit spotbugs 
hbaserebuild hbaseanti checkstyle compile cc prototool |
   | uname | Linux d63285ec87df 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 
16:55:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev/phoenix-personality.sh |
   | git revision | master / 88a0128 |
   | 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-1225/2/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
 |
   | spotbugs | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1225/2/artifact/yetus-general-check/output/new-spotbugs-phoenix-core.html
 |
   | unit | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1225/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-1225/2/testReport/
 |
   | Max. process+thread count | 14975 (vs. ulimit of 3) |
   | modules | C: phoenix-core U: phoenix-core |
   | Console output | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1225/2/console
 |
   | versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 prototool=1.10.0-dev |
   | 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 

[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-06 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17340440#comment-17340440
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

stoty commented on pull request #1225:
URL: https://github.com/apache/phoenix/pull/1225#issuecomment-833873919


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | +0 :ok: |  reexec  |   0m 36s |  Docker mode activated.  |
   ||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  No case conflicting files 
found.  |
   | +1 :green_heart: |  hbaseanti  |   0m  1s |  Patch does not have any 
anti-patterns.  |
   | +1 :green_heart: |  @author  |   0m  0s |  The patch does not contain any 
@author tags.  |
   | -1 :x: |  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 :green_heart: |  mvninstall  |  17m 38s |  master passed  |
   | +0 |  hbaserecompile  |  25m 42s |  HBase recompiled.  |
   | +1 :green_heart: |  compile  |   1m  7s |  master passed  |
   | +1 :green_heart: |  checkstyle  |   4m  6s |  master passed  |
   | +1 :green_heart: |  javadoc  |   0m 59s |  master passed  |
   | +0 :ok: |  spotbugs  |   3m 42s |  phoenix-core in master has 959 extant 
spotbugs warnings.  |
   ||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   9m 19s |  the patch passed  |
   | +0 |  hbaserecompile  |  20m 25s |  HBase recompiled.  |
   | +1 :green_heart: |  compile  |   1m  1s |  the patch passed  |
   | +1 :green_heart: |  cc  |   1m  1s |  the patch passed  |
   | +1 :green_heart: |  javac  |   1m  1s |  the patch passed  |
   | -1 :x: |  checkstyle  |   4m 57s |  phoenix-core: The patch generated 75 
new + 10362 unchanged - 25 fixed = 10437 total (was 10387)  |
   | +1 :green_heart: |  prototool  |   0m  1s |  There were no new prototool 
issues.  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace 
issues.  |
   | +1 :green_heart: |  javadoc  |   0m 51s |  the patch passed  |
   | -1 :x: |  spotbugs  |   3m 14s |  phoenix-core generated 1 new + 958 
unchanged - 1 fixed = 959 total (was 959)  |
   ||| _ Other Tests _ |
   | -1 :x: |  unit  | 113m 42s |  phoenix-core in the patch failed.  |
   | +1 :green_heart: |  asflicense  |   0m 39s |  The patch does not generate 
ASF License warnings.  |
   |  |   | 180m 35s |   |
   
   
   | Reason | Tests |
   |---:|:--|
   | FindBugs | module:phoenix-core |
   |  |  org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SCHEMA_VERSION_BYTES 
is a mutable array  At MetaDataEndpointImpl.java: At 
MetaDataEndpointImpl.java:[line 352] |
   | Failed junit tests | 
phoenix.end2end.PermissionNSEnabledWithCustomAccessControllerIT |
   |   | phoenix.end2end.UpsertSelectIT |
   |   | phoenix.end2end.PermissionsCacheIT |
   
   
   | 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-1225/1/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/phoenix/pull/1225 |
   | Optional Tests | dupname asflicense javac javadoc unit spotbugs 
hbaserebuild hbaseanti checkstyle compile cc prototool |
   | uname | Linux 88557b5e1191 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 
11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev/phoenix-personality.sh |
   | git revision | master / 5265164 |
   | 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-1225/1/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
 |
   | spotbugs | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1225/1/artifact/yetus-general-check/output/new-spotbugs-phoenix-core.html
 |
   | unit | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1225/1/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-1225/1/testReport/
 |
   | Max. process+thread count | 13523 (vs. ulimit of 3) |
   | modules | C: phoenix-core U: phoenix-core |
   | Console output | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1225/1/console
 |
   | versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 prototool=1.10.0-dev |
   | Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from 

[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-04 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17339239#comment-17339239
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

gokceni commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r626037832



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java
##
@@ -1166,6 +1166,31 @@ public void testTableDescriptorPriority() throws 
SQLException, IOException {
 }
 }
 
+@Test
+public void testCreateTableSchemaVersion() throws Exception {
+Properties props = new Properties();
+final String schemaName = generateUniqueName();
+final String tableName = generateUniqueName();
+final String version = "V1.0";
+try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
+testCreateTableSchemaVersionHelper(conn, schemaName, tableName, 
version);
+}
+}
+
+public static void testCreateTableSchemaVersionHelper(Connection conn, 
String schemaName, String tableName,
+  String 
dataTableVersion)
+throws Exception {
+final String dataTableFullName = SchemaUtil.getTableName(schemaName, 
tableName);
+String ddl =
+"CREATE TABLE " + dataTableFullName + " (\n" + "ID1 
VARCHAR(15) NOT NULL,\n"

Review comment:
   Agree with @swaroopak that we should do it.




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-04 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17339230#comment-17339230
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

swaroopak commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r626029188



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java
##
@@ -1166,6 +1166,31 @@ public void testTableDescriptorPriority() throws 
SQLException, IOException {
 }
 }
 
+@Test
+public void testCreateTableSchemaVersion() throws Exception {
+Properties props = new Properties();
+final String schemaName = generateUniqueName();
+final String tableName = generateUniqueName();
+final String version = "V1.0";
+try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
+testCreateTableSchemaVersionHelper(conn, schemaName, tableName, 
version);
+}
+}
+
+public static void testCreateTableSchemaVersionHelper(Connection conn, 
String schemaName, String tableName,
+  String 
dataTableVersion)
+throws Exception {
+final String dataTableFullName = SchemaUtil.getTableName(schemaName, 
tableName);
+String ddl =
+"CREATE TABLE " + dataTableFullName + " (\n" + "ID1 
VARCHAR(15) NOT NULL,\n"

Review comment:
   Good to have a follow-up Jira in that case. I feel ALTER ADD/DROP should 
implicitly increment the schema_version. If every org/customer decides the 
schema_version format by themselves, this will be difficult. WDYT?




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-04 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17339228#comment-17339228
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

swaroopak commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r626027863



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
##
@@ -999,6 +1001,25 @@ public void testDeleteCount_index() throws Exception {
 }
 }
 
+@Test
+public void testCreateIndexSchemaVersion() throws Exception {

Review comment:
   Let's say I drop the column and schema version changes from v1 to v1.1. 
Currently, the phoenix will use v1.1 when processing a select * .  can we add a 
test for that?
   
   And is there a way I can query with old schema_version? 




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-03 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17338699#comment-17338699
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

stoty commented on pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#issuecomment-831613663


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | +0 :ok: |  reexec  |   1m 11s |  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 :x: |  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.  
|
   ||| _ 4.x Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  14m 51s |  4.x passed  |
   | +1 :green_heart: |  compile  |   1m  5s |  4.x passed  |
   | +1 :green_heart: |  checkstyle  |   3m  7s |  4.x passed  |
   | +1 :green_heart: |  javadoc  |   0m 49s |  4.x passed  |
   | +0 :ok: |  spotbugs  |   3m 17s |  phoenix-core in 4.x has 945 extant 
spotbugs warnings.  |
   ||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   6m 46s |  the patch passed  |
   | +1 :green_heart: |  compile  |   1m  6s |  the patch passed  |
   | +1 :green_heart: |  cc  |   1m  6s |  the patch passed  |
   | +1 :green_heart: |  javac  |   1m  6s |  the patch passed  |
   | -1 :x: |  checkstyle  |   3m 15s |  phoenix-core: The patch generated 75 
new + 10260 unchanged - 25 fixed = 10335 total (was 10285)  |
   | +1 :green_heart: |  prototool  |   0m  1s |  There were no new prototool 
issues.  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace 
issues.  |
   | +1 :green_heart: |  javadoc  |   0m 46s |  the patch passed  |
   | -1 :x: |  spotbugs  |   3m 33s |  phoenix-core generated 1 new + 944 
unchanged - 1 fixed = 945 total (was 945)  |
   ||| _ Other Tests _ |
   | +1 :green_heart: |  unit  | 196m 41s |  phoenix-core in the patch passed.  
|
   | +1 :green_heart: |  asflicense  |   0m  9s |  The patch does not generate 
ASF License warnings.  |
   |  |   | 237m 33s |   |
   
   
   | Reason | Tests |
   |---:|:--|
   | FindBugs | module:phoenix-core |
   |  |  org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SCHEMA_VERSION_BYTES 
is a mutable array  At MetaDataEndpointImpl.java: At 
MetaDataEndpointImpl.java:[line 344] |
   
   
   | 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-1216/2/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/phoenix/pull/1216 |
   | Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti 
checkstyle compile cc prototool |
   | uname | Linux f793742f68bc 4.15.0-128-generic #131-Ubuntu SMP Wed Dec 9 
06:57:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev/phoenix-personality.sh |
   | git revision | 4.x / 21bfbad |
   | 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-1216/2/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
 |
   | spotbugs | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1216/2/artifact/yetus-general-check/output/new-spotbugs-phoenix-core.html
 |
   |  Test Results | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1216/2/testReport/
 |
   | Max. process+thread count | 5093 (vs. ulimit of 3) |
   | modules | C: phoenix-core U: phoenix-core |
   | Console output | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1216/2/console
 |
   | versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 prototool=1.10.0-dev |
   | 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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  

[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-03 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17338625#comment-17338625
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

gjacoby126 commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r625382941



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java
##
@@ -1166,6 +1166,31 @@ public void testTableDescriptorPriority() throws 
SQLException, IOException {
 }
 }
 
+@Test
+public void testCreateTableSchemaVersion() throws Exception {
+Properties props = new Properties();
+final String schemaName = generateUniqueName();
+final String tableName = generateUniqueName();
+final String version = "V1.0";
+try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
+testCreateTableSchemaVersionHelper(conn, schemaName, tableName, 
version);
+}
+}
+
+public static void testCreateTableSchemaVersionHelper(Connection conn, 
String schemaName, String tableName,
+  String 
dataTableVersion)
+throws Exception {
+final String dataTableFullName = SchemaUtil.getTableName(schemaName, 
tableName);
+String ddl =
+"CREATE TABLE " + dataTableFullName + " (\n" + "ID1 
VARCHAR(15) NOT NULL,\n"

Review comment:
   @gokceni - wouldn't those be table properties as well? Should be able to 
do in one statement. 




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-03 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17338624#comment-17338624
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

gjacoby126 commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r625382682



##
File path: 
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java
##
@@ -95,7 +95,7 @@
 public static final long MIN_SYSTEM_TABLE_TIMESTAMP_4_14_0 = 
MIN_TABLE_TIMESTAMP + 28;
 public static final long MIN_SYSTEM_TABLE_TIMESTAMP_4_15_0 = 
MIN_TABLE_TIMESTAMP + 29;
 public static final long MIN_SYSTEM_TABLE_TIMESTAMP_4_16_0 = 
MIN_TABLE_TIMESTAMP + 33;
-public static final long MIN_SYSTEM_TABLE_TIMESTAMP_4_17_0 = 
MIN_TABLE_TIMESTAMP + 34;
+public static final long MIN_SYSTEM_TABLE_TIMESTAMP_4_17_0 = 
MIN_TABLE_TIMESTAMP + 35;

Review comment:
   Each syscat column needs an individual timestamp, and 33 was 4.16 + 1 
for Physical table name, +1 for schema version




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-03 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17338601#comment-17338601
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

gokceni commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r625359317



##
File path: 
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java
##
@@ -95,7 +95,7 @@
 public static final long MIN_SYSTEM_TABLE_TIMESTAMP_4_14_0 = 
MIN_TABLE_TIMESTAMP + 28;
 public static final long MIN_SYSTEM_TABLE_TIMESTAMP_4_15_0 = 
MIN_TABLE_TIMESTAMP + 29;
 public static final long MIN_SYSTEM_TABLE_TIMESTAMP_4_16_0 = 
MIN_TABLE_TIMESTAMP + 33;
-public static final long MIN_SYSTEM_TABLE_TIMESTAMP_4_17_0 = 
MIN_TABLE_TIMESTAMP + 34;
+public static final long MIN_SYSTEM_TABLE_TIMESTAMP_4_17_0 = 
MIN_TABLE_TIMESTAMP + 35;

Review comment:
   How do we come up with 35?

##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java
##
@@ -1166,6 +1166,31 @@ public void testTableDescriptorPriority() throws 
SQLException, IOException {
 }
 }
 
+@Test
+public void testCreateTableSchemaVersion() throws Exception {
+Properties props = new Properties();
+final String schemaName = generateUniqueName();
+final String tableName = generateUniqueName();
+final String version = "V1.0";
+try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
+testCreateTableSchemaVersionHelper(conn, schemaName, tableName, 
version);
+}
+}
+
+public static void testCreateTableSchemaVersionHelper(Connection conn, 
String schemaName, String tableName,
+  String 
dataTableVersion)
+throws Exception {
+final String dataTableFullName = SchemaUtil.getTableName(schemaName, 
tableName);
+String ddl =
+"CREATE TABLE " + dataTableFullName + " (\n" + "ID1 
VARCHAR(15) NOT NULL,\n"

Review comment:
   If I support changing Storage format or Column encoding, we will need to 
do alter table set schema again right? I think it will be good to invest in 
plumbing this change.




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-03 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17338595#comment-17338595
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

gjacoby126 commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r625343146



##
File path: 
phoenix-core/src/main/java/org/apache/phoenix/query/QueryConstants.java
##
@@ -38,128 +38,7 @@
 import org.apache.phoenix.schema.SystemTaskSplitPolicy;
 import org.apache.phoenix.schema.TableProperty;
 
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.APPEND_ONLY_SCHEMA;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.ARG_POSITION;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.ARRAY_SIZE;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.AUTO_PARTITION_SEQ;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.BASE_COLUMN_COUNT;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.BIND_PARAMETERS;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.BUFFER_LENGTH;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.CACHE_SIZE;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.CHANGE_DETECTION_ENABLED;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.CHAR_OCTET_LENGTH;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.CLASS_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.CLIENT_IP;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.COLUMN_COUNT;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.COLUMN_DEF;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.COLUMN_FAMILY;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.COLUMN_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.COLUMN_QUALIFIER;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.COLUMN_QUALIFIER_COUNTER;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.COLUMN_SIZE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.CURRENT_VALUE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.CYCLE_FLAG;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.DATA_TABLE_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.DATA_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.DECIMAL_DIGITS;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.DEFAULT_COLUMN_FAMILY_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.DEFAULT_VALUE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.DISABLE_WAL;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.ENCODING_SCHEME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.EXCEPTION_TRACE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.EXPLAIN_PLAN;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.FUNCTION_NAME;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.GLOBAL_SCAN_DETAILS;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.GUIDE_POSTS_ROW_COUNT;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.GUIDE_POSTS_WIDTH;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.GUIDE_POST_KEY;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IMMUTABLE_ROWS;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IMMUTABLE_STORAGE_SCHEME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.INCREMENT_BY;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.INDEX_DISABLE_TIMESTAMP;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.INDEX_STATE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.INDEX_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IS_ARRAY;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IS_AUTOINCREMENT;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IS_CONSTANT;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IS_NAMESPACE_MAPPED;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IS_NULLABLE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IS_ROW_TIMESTAMP;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IS_VIEW_REFERENCED;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.JAR_PATH;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.KEY_SEQ;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.LAST_DDL_TIMESTAMP;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.LAST_STATS_UPDATE_TIME;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.LIMIT_REACHED_FLAG;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.LINK_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.MAX_VALUE;

[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-03 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17338594#comment-17338594
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

gjacoby126 commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r625342954



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java
##
@@ -1465,6 +1465,28 @@ public void testLastDDLTimestampWithChildViews() throws 
Exception {
 
 }
 
-
+@Test
+public void testCreateViewSchemaVersion() throws Exception {
+Properties props = new Properties();
+final String schemaName = generateUniqueName();
+final String tableName = generateUniqueName();
+final String viewName = generateUniqueName();
+final String dataTableFullName = SchemaUtil.getTableName(schemaName, 
tableName);
+final String viewFullName = SchemaUtil.getTableName(schemaName, 
viewName);
+try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
+String oldVersion = "V1.0";
+CreateTableIT.testCreateTableSchemaVersionHelper(conn, schemaName, 
tableName, oldVersion);
+String createViewSql = "CREATE VIEW " + viewFullName + " AS SELECT 
* FROM " + dataTableFullName +
+" SCHEMA_VERSION='" + oldVersion + "'";
+conn.createStatement().execute(createViewSql);
+PTable view = PhoenixRuntime.getTableNoCache(conn, viewFullName);
+assertEquals(oldVersion, view.getSchemaVersion());
+String newVersion = "V1.1";
+String alterViewSql = "ALTER VIEW " + viewFullName + " SET 
SCHEMA_VERSION='" + newVersion + "'";
+conn.createStatement().execute(alterViewSql);
+PTable view2 = PhoenixRuntime.getTableNoCache(conn, viewFullName);
+assertEquals(newVersion, view2.getSchemaVersion());

Review comment:
   Done.




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-03 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17338558#comment-17338558
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

gjacoby126 commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r625290518



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java
##
@@ -1465,6 +1465,28 @@ public void testLastDDLTimestampWithChildViews() throws 
Exception {
 
 }
 
-
+@Test
+public void testCreateViewSchemaVersion() throws Exception {
+Properties props = new Properties();
+final String schemaName = generateUniqueName();
+final String tableName = generateUniqueName();
+final String viewName = generateUniqueName();
+final String dataTableFullName = SchemaUtil.getTableName(schemaName, 
tableName);
+final String viewFullName = SchemaUtil.getTableName(schemaName, 
viewName);
+try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
+String oldVersion = "V1.0";
+CreateTableIT.testCreateTableSchemaVersionHelper(conn, schemaName, 
tableName, oldVersion);
+String createViewSql = "CREATE VIEW " + viewFullName + " AS SELECT 
* FROM " + dataTableFullName +
+" SCHEMA_VERSION='" + oldVersion + "'";
+conn.createStatement().execute(createViewSql);
+PTable view = PhoenixRuntime.getTableNoCache(conn, viewFullName);
+assertEquals(oldVersion, view.getSchemaVersion());
+String newVersion = "V1.1";
+String alterViewSql = "ALTER VIEW " + viewFullName + " SET 
SCHEMA_VERSION='" + newVersion + "'";
+conn.createStatement().execute(alterViewSql);
+PTable view2 = PhoenixRuntime.getTableNoCache(conn, viewFullName);
+assertEquals(newVersion, view2.getSchemaVersion());

Review comment:
   There's not meant to be any cascade behavior here...what changes should 
I assert on? Just that that the base table didn't change? I could do that. 




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-03 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17338557#comment-17338557
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

gjacoby126 commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r625290041



##
File path: 
phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
##
@@ -3055,6 +3059,12 @@ public boolean isViewReferenced() {
 tableUpsert.setString(33, physicalTableName);
 }
 
+if (schemaVersion == null) {
+tableUpsert.setNull(34, Types.VARCHAR);

Review comment:
   I'd considered it but decided against the idea because I didn't want to 
proscribe a particular versioning scheme...the idea is that a particular 
organization can choose their own version stamps (and that they don't have to 
if they don't want to, hence default null)




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-03 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17338513#comment-17338513
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

gjacoby126 commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r625243107



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
##
@@ -999,6 +1001,25 @@ public void testDeleteCount_index() throws Exception {
 }
 }
 
+@Test
+public void testCreateIndexSchemaVersion() throws Exception {

Review comment:
   Not sure I understand this point...




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-03 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17338512#comment-17338512
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

gjacoby126 commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r625242627



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java
##
@@ -1166,6 +1166,31 @@ public void testTableDescriptorPriority() throws 
SQLException, IOException {
 }
 }
 
+@Test
+public void testCreateTableSchemaVersion() throws Exception {
+Properties props = new Properties();
+final String schemaName = generateUniqueName();
+final String tableName = generateUniqueName();
+final String version = "V1.0";
+try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
+testCreateTableSchemaVersionHelper(conn, schemaName, tableName, 
version);
+}
+}
+
+public static void testCreateTableSchemaVersionHelper(Connection conn, 
String schemaName, String tableName,
+  String 
dataTableVersion)
+throws Exception {
+final String dataTableFullName = SchemaUtil.getTableName(schemaName, 
tableName);
+String ddl =
+"CREATE TABLE " + dataTableFullName + " (\n" + "ID1 
VARCHAR(15) NOT NULL,\n"

Review comment:
   It appears there's a rule in Phoenix grammar which prevents setting 
table level properties (like schema version) while adding a column, which means 
that when adding a column you'd need a separate ALTER TABLE SET SCHEMA_VERSION 
statement. Not ideal, but I was trying to avoid large changes in the plumbing. 




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-03 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17338498#comment-17338498
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

swaroopak commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r625232656



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/CreateTableIT.java
##
@@ -1166,6 +1166,31 @@ public void testTableDescriptorPriority() throws 
SQLException, IOException {
 }
 }
 
+@Test
+public void testCreateTableSchemaVersion() throws Exception {
+Properties props = new Properties();
+final String schemaName = generateUniqueName();
+final String tableName = generateUniqueName();
+final String version = "V1.0";
+try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
+testCreateTableSchemaVersionHelper(conn, schemaName, tableName, 
version);
+}
+}
+
+public static void testCreateTableSchemaVersionHelper(Connection conn, 
String schemaName, String tableName,
+  String 
dataTableVersion)
+throws Exception {
+final String dataTableFullName = SchemaUtil.getTableName(schemaName, 
tableName);
+String ddl =
+"CREATE TABLE " + dataTableFullName + " (\n" + "ID1 
VARCHAR(15) NOT NULL,\n"

Review comment:
   If there are any changes on the table schema like new column addition or 
drop of an existing column, how would the schema version be updated? I am 
thinking phoenix should increment the version or we need to enhance the alter 
DDL to include schema version also in the statement. If the former, schema 
version format should be fixed just like sequence number. 




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-03 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17338502#comment-17338502
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

swaroopak commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r625233861



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexIT.java
##
@@ -999,6 +1001,25 @@ public void testDeleteCount_index() throws Exception {
 }
 }
 
+@Test
+public void testCreateIndexSchemaVersion() throws Exception {

Review comment:
   How will the select statements behave? They need to be schema version 
aware at least implicitly. 




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-03 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17338494#comment-17338494
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

swaroopak commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r625229666



##
File path: 
phoenix-core/src/it/java/org/apache/phoenix/end2end/AlterTableWithViewsIT.java
##
@@ -1465,6 +1465,28 @@ public void testLastDDLTimestampWithChildViews() throws 
Exception {
 
 }
 
-
+@Test
+public void testCreateViewSchemaVersion() throws Exception {
+Properties props = new Properties();
+final String schemaName = generateUniqueName();
+final String tableName = generateUniqueName();
+final String viewName = generateUniqueName();
+final String dataTableFullName = SchemaUtil.getTableName(schemaName, 
tableName);
+final String viewFullName = SchemaUtil.getTableName(schemaName, 
viewName);
+try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
+String oldVersion = "V1.0";
+CreateTableIT.testCreateTableSchemaVersionHelper(conn, schemaName, 
tableName, oldVersion);
+String createViewSql = "CREATE VIEW " + viewFullName + " AS SELECT 
* FROM " + dataTableFullName +
+" SCHEMA_VERSION='" + oldVersion + "'";
+conn.createStatement().execute(createViewSql);
+PTable view = PhoenixRuntime.getTableNoCache(conn, viewFullName);
+assertEquals(oldVersion, view.getSchemaVersion());
+String newVersion = "V1.1";
+String alterViewSql = "ALTER VIEW " + viewFullName + " SET 
SCHEMA_VERSION='" + newVersion + "'";
+conn.createStatement().execute(alterViewSql);
+PTable view2 = PhoenixRuntime.getTableNoCache(conn, viewFullName);
+assertEquals(newVersion, view2.getSchemaVersion());

Review comment:
   should we assert on changes on datatable schema version as well?




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-03 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17338491#comment-17338491
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

swaroopak commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r625227281



##
File path: 
phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
##
@@ -3055,6 +3059,12 @@ public boolean isViewReferenced() {
 tableUpsert.setString(33, physicalTableName);
 }
 
+if (schemaVersion == null) {
+tableUpsert.setNull(34, Types.VARCHAR);

Review comment:
   Or should have a default starting schema version? 




-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-05-03 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17338490#comment-17338490
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

swaroopak commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r625226658



##
File path: 
phoenix-core/src/main/java/org/apache/phoenix/query/QueryConstants.java
##
@@ -38,128 +38,7 @@
 import org.apache.phoenix.schema.SystemTaskSplitPolicy;
 import org.apache.phoenix.schema.TableProperty;
 
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.APPEND_ONLY_SCHEMA;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.ARG_POSITION;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.ARRAY_SIZE;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.AUTO_PARTITION_SEQ;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.BASE_COLUMN_COUNT;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.BIND_PARAMETERS;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.BUFFER_LENGTH;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.CACHE_SIZE;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.CHANGE_DETECTION_ENABLED;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.CHAR_OCTET_LENGTH;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.CLASS_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.CLIENT_IP;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.COLUMN_COUNT;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.COLUMN_DEF;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.COLUMN_FAMILY;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.COLUMN_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.COLUMN_QUALIFIER;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.COLUMN_QUALIFIER_COUNTER;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.COLUMN_SIZE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.CURRENT_VALUE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.CYCLE_FLAG;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.DATA_TABLE_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.DATA_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.DECIMAL_DIGITS;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.DEFAULT_COLUMN_FAMILY_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.DEFAULT_VALUE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.DISABLE_WAL;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.ENCODING_SCHEME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.EXCEPTION_TRACE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.EXPLAIN_PLAN;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.FUNCTION_NAME;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.GLOBAL_SCAN_DETAILS;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.GUIDE_POSTS_ROW_COUNT;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.GUIDE_POSTS_WIDTH;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.GUIDE_POST_KEY;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IMMUTABLE_ROWS;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IMMUTABLE_STORAGE_SCHEME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.INCREMENT_BY;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.INDEX_DISABLE_TIMESTAMP;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.INDEX_STATE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.INDEX_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IS_ARRAY;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IS_AUTOINCREMENT;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IS_CONSTANT;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IS_NAMESPACE_MAPPED;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IS_NULLABLE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IS_ROW_TIMESTAMP;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.IS_VIEW_REFERENCED;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.JAR_PATH;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.KEY_SEQ;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.LAST_DDL_TIMESTAMP;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.LAST_STATS_UPDATE_TIME;
-import static 
org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.LIMIT_REACHED_FLAG;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.LINK_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.MAX_VALUE;

[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-04-30 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17337638#comment-17337638
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

stoty commented on pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#issuecomment-830415787


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |::|--:|:|:|
   | +0 :ok: |  reexec  |   5m 37s |  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 :x: |  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.  
|
   ||| _ 4.x Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |  15m  7s |  4.x passed  |
   | +1 :green_heart: |  compile  |   1m  6s |  4.x passed  |
   | +1 :green_heart: |  checkstyle  |   3m 12s |  4.x passed  |
   | +1 :green_heart: |  javadoc  |   0m 49s |  4.x passed  |
   | +0 :ok: |  spotbugs  |   3m 17s |  phoenix-core in 4.x has 945 extant 
spotbugs warnings.  |
   ||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   6m 53s |  the patch passed  |
   | +1 :green_heart: |  compile  |   1m  6s |  the patch passed  |
   | +1 :green_heart: |  cc  |   1m  6s |  the patch passed  |
   | +1 :green_heart: |  javac  |   1m  6s |  the patch passed  |
   | -1 :x: |  checkstyle  |   3m 14s |  phoenix-core: The patch generated 76 
new + 10260 unchanged - 25 fixed = 10336 total (was 10285)  |
   | +1 :green_heart: |  prototool  |   0m  1s |  There were no new prototool 
issues.  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace 
issues.  |
   | +1 :green_heart: |  javadoc  |   0m 48s |  the patch passed  |
   | -1 :x: |  spotbugs  |   3m 30s |  phoenix-core generated 1 new + 944 
unchanged - 1 fixed = 945 total (was 945)  |
   ||| _ Other Tests _ |
   | +1 :green_heart: |  unit  | 195m 15s |  phoenix-core in the patch passed.  
|
   | +1 :green_heart: |  asflicense  |   0m 11s |  The patch does not generate 
ASF License warnings.  |
   |  |   | 241m  2s |   |
   
   
   | Reason | Tests |
   |---:|:--|
   | FindBugs | module:phoenix-core |
   |  |  org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SCHEMA_VERSION_BYTES 
is a mutable array  At MetaDataEndpointImpl.java: At 
MetaDataEndpointImpl.java:[line 344] |
   
   
   | 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-1216/1/artifact/yetus-general-check/output/Dockerfile
 |
   | GITHUB PR | https://github.com/apache/phoenix/pull/1216 |
   | Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti 
checkstyle compile cc prototool |
   | uname | Linux e090cf77c106 4.15.0-128-generic #131-Ubuntu SMP Wed Dec 9 
06:57:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev/phoenix-personality.sh |
   | git revision | 4.x / 282427d |
   | 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-1216/1/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt
 |
   | spotbugs | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1216/1/artifact/yetus-general-check/output/new-spotbugs-phoenix-core.html
 |
   |  Test Results | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1216/1/testReport/
 |
   | Max. process+thread count | 5076 (vs. ulimit of 3) |
   | modules | C: phoenix-core U: phoenix-core |
   | Console output | 
https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-1216/1/console
 |
   | versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 prototool=1.10.0-dev |
   | 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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  

[jira] [Commented] (PHOENIX-6457) Optionally store schema version string in SYSTEM.CATALOG

2021-04-30 Thread ASF GitHub Bot (Jira)


[ 
https://issues.apache.org/jira/browse/PHOENIX-6457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17337545#comment-17337545
 ] 

ASF GitHub Bot commented on PHOENIX-6457:
-

gjacoby126 opened a new pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216


   


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Optionally store schema version string in SYSTEM.CATALOG
> 
>
> Key: PHOENIX-6457
> URL: https://issues.apache.org/jira/browse/PHOENIX-6457
> Project: Phoenix
>  Issue Type: New Feature
>Reporter: Geoffrey Jacoby
>Assignee: Geoffrey Jacoby
>Priority: Major
> Fix For: 4.17.0, 5.2.0
>
>
> In many environments, schema changes to Phoenix tables are applied in batches 
> associated with a version of an application. (For example, v1.0 of an app may 
> start with one set of CREATE statements, v1.1 then adds some ALTER 
> statements, etc.) 
> It can be useful to be able to look up the latest app version in which a 
> table or view was changed; this could potentially be added as a feature of 
> the Schema Tool. 
> This change would add an optional property to CREATE and ALTER statements, 
> SCHEMA_VERSION, which would take a user-supplied string. 
> This is also a pre-req for PHOENIX-6227, because we would want to pass the 
> schema version string, if any, to an external schema repository in 
> environments where we're integrating with one. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)