lokeshj1703 commented on code in PR #12266:
URL: https://github.com/apache/hudi/pull/12266#discussion_r1844990668
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/command/index/TestSecondaryIndex.scala:
##########
@@ -80,40 +83,46 @@ class TestSecondaryIndex extends HoodieSparkSqlTestBase {
spark.sql(s"insert into $tableName values(3, 'a3', 10, 1002)")
checkAnswer(s"show indexes from default.$tableName")()
- checkAnswer(s"create index idx_name on $tableName using lucene
(name) options(block_size=1024)")()
- checkAnswer(s"create index idx_price on $tableName using lucene
(price options(order='desc')) options(block_size=512)")()
-
- // Create an index with multiple columns
- checkException(s"create index idx_id_ts on $tableName using lucene
(id, ts)")("Lucene index only support single column")
+ spark.sql(s"create index idx_name on $tableName using
secondary_index(name)")
+ checkAnswer(s"show indexes from default.$tableName")(
+ Seq("secondary_index_idx_name", "secondary_index", "name")
+ )
+ spark.sql(s"create index idx_price on $tableName using
secondary_index(price)")
// Create an index with the occupied name
- checkException(s"create index idx_price on $tableName using lucene
(price)")(
Review Comment:
Yes,
https://github.com/lokeshj1703/hudi/blob/3f39283ce8401977bf48ec87e277b33d5c649271/hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/IndexCommands.scala#L58
handles it
##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/command/index/TestSecondaryIndex.scala:
##########
@@ -80,40 +83,46 @@ class TestSecondaryIndex extends HoodieSparkSqlTestBase {
spark.sql(s"insert into $tableName values(3, 'a3', 10, 1002)")
checkAnswer(s"show indexes from default.$tableName")()
- checkAnswer(s"create index idx_name on $tableName using lucene
(name) options(block_size=1024)")()
- checkAnswer(s"create index idx_price on $tableName using lucene
(price options(order='desc')) options(block_size=512)")()
-
- // Create an index with multiple columns
- checkException(s"create index idx_id_ts on $tableName using lucene
(id, ts)")("Lucene index only support single column")
+ spark.sql(s"create index idx_name on $tableName using
secondary_index(name)")
+ checkAnswer(s"show indexes from default.$tableName")(
Review Comment:
Addressed
--
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]