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



##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/IndexUtil.java
##########
@@ -576,20 +597,27 @@ public static void wrapResultUsingOffset(final 
RegionCoprocessorEnvironment envi
                 }
             }
             Result joinResult = null;
-            if (dataRegion != null) {
-                joinResult = dataRegion.get(get);
-            } else {
-                TableName dataTable =
-                    
TableName.valueOf(MetaDataUtil.getLocalIndexUserTableName(environment.getRegion().
-                        
getTableDescriptor().getTableName().getNameAsString()));
-                Table table = null;
-                try {
-                    table = environment.getConnection().getTable(dataTable);
+            if (ScanUtil.isLocalIndex(scan)) {
+                if (dataRegion != null) {
+                    joinResult = dataRegion.get(get);
+                } else {
+                    TableName dataTable =
+                            
TableName.valueOf(MetaDataUtil.getLocalIndexUserTableName(
+                                    
environment.getRegion().getTableDescriptor().getTableName().
+                                            getNameAsString()));
+                    try (Table table = 
environment.getConnection().getTable(dataTable)) {
+                        joinResult = table.get(get);
+                    }
+                }
+            } else if (ScanUtil.isUncoveredGlobalIndex(scan)) {
+                byte[] dataTableName = 
scan.getAttribute(PHYSICAL_DATA_TABLE_NAME);

Review comment:
       This code reminded me a test case where we have separate physical and 
logical table names for (case1. data table and case2. index table). I was just 
asking to make sure that we are not breaking anything.
   Something like this: 
   You have an index hint for a global index which has a different physical 
table name (logical name appears in the hint but its PHYSICAL_TABLE_NAME in 
syscat points to different hbase table). I think your code doesn't break this 
case but I wanted to make sure. Does this make 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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to