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

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

virajjasani commented on code in PR #1737:
URL: https://github.com/apache/phoenix/pull/1737#discussion_r1401264578


##########
phoenix-core/src/main/java/org/apache/phoenix/iterate/ExplainTable.java:
##########
@@ -147,7 +148,20 @@ protected void explain(String prefix,
             scanTypeDetails = explainSkipScan();
         }
         buf.append(scanTypeDetails);
-        buf.append("OVER 
").append(tableRef.getTable().getPhysicalName().getString());
+
+        String tableName = tableRef.getTable().getPhysicalName().getString();
+        if (ScanUtil.isLocalIndex(scan)) {

Review Comment:
   Rather than `ScanUtil#isLocalIndex`, we should check PTable index type:
   ```
       @Override
       public IndexType getIndexType() {
           return indexType;
       }
   ```





> Explain plan to output local index name if it is used
> -----------------------------------------------------
>
>                 Key: PHOENIX-7101
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-7101
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 5.1.3
>            Reporter: Viraj Jasani
>            Assignee: Jing Yu
>            Priority: Major
>             Fix For: 5.2.0, 5.1.4
>
>
> When we create local index on the table, we use different column family to 
> store the index data. When we use Explain plan for any query that uses local 
> index, since the hbase table name remains same for the local index, we only 
> output that table name. To provide more clarity, we should output local index 
> name in the Explain plan output if the local index is to be used.
> When local index is used, we should output in the format 
> "${local_index}(${physical_table_name})" instead of "${physical_table_name}".



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to