lokeshj1703 commented on code in PR #12349:
URL: https://github.com/apache/hudi/pull/12349#discussion_r1861604188


##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/IndexCommands.scala:
##########
@@ -58,21 +61,60 @@ case class CreateIndexCommand(table: CatalogTable,
       if 
(indexType.equals(HoodieTableMetadataUtil.PARTITION_NAME_SECONDARY_INDEX)) {
         if ((metaClient.getTableConfig.getPayloadClass != null && 
!(metaClient.getTableConfig.getPayloadClass.equals(classOf[OverwriteWithLatestAvroPayload].getCanonicalName)))
           || (metaClient.getTableConfig.getRecordMergeMode ne 
RecordMergeMode.COMMIT_TIME_ORDERING)) {
-          throw new HoodieIOException("Secondary Index can only be enabled on 
table with OverwriteWithLatestAvroPayload payload class or " + "Merge mode set 
to OVERWRITE_WITH_LATEST")
+          throw new HoodieIndexException("Secondary Index can only be enabled 
on table with OverwriteWithLatestAvroPayload payload class or " + "Merge mode 
set to OVERWRITE_WITH_LATEST")
         }
       }
-      val extraOpts = options ++ table.properties
+      if 
(indexType.equals(HoodieTableMetadataUtil.PARTITION_NAME_COLUMN_STATS) &&
+        extraOpts.asJava.getOrDefault(EXPRESSION_OPTION, 
IDENTITY_FUNCTION).equals(IDENTITY_FUNCTION)) {
+        throw new HoodieIndexException("Currently Column stats Index can only 
be created with a non identity expression")
+      }

Review Comment:
   No, we do not get EXPRESSION_OPTION then. That case would fail.



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to