You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2021/04/30 17:38:54 UTC

[GitHub] [phoenix] gjacoby126 opened a new pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

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:
users@infra.apache.org



[GitHub] [phoenix] stoty commented on pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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 30000) |
   | 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:
users@infra.apache.org



[GitHub] [phoenix] gjacoby126 commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [phoenix] gjacoby126 commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.MIN_VALUE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.MULTI_TENANT;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.NO_OF_RESULTS_ITERATED;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.NULLABLE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.NUM_ARGS;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.NUM_PREC_RADIX;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.ORDINAL_POSITION;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.PHOENIX_TTL;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.PHOENIX_TTL_HWM;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.PHYSICAL_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.PHYSICAL_TABLE_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.PK_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.QUERY;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.QUERY_ID;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.QUERY_STATUS;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.REF_GENERATION;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.REMARKS;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.RETURN_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SALT_BUCKETS;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SCAN_METRICS_JSON;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SCOPE_CATALOG;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SCOPE_SCHEMA;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SCOPE_TABLE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SELF_REFERENCING_COL_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SEQUENCE_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SEQUENCE_SCHEMA;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SORT_ORDER;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SOURCE_DATA_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SQL_DATA_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SQL_DATETIME_SUB;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.START_TIME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.START_WITH;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.STORE_NULLS;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_SCHEMA;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_TABLE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CHILD_LINK_TABLE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_FUNCTION_TABLE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_LOG_TABLE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_MUTEX_TABLE_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_STATS_TABLE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_TASK_TABLE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_SCHEM;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_SEQ_NUM;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TASK_DATA;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TASK_END_TS;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TASK_PRIORITY;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TASK_STATUS;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TASK_TABLE_TTL;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TASK_TS;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TASK_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TENANT_ID;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TRANSACTIONAL;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TRANSACTION_PROVIDER;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TTL_FOR_MUTEX;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TYPE_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TYPE_SEQUENCE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.UPDATE_CACHE_FREQUENCY;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.USER;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.USE_STATS_FOR_PARALLELIZATION;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.VIEW_CONSTANT;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.VIEW_INDEX_ID;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.VIEW_INDEX_ID_DATA_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.VIEW_STATEMENT;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.VIEW_TYPE;
+import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.*;

Review comment:
       Oops, thought I'd fixed all those before pushing. Fixed and repushed. 




-- 
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:
users@infra.apache.org



[GitHub] [phoenix] swaroopak commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [phoenix] gjacoby126 commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
gjacoby126 commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r626169950



##########
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:
       I disagree that schema version should auto-increment. First, because an auto-incrementing int sequence already exists (see PTable.getSequenceNumber, which gets incremented by DDL statements), and second, because that's not really what this feature is meant to do.
   
   The purpose of SCHEMA_VERSION is that it's a string which is relevant to a particular client application or applications and its release numbering. 
   
   Say application Foo has quarterly releases "Q1-2021", "Q1-2021.1", "Q2-2021", and so on. It creates tables A, B, and C as part of Q1-2021, makes a table property change to table B during Q1-2021.1, and then adds 2 more tables D and E and 1 column to an existing table C in Q2-2021. 
   
   At this point the schema versions are:
   A: Q1-2021
   B: Q1-2021.1
   C: Q2-2021 (assuming there was a separate statement to update schema version after adding the column)
   D: Q2-2021
   E: Q2-2021
   
   From this, the application Foo can check for each table that its schema version is the version that it expects (or not) and take action accordingly. An application running Q1-2021 can still interpret queries / messages against Table A, but might want to reject ones from tables B through E, because they're from newer schemas that it has no knowledge of. 




-- 
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:
users@infra.apache.org



[GitHub] [phoenix] stoty commented on pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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 30000) |
   | 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:
users@infra.apache.org



