stoty commented on a change in pull request #1364:
URL: https://github.com/apache/phoenix/pull/1364#discussion_r766389685



##########
File path: 
phoenix-core/src/main/java/org/apache/phoenix/schema/tool/SchemaExtractionProcessor.java
##########
@@ -135,8 +135,8 @@ private String getIndexedColumnsString(PTable indexPTable, 
PTable dataPTable, St
         StringBuilder indexedColumnsBuilder = new StringBuilder();
 
         for (PColumn indexedColumn : indexPK) {
-            String indexColumn = 
extractIndexColumn(indexedColumn.getName().getString(), defaultCF);
-            
if(indexColumn.equalsIgnoreCase(MetaDataUtil.VIEW_INDEX_ID_COLUMN_NAME)) {
+            String indexColumn = 
extractIndexColumn(indexedColumn.getExpressionStr(), defaultCF);
+            if(indexColumn == null || 
indexColumn.equalsIgnoreCase(MetaDataUtil.VIEW_INDEX_ID_COLUMN_NAME)) {

Review comment:
       In what case do we get a null  here ?

##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
##########
@@ -1301,6 +1301,29 @@ public static String formatColumnName(String name) {
         return name;
     }
 
+    public static String formatIndexColumnName(String name) {
+        String[] splittedName = name.split("\\.");

Review comment:
       nit: split is an irregular verb, so this should be splitName

##########
File path: 
phoenix-core/src/main/java/org/apache/phoenix/schema/tool/SchemaExtractionProcessor.java
##########
@@ -135,8 +135,8 @@ private String getIndexedColumnsString(PTable indexPTable, 
PTable dataPTable, St
         StringBuilder indexedColumnsBuilder = new StringBuilder();
 
         for (PColumn indexedColumn : indexPK) {
-            String indexColumn = 
extractIndexColumn(indexedColumn.getName().getString(), defaultCF);
-            
if(indexColumn.equalsIgnoreCase(MetaDataUtil.VIEW_INDEX_ID_COLUMN_NAME)) {
+            String indexColumn = 
extractIndexColumn(indexedColumn.getExpressionStr(), defaultCF);

Review comment:
       so indexedColumn.getExpressionStr() will return the colum name for 
"simple" indexes ?
   




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