akkio-97 commented on a change in pull request #3869:
URL: https://github.com/apache/carbondata/pull/3869#discussion_r464318988
##########
File path:
index/secondary-index/src/test/scala/org/apache/carbondata/spark/testsuite/secondaryindex/TestCreateIndexTable.scala
##########
@@ -370,6 +370,38 @@ class TestCreateIndexTable extends QueryTest with
BeforeAndAfterAll {
}
}
+ test("index creation on long string columns") {
+ sql("drop table if exists si_table")
+ sql(
+ s"""
+ | CREATE TABLE si_table(
+ | id INT,
+ | name STRING,
+ | city STRING,
+ | salary FLOAT,
+ | tax DECIMAL(8,2),
+ | percent double,
+ | birthday DATE,
+ | register TIMESTAMP,
+ | updated TIMESTAMP,
+ | longstr STRING,
+ | file struct<school:array<string>, age:int>
+ | )
+ | STORED AS carbondata
+ | TBLPROPERTIES(
+ | 'LONG_STRING_COLUMNS'='longstr, name')
+ | """.stripMargin)
+ sql(
+ s"LOAD DATA LOCAL INPATH
'$resourcesPath/streamSample_with_long_string.csv' INTO TABLE si_table OPTIONS"
+
+ "('HEADER'='true','COMPLEX_DELIMITER_LEVEL_1'='$',
'COMPLEX_DELIMITER_LEVEL_2'=':')")
+
+ sql("drop index if exists temp_ind on si_table")
+ val thrown = intercept[Exception] {
+ sql("create index temp_ind on table si_table (longstr) AS 'carbondata'")
+ }
+ assert(thrown.getMessage === "one or more index columns specified cannot
be of Long String property column in table default.si_table")
Review comment:
done
----------------------------------------------------------------
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]