[GitHub] [phoenix] gokceni commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [phoenix] swaroopak commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [phoenix] gjacoby126 commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [phoenix] swaroopak commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.MIN_VALUE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.MULTI_TENANT;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.NO_OF_RESULTS_ITERATED;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.NULLABLE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.NUM_ARGS;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.NUM_PREC_RADIX;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.ORDINAL_POSITION;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.PHOENIX_TTL;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.PHOENIX_TTL_HWM;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.PHYSICAL_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.PHYSICAL_TABLE_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.PK_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.QUERY;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.QUERY_ID;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.QUERY_STATUS;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.REF_GENERATION;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.REMARKS;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.RETURN_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SALT_BUCKETS;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SCAN_METRICS_JSON;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SCOPE_CATALOG;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SCOPE_SCHEMA;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SCOPE_TABLE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SELF_REFERENCING_COL_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SEQUENCE_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SEQUENCE_SCHEMA;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SORT_ORDER;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SOURCE_DATA_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SQL_DATA_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SQL_DATETIME_SUB;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.START_TIME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.START_WITH;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.STORE_NULLS;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_SCHEMA;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CATALOG_TABLE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_CHILD_LINK_TABLE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_FUNCTION_TABLE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_LOG_TABLE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_MUTEX_TABLE_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_STATS_TABLE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.SYSTEM_TASK_TABLE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_SCHEM;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_SEQ_NUM;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TABLE_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TASK_DATA;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TASK_END_TS;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TASK_PRIORITY;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TASK_STATUS;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TASK_TABLE_TTL;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TASK_TS;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TASK_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TENANT_ID;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TRANSACTIONAL;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TRANSACTION_PROVIDER;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TTL_FOR_MUTEX;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TYPE_NAME;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.TYPE_SEQUENCE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.UPDATE_CACHE_FREQUENCY;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.USER;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.USE_STATS_FOR_PARALLELIZATION;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.VIEW_CONSTANT;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.VIEW_INDEX_ID;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.VIEW_INDEX_ID_DATA_TYPE;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.VIEW_STATEMENT;
-import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.VIEW_TYPE;
+import static org.apache.phoenix.jdbc.PhoenixDatabaseMetaData.*;

Review comment:
       nit: unnecessary 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:
users@infra.apache.org



[GitHub] [phoenix] gjacoby126 commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
gjacoby126 commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r626164437



##########
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:
       Phoenix won't really "use" a schema version at all during a select. To be precise, when it grabs the PTable to be able to interpret the query results, the schema version will be in the PTable, but it's not really used by the query logic. 
   
   The point of schema version is to allow:
   1. Applications to check to see if a table, view or index is compatible with a particular version of their schema 
   2. In the future, when we have change streaming from Phoenix, messages will be annotated with the schema version so consumers of the message will be able to check to see if they can interpret the message (i.e, it's compatible with a particular version of a consuming application) or not. 




-- 
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:
users@infra.apache.org



[GitHub] [phoenix] gjacoby126 commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [phoenix] gjacoby126 commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [phoenix] swaroopak commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [phoenix] gokceni commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
gokceni commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r626782919



##########
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:
       Thanks for the explanation. This makes sense




-- 
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:
users@infra.apache.org



[GitHub] [phoenix] gjacoby126 commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
gjacoby126 commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r626170402



##########
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:
       As @swaroopak points out, it's a pain to have to do the extra ALTER TABLE SET SCHEMA_VERSION statement after doing an add/drop column, so it would be nice if we could update this property as part of doing the add or drop. I'll see if I can figure out the cause of why the existing restriction is there, and if it can be easily set aside. 




-- 
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:
users@infra.apache.org



[GitHub] [phoenix] gjacoby126 merged pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
gjacoby126 merged 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:
users@infra.apache.org



[GitHub] [phoenix] swaroopak commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [phoenix] gjacoby126 commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [phoenix] swaroopak commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [phoenix] gjacoby126 commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [phoenix] swaroopak commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [phoenix] gjacoby126 commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [phoenix] gokceni commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



[GitHub] [phoenix] gjacoby126 commented on a change in pull request #1216: PHOENIX-6457 - Optionally store schema version string in SYSTEM.CATALOG

Posted by GitBox <gi...@apache.org>.
gjacoby126 commented on a change in pull request #1216:
URL: https://github.com/apache/phoenix/pull/1216#discussion_r626170402



##########
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:
       As @swaroopak points out, it's a pain to have to do the extra ALTER TABLE SET SCHEMA_VERSION statement after doing an add/drop column, so it would be nice if we could update this property as part of doing the add or drop column. I'll see if I can figure out the cause of why the existing restriction is there, and if it can be easily set aside. 




-- 
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:
users@infra.apache.org