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

ASF GitHub Bot commented on PHOENIX-6172:
-----------------------------------------

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


> Updating VIEW_INDEX_ID column type and ts in Syscat with a 4.16 upgrade 
> script 
> -------------------------------------------------------------------------------
>
>                 Key: PHOENIX-6172
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6172
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 4.15.0
>            Reporter: Xinyi Yan
>            Priority: Major
>             Fix For: 4.16.0
>
>
> Updating VIEW_INDEX_ID column type and ts in Syscat with a 4.16 upgrade 
> script by using HBase put. Making sure the HBase row ts reflects the 4.16 
> version.



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

Reply via email to