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 2020/10/03 04:04:40 UTC

[GitHub] [phoenix] yanxinyi opened a new pull request #908: PHOENIX-6172 Updating VIEW_INDEX_ID column type and ts in Syscat with…

yanxinyi opened a new pull request #908:
URL: https://github.com/apache/phoenix/pull/908


   … a 4.16 upgrade script


----------------------------------------------------------------
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 #908: PHOENIX-6172 Updating VIEW_INDEX_ID column type and ts in Syscat with…

Posted by GitBox <gi...@apache.org>.
stoty commented on pull request #908:
URL: https://github.com/apache/phoenix/pull/908#issuecomment-710744168


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   0m 47s |  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  |  37m 17s |  4.x passed  |
   | +1 :green_heart: |  compile  |   1m 13s |  4.x passed  |
   | +1 :green_heart: |  checkstyle  |   1m 47s |  4.x passed  |
   | +1 :green_heart: |  javadoc  |   0m 57s |  4.x passed  |
   | +0 :ok: |  spotbugs  |   3m 59s |  phoenix-core in 4.x has 956 extant spotbugs warnings.  |
   ||| _ Patch Compile Tests _ |
   | -1 :x: |  mvninstall  |   1m  7s |  root in the patch failed.  |
   | -1 :x: |  compile  |   0m 53s |  phoenix-core in the patch failed.  |
   | -1 :x: |  javac  |   0m 53s |  phoenix-core in the patch failed.  |
   | -1 :x: |  checkstyle  |   1m 51s |  phoenix-core: The patch generated 28 new + 3504 unchanged - 0 fixed = 3532 total (was 3504)  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace issues.  |
   | -1 :x: |  javadoc  |   0m 52s |  phoenix-core generated 2 new + 98 unchanged - 2 fixed = 100 total (was 100)  |
   | -1 :x: |  spotbugs  |   0m 51s |  phoenix-core in the patch failed.  |
   ||| _ Other Tests _ |
   | -1 :x: |  unit  |   0m 47s |  phoenix-core in the patch failed.  |
   | +1 :green_heart: |  asflicense  |   0m 11s |  The patch does not generate ASF License warnings.  |
   |  |   |  53m 30s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/4/artifact/yetus-general-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/phoenix/pull/908 |
   | Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile |
   | uname | Linux 2d0bb9087ef5 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 | 4.x / 2024b45 |
   | Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 |
   | mvninstall | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/4/artifact/yetus-general-check/output/patch-mvninstall-root.txt |
   | compile | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/4/artifact/yetus-general-check/output/patch-compile-phoenix-core.txt |
   | javac | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/4/artifact/yetus-general-check/output/patch-compile-phoenix-core.txt |
   | checkstyle | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/4/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt |
   | javadoc | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/4/artifact/yetus-general-check/output/diff-javadoc-javadoc-phoenix-core.txt |
   | spotbugs | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/4/artifact/yetus-general-check/output/patch-spotbugs-phoenix-core.txt |
   | unit | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/4/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt |
   |  Test Results | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/4/testReport/ |
   | Max. process+thread count | 95 (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-908/4/console |
   | versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 |
   | Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


----------------------------------------------------------------
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 #908: PHOENIX-6172 Updating VIEW_INDEX_ID column type and ts in Syscat with…

Posted by GitBox <gi...@apache.org>.
stoty commented on pull request #908:
URL: https://github.com/apache/phoenix/pull/908#issuecomment-709696508


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   5m 35s |  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  |  31m 45s |  4.x passed  |
   | +1 :green_heart: |  compile  |   1m  5s |  4.x passed  |
   | +1 :green_heart: |  checkstyle  |   1m 37s |  4.x passed  |
   | +1 :green_heart: |  javadoc  |   0m 48s |  4.x passed  |
   | +0 :ok: |  spotbugs  |   3m 14s |  phoenix-core in 4.x has 956 extant spotbugs warnings.  |
   ||| _ Patch Compile Tests _ |
   | -1 :x: |  mvninstall  |   1m  1s |  root in the patch failed.  |
   | -1 :x: |  compile  |   0m 50s |  phoenix-core in the patch failed.  |
   | -1 :x: |  javac  |   0m 50s |  phoenix-core in the patch failed.  |
   | -1 :x: |  checkstyle  |   1m 58s |  phoenix-core: The patch generated 28 new + 3504 unchanged - 0 fixed = 3532 total (was 3504)  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace issues.  |
   | -1 :x: |  javadoc  |   0m 50s |  phoenix-core generated 2 new + 98 unchanged - 2 fixed = 100 total (was 100)  |
   | -1 :x: |  spotbugs  |   0m 47s |  phoenix-core in the patch failed.  |
   ||| _ Other Tests _ |
   | -1 :x: |  unit  |   0m 49s |  phoenix-core in the patch failed.  |
   | +1 :green_heart: |  asflicense  |   0m 11s |  The patch does not generate ASF License warnings.  |
   |  |   |  51m 16s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/3/artifact/yetus-general-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/phoenix/pull/908 |
   | Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile |
   | uname | Linux 215fe94dfa07 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 | 4.x / 264310b |
   | Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 |
   | mvninstall | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/3/artifact/yetus-general-check/output/patch-mvninstall-root.txt |
   | compile | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/3/artifact/yetus-general-check/output/patch-compile-phoenix-core.txt |
   | javac | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/3/artifact/yetus-general-check/output/patch-compile-phoenix-core.txt |
   | checkstyle | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/3/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt |
   | javadoc | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/3/artifact/yetus-general-check/output/diff-javadoc-javadoc-phoenix-core.txt |
   | spotbugs | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/3/artifact/yetus-general-check/output/patch-spotbugs-phoenix-core.txt |
   | unit | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/3/artifact/yetus-general-check/output/patch-unit-phoenix-core.txt |
   |  Test Results | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/3/testReport/ |
   | Max. process+thread count | 94 (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-908/3/console |
   | versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 |
   | Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


----------------------------------------------------------------
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] ChinmaySKulkarni commented on a change in pull request #908: PHOENIX-6172 Updating VIEW_INDEX_ID column type and ts in Syscat with…

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



##########
File path: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -3678,6 +3679,34 @@ protected PhoenixConnection upgradeSystemCatalogIfRequired(PhoenixConnection met
                 MIN_SYSTEM_TABLE_TIMESTAMP_4_16_0,
                 PhoenixDatabaseMetaData.PHOENIX_TTL_HWM + " "
                         + PInteger.INSTANCE.getSqlTypeName());
+
+            boolean isNamespaceMapping =
+                    SchemaUtil.isNamespaceMappingEnabled(null,  getConfiguration());
+            String tableName = PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME;
+            if (isNamespaceMapping) {
+                tableName = tableName.replace(
+                        QueryConstants.NAME_SEPARATOR,
+                        QueryConstants.NAMESPACE_SEPARATOR);
+            }
+
+            byte[] rowKey = SchemaUtil.getColumnKey(null,
+                    QueryConstants.SYSTEM_SCHEMA_NAME,
+                    SYSTEM_CATALOG_TABLE, VIEW_INDEX_ID,
+                    PhoenixDatabaseMetaData.TABLE_FAMILY);
+            if (UpgradeUtil.isUpdateViewIndexIdColumnDataTypeFromShortToLongNeeded
+                    (metaConnection, rowKey, tableName.getBytes())) {
+                try {
+                    LOGGER.info("Updating VIEW_INDEX_ID data type to BIGINT.");
+                    UpgradeUtil.updateViewIndexIdColumnDataTypeFromShortToLong(
+                            metaConnection, rowKey, tableName.getBytes());
+                    LOGGER.info("Updated VIEW_INDEX_ID data type from SMALLINT TO BIGINT.");
+                } catch (Exception e) {
+                    LOGGER.error("Updating VIEW_INDEX_ID data type failed.");

Review comment:
       Or maybe that's not required since you're already catching the exception and logging it inside the updateViewIndexIdColumnDataTypeFromShortToLong() method. Can this method still throw then?




----------------------------------------------------------------
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] ChinmaySKulkarni commented on a change in pull request #908: PHOENIX-6172 Updating VIEW_INDEX_ID column type and ts in Syscat with…

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



##########
File path: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -3678,6 +3679,34 @@ protected PhoenixConnection upgradeSystemCatalogIfRequired(PhoenixConnection met
                 MIN_SYSTEM_TABLE_TIMESTAMP_4_16_0,
                 PhoenixDatabaseMetaData.PHOENIX_TTL_HWM + " "
                         + PInteger.INSTANCE.getSqlTypeName());
+
+            boolean isNamespaceMapping =
+                    SchemaUtil.isNamespaceMappingEnabled(null,  getConfiguration());
+            String tableName = PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME;
+            if (isNamespaceMapping) {
+                tableName = tableName.replace(
+                        QueryConstants.NAME_SEPARATOR,
+                        QueryConstants.NAMESPACE_SEPARATOR);
+            }
+
+            byte[] rowKey = SchemaUtil.getColumnKey(null,
+                    QueryConstants.SYSTEM_SCHEMA_NAME,
+                    SYSTEM_CATALOG_TABLE, VIEW_INDEX_ID,
+                    PhoenixDatabaseMetaData.TABLE_FAMILY);
+            if (UpgradeUtil.isUpdateViewIndexIdColumnDataTypeFromShortToLongNeeded
+                    (metaConnection, rowKey, tableName.getBytes())) {
+                try {
+                    LOGGER.info("Updating VIEW_INDEX_ID data type to BIGINT.");
+                    UpgradeUtil.updateViewIndexIdColumnDataTypeFromShortToLong(
+                            metaConnection, rowKey, tableName.getBytes());
+                    LOGGER.info("Updated VIEW_INDEX_ID data type from SMALLINT TO BIGINT.");
+                } catch (Exception e) {
+                    LOGGER.error("Updating VIEW_INDEX_ID data type failed.");

Review comment:
       Change to : `LOGGER.error(" ... ", e)` so we see the actual error too

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -3678,6 +3679,34 @@ protected PhoenixConnection upgradeSystemCatalogIfRequired(PhoenixConnection met
                 MIN_SYSTEM_TABLE_TIMESTAMP_4_16_0,
                 PhoenixDatabaseMetaData.PHOENIX_TTL_HWM + " "
                         + PInteger.INSTANCE.getSqlTypeName());
+
+            boolean isNamespaceMapping =
+                    SchemaUtil.isNamespaceMappingEnabled(null,  getConfiguration());
+            String tableName = PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME;
+            if (isNamespaceMapping) {
+                tableName = tableName.replace(
+                        QueryConstants.NAME_SEPARATOR,
+                        QueryConstants.NAMESPACE_SEPARATOR);
+            }
+
+            byte[] rowKey = SchemaUtil.getColumnKey(null,
+                    QueryConstants.SYSTEM_SCHEMA_NAME,
+                    SYSTEM_CATALOG_TABLE, VIEW_INDEX_ID,
+                    PhoenixDatabaseMetaData.TABLE_FAMILY);
+            if (UpgradeUtil.isUpdateViewIndexIdColumnDataTypeFromShortToLongNeeded
+                    (metaConnection, rowKey, tableName.getBytes())) {
+                try {
+                    LOGGER.info("Updating VIEW_INDEX_ID data type to BIGINT.");
+                    UpgradeUtil.updateViewIndexIdColumnDataTypeFromShortToLong(
+                            metaConnection, rowKey, tableName.getBytes());
+                    LOGGER.info("Updated VIEW_INDEX_ID data type from SMALLINT TO BIGINT.");
+                } catch (Exception e) {
+                    LOGGER.error("Updating VIEW_INDEX_ID data type failed.");
+

Review comment:
       nit: Remove extra new line




----------------------------------------------------------------
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 #908: PHOENIX-6172 Updating VIEW_INDEX_ID column type and ts in Syscat with…

Posted by GitBox <gi...@apache.org>.
stoty commented on pull request #908:
URL: https://github.com/apache/phoenix/pull/908#issuecomment-709681745


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   0m 30s |  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  |  26m  6s |  4.x passed  |
   | +1 :green_heart: |  compile  |   0m 55s |  4.x passed  |
   | +1 :green_heart: |  checkstyle  |   1m 48s |  4.x passed  |
   | +1 :green_heart: |  javadoc  |   0m 43s |  4.x passed  |
   | +0 :ok: |  spotbugs  |   2m 59s |  phoenix-core in 4.x has 956 extant spotbugs warnings.  |
   ||| _ Patch Compile Tests _ |
   | -1 :x: |  mvninstall  |   0m 52s |  root in the patch failed.  |
   | -1 :x: |  compile  |   0m 43s |  phoenix-core in the patch failed.  |
   | -1 :x: |  javac  |   0m 43s |  phoenix-core in the patch failed.  |
   | -1 :x: |  checkstyle  |   1m 44s |  phoenix-core: The patch generated 26 new + 3504 unchanged - 0 fixed = 3530 total (was 3504)  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace issues.  |
   | -1 :x: |  javadoc  |   0m 45s |  phoenix-core generated 2 new + 98 unchanged - 2 fixed = 100 total (was 100)  |
   | -1 :x: |  spotbugs  |   0m 42s |  phoenix-core in the patch failed.  |
   ||| _ Other Tests _ |
   | -1 :x: |  unit  |   0m 43s |  phoenix-core in the patch failed.  |
   | +1 :green_heart: |  asflicense  |   0m  9s |  The patch does not generate ASF License warnings.  |
   |  |   |  39m 26s |   |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/2/artifact/yetus-general-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/phoenix/pull/908 |
   | Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile |
   | uname | Linux 5007952cc97b 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev/phoenix-personality.sh |
   | git revision | 4.x / 264310b |
   | Default Java | Private Build-1.8.0_242-8u242-b08-0ubuntu3~16.04-b08 |
   | mvninstall | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/2/artifact/yetus-general-check/output/patch-mvninstall-root.txt |
   | compile | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/2/artifact/yetus-general-check/output/patch-compile-phoenix-core.txt |
   | javac | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/2/artifact/yetus-general-check/output/patch-compile-phoenix-core.txt |
   | checkstyle | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/2/artifact/yetus-general-check/output/diff-checkstyle-phoenix-core.txt |
   | javadoc | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/2/artifact/yetus-general-check/output/diff-javadoc-javadoc-phoenix-core.txt |
   | spotbugs | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/2/artifact/yetus-general-check/output/patch-spotbugs-phoenix-core.txt |
   | unit | https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/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-908/2/testReport/ |
   | Max. process+thread count | 94 (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-908/2/console |
   | versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 |
   | Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


----------------------------------------------------------------
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 #908: PHOENIX-6172 Updating VIEW_INDEX_ID column type and ts in Syscat with…

Posted by GitBox <gi...@apache.org>.
stoty commented on pull request #908:
URL: https://github.com/apache/phoenix/pull/908#issuecomment-703057600


   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime | Comment |
   |:----:|----------:|--------:|:--------|
   | +0 :ok: |  reexec  |   0m 32s |  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  |   9m  5s |  4.x passed  |
   | +1 :green_heart: |  compile  |   1m  1s |  4.x passed  |
   | +1 :green_heart: |  checkstyle  |   1m 50s |  4.x passed  |
   | +1 :green_heart: |  javadoc  |   0m 46s |  4.x passed  |
   | +0 :ok: |  spotbugs  |   3m 25s |  phoenix-core in 4.x has 957 extant spotbugs warnings.  |
   ||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   5m  6s |  the patch passed  |
   | +1 :green_heart: |  compile  |   0m 59s |  the patch passed  |
   | +1 :green_heart: |  javac  |   0m 59s |  the patch passed  |
   | -1 :x: |  checkstyle  |   1m 56s |  phoenix-core: The patch generated 12 new + 3504 unchanged - 0 fixed = 3516 total (was 3504)  |
   | +1 :green_heart: |  whitespace  |   0m  0s |  The patch has no whitespace issues.  |
   | +1 :green_heart: |  javadoc  |   0m 45s |  the patch passed  |
   | -1 :x: |  spotbugs  |   3m 28s |  phoenix-core generated 1 new + 957 unchanged - 0 fixed = 958 total (was 957)  |
   ||| _ Other Tests _ |
   | -1 :x: |  unit  | 136m 37s |  phoenix-core in the patch failed.  |
   | +1 :green_heart: |  asflicense  |   0m 38s |  The patch does not generate ASF License warnings.  |
   |  |   | 169m  0s |   |
   
   
   | Reason | Tests |
   |-------:|:------|
   | FindBugs | module:phoenix-core |
   |  |  Found reliance on default encoding in org.apache.phoenix.util.UpgradeUtil.updateViewIndexIdColumnDataTypeFromShortToLongIfNeeds(PhoenixConnection, HBaseAdmin):in org.apache.phoenix.util.UpgradeUtil.updateViewIndexIdColumnDataTypeFromShortToLongIfNeeds(PhoenixConnection, HBaseAdmin): String.getBytes()  At UpgradeUtil.java:[line 2267] |
   | Failed junit tests | phoenix.end2end.join.HashJoinGlobalIndexIT |
   |   | phoenix.end2end.index.MutableIndexSplitReverseScanIT |
   |   | phoenix.end2end.index.IndexMaintenanceIT |
   |   | phoenix.end2end.BackwardCompatibilityIT |
   |   | phoenix.end2end.IndexToolTimeRangeIT |
   |   | phoenix.end2end.DerivedTableIT |
   |   | phoenix.end2end.index.GlobalMutableNonTxIndexWithLazyPostBatchWriteIT |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.40 ServerAPI=1.40 base: https://ci-hadoop.apache.org/job/Phoenix/job/Phoenix-PreCommit-GitHub-PR/job/PR-908/1/artifact/yetus-general-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/phoenix/pull/908 |
   | Optional Tests | dupname asflicense javac javadoc unit spotbugs hbaseanti checkstyle compile |
   | uname | Linux 8a8efb6d87f9 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 | 4.x / 3ccf9a0 |
   | 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-908/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-908/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-908/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-908/1/testReport/ |
   | Max. process+thread count | 7096 (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-908/1/console |
   | versions | git=2.7.4 maven=3.3.9 spotbugs=4.1.3 |
   | Powered by | Apache Yetus 0.12.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


----------------------------------------------------------------
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] virajjasani commented on a change in pull request #908: PHOENIX-6172 Updating VIEW_INDEX_ID column type and ts in Syscat with…

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



##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/UpgradeUtil.java
##########
@@ -2252,6 +2255,36 @@ public static void upgradeTable(PhoenixConnection conn, String srcTable) throws
         }
     }
 
+    public static boolean updateViewIndexIdColumnDataTypeFromShortToLongIfNeeds(
+            PhoenixConnection metaConnection, HBaseAdmin admin) {
+        try {
+            String tableName = PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME;
+            if (!admin.tableExists(tableName)) {
+                tableName = tableName.replace(
+                        QueryConstants.NAME_SEPARATOR,
+                        QueryConstants.NAMESPACE_SEPARATOR);
+            }
+            try(Table sysTable = metaConnection.getQueryServices().getTable(tableName.getBytes())) {
+                byte[] rowKey =
+                        SchemaUtil.getColumnKey(null, SYSTEM_SCHEMA_NAME, SYSTEM_CATALOG_TABLE,
+                                VIEW_INDEX_ID, PhoenixDatabaseMetaData.TABLE_FAMILY);
+                KeyValue viewIndexIdKV = KeyValueUtil.newKeyValue(rowKey,
+                        PhoenixDatabaseMetaData.TABLE_FAMILY_BYTES,
+                        PhoenixDatabaseMetaData.DATA_TYPE_BYTES,
+                        MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP,
+                        PInteger.INSTANCE.toBytes(Types.BIGINT));
+                Put viewIndexIdPut = new Put(rowKey);
+                viewIndexIdPut.add(viewIndexIdKV);
+                sysTable.put(viewIndexIdPut);
+            }
+            return true;
+        } catch (Exception e) {
+            LOGGER.error("Upgrade/change VIEW_INDEX_ID data type failed: " + e.getMessage() +
+                    ". Full stacktrace: " + ExceptionUtils.getFullStackTrace(e));

Review comment:
       nit: we can use placeholders `{}` for arguments?

##########
File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
##########
@@ -672,4 +689,61 @@ private SequenceKey createViewIndexSequenceWithOldName(ConnectionQueryServices c
         return key;
     }
 
+    @Test
+    public void testUpgradeViewIndexIdDataType() throws Exception {
+        byte[] rowKey = SchemaUtil.getColumnKey(null,
+                SYSTEM_SCHEMA_NAME, SYSTEM_CATALOG_TABLE, VIEW_INDEX_ID,
+                PhoenixDatabaseMetaData.TABLE_FAMILY);
+        byte[] syscatBytes = PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME.getBytes();
+        byte[] viewIndexIdTypeCellValueIn414 = PInteger.INSTANCE.toBytes(Types.SMALLINT);
+        byte[] viewIndexIdTypeCellValueIn416 = PInteger.INSTANCE.toBytes(Types.BIGINT);
+
+        // update the VIEW_INDEX_ID 0:DATAT_TYPE cell value to SMALLINT

Review comment:
       nit: you mean `BIGINT` at the last?




----------------------------------------------------------------
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] ChinmaySKulkarni commented on a change in pull request #908: PHOENIX-6172 Updating VIEW_INDEX_ID column type and ts in Syscat with…

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



##########
File path: phoenix-core/src/it/java/org/apache/phoenix/end2end/UpgradeIT.java
##########
@@ -672,4 +689,61 @@ private SequenceKey createViewIndexSequenceWithOldName(ConnectionQueryServices c
         return key;
     }
 
+    @Test
+    public void testUpgradeViewIndexIdDataType() throws Exception {
+        byte[] rowKey = SchemaUtil.getColumnKey(null,
+                SYSTEM_SCHEMA_NAME, SYSTEM_CATALOG_TABLE, VIEW_INDEX_ID,
+                PhoenixDatabaseMetaData.TABLE_FAMILY);
+        byte[] syscatBytes = PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME.getBytes();
+        byte[] viewIndexIdTypeCellValueIn414 = PInteger.INSTANCE.toBytes(Types.SMALLINT);
+        byte[] viewIndexIdTypeCellValueIn416 = PInteger.INSTANCE.toBytes(Types.BIGINT);
+
+        // update the VIEW_INDEX_ID 0:DATAT_TYPE cell value to SMALLINT
+        // (4.14 and prior version is a SMALLINT column)
+        updateViewIndexIdColumnValue(rowKey, syscatBytes, viewIndexIdTypeCellValueIn414);

Review comment:
       If something fails after this modification of SYSTEM.CATALOG and for some reason the upgrade part doesn't run, the rest of this IT will work with a SYSTEM.CATALOG that has some modification in it right? Can we have some `finally' block to make sure there are no such changes?

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/UpgradeUtil.java
##########
@@ -2252,6 +2255,36 @@ public static void upgradeTable(PhoenixConnection conn, String srcTable) throws
         }
     }
 
+    public static boolean updateViewIndexIdColumnDataTypeFromShortToLongIfNeeds(

Review comment:
       nit: `IfNeeded`

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/UpgradeUtil.java
##########
@@ -2252,6 +2255,36 @@ public static void upgradeTable(PhoenixConnection conn, String srcTable) throws
         }
     }
 
+    public static boolean updateViewIndexIdColumnDataTypeFromShortToLongIfNeeds(
+            PhoenixConnection metaConnection, HBaseAdmin admin) {

Review comment:
       Maybe we should return true if an update was required, false if not required and in case it throw, we can catch and log the exception in the caller?

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/UpgradeUtil.java
##########
@@ -2252,6 +2255,36 @@ public static void upgradeTable(PhoenixConnection conn, String srcTable) throws
         }
     }
 
+    public static boolean updateViewIndexIdColumnDataTypeFromShortToLongIfNeeds(
+            PhoenixConnection metaConnection, HBaseAdmin admin) {
+        try {
+            String tableName = PhoenixDatabaseMetaData.SYSTEM_CATALOG_NAME;
+            if (!admin.tableExists(tableName)) {
+                tableName = tableName.replace(
+                        QueryConstants.NAME_SEPARATOR,
+                        QueryConstants.NAMESPACE_SEPARATOR);
+            }
+            try(Table sysTable = metaConnection.getQueryServices().getTable(tableName.getBytes())) {
+                byte[] rowKey =
+                        SchemaUtil.getColumnKey(null, SYSTEM_SCHEMA_NAME, SYSTEM_CATALOG_TABLE,
+                                VIEW_INDEX_ID, PhoenixDatabaseMetaData.TABLE_FAMILY);
+                KeyValue viewIndexIdKV = KeyValueUtil.newKeyValue(rowKey,

Review comment:
       We should avoid this Put (will be a no-op) if the view_index_id is already BIGINT right? 




----------------------------------------------------------------
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] yanxinyi closed pull request #908: PHOENIX-6172 Updating VIEW_INDEX_ID column type and ts in Syscat with…

Posted by GitBox <gi...@apache.org>.
yanxinyi closed pull request #908:
URL: https://github.com/apache/phoenix/pull/908


   


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