richardantal commented on a change in pull request #1321:
URL: https://github.com/apache/phoenix/pull/1321#discussion_r714669709



##########
File path: 
phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
##########
@@ -1641,9 +1641,6 @@ public MutationState createIndex(CreateIndexStatement 
statement, byte[][] splits
                     String columnFamilyName = column.getFamilyName()!=null ? 
column.getFamilyName().getString() : null;
                     colName = 
ColumnName.caseSensitiveColumnName(IndexUtil.getIndexColumnName(columnFamilyName,
 column.getName().getString()));
                     isRowTimestamp = column.isRowTimestamp();
-                    if (colRef.getColumn().getExpressionStr() != null) {
-                        expressionStr = colRef.getColumn().getExpressionStr();

Review comment:
       getExpressionStr() != null means we have a default value set for the 
column.
   We use this expressionStr to generate the indexExpressions later. 
https://github.com/apache/phoenix/blob/8c68fe435d0cc7d8bc69ccb05bc6536ba5647113/phoenix-core/src/main/java/org/apache/phoenix/index/IndexMaintainer.java#L504-L506
   In case of a column that has default value, lets say 0 a LiteralExpression 
was created and it always returned 0. (instead of DefaultValueExpression)
   Because of this, in the index we wrote the default value always.




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