kadirozde commented on a change in pull request #1158:
URL: https://github.com/apache/phoenix/pull/1158#discussion_r586883036



##########
File path: 
phoenix-core/src/main/java/org/apache/phoenix/compile/WhereCompiler.java
##########
@@ -200,6 +201,15 @@ protected ColumnRef resolveColumn(ColumnParseNode node) 
throws SQLException {
                 return ref;
             }
             PTable table = ref.getTable();
+            // If current table in the context is local index and table in 
column reference is global that
+            // means the column is not present in the local index. Local 
indexes do not currently support this,
+            // so we need skip this plan.
+            if (context.getCurrentTable().getTable().getIndexType() == 
IndexType.LOCAL
+                    && (table.getIndexType() == null || table.getIndexType() 
== IndexType.GLOBAL)) {
+                String schemaNameStr = 
table.getSchemaName()==null?null:table.getSchemaName().getString();
+                String tableNameStr = 
table.getTableName()==null?null:table.getTableName().getString();
+                throw new ColumnNotFoundException(schemaNameStr, tableNameStr, 
null, ref.getColumn().getName().getString());

Review comment:
       It is not clear how returning ColumnNotFoundException results in 
skipping a plan. Can we add some comments here for 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:
[email protected]


Reply via email to