This is an automated email from the ASF dual-hosted git repository.
indhumuthumurugesh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/carbondata.git
The following commit(s) were added to refs/heads/master by this push:
new bdd4a8c [CARBONDATA-4256] Fixed parsing failure on SI creation for
complex column
bdd4a8c is described below
commit bdd4a8cb5599062c066b5318ff5ce0488eb6b290
Author: Nihal ojha <[email protected]>
AuthorDate: Thu Jul 29 15:49:59 2021 +0530
[CARBONDATA-4256] Fixed parsing failure on SI creation for complex column
Why is this PR needed?
Currently, SI creation on a complex column that includes child column
with a dot(.) fails with parse exception.
What changes were proposed in this PR?
Handled parsing for create index on complex column.
Does this PR introduce any user interface change?
No
Is any new testcase added?
Yes
This closes #4187
---
.../spark/testsuite/secondaryindex/TestSIWithComplexArrayType.scala | 3 +++
.../main/scala/org/apache/spark/sql/parser/CarbonSpark2SqlParser.scala | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git
a/index/secondary-index/src/test/scala/org/apache/carbondata/spark/testsuite/secondaryindex/TestSIWithComplexArrayType.scala
b/index/secondary-index/src/test/scala/org/apache/carbondata/spark/testsuite/secondaryindex/TestSIWithComplexArrayType.scala
index 3fe1443..8f6aaad 100644
---
a/index/secondary-index/src/test/scala/org/apache/carbondata/spark/testsuite/secondaryindex/TestSIWithComplexArrayType.scala
+++
b/index/secondary-index/src/test/scala/org/apache/carbondata/spark/testsuite/secondaryindex/TestSIWithComplexArrayType.scala
@@ -351,6 +351,9 @@ class TestSIWithComplexArrayType extends QueryTest with
BeforeAndAfterEach {
sql("create index index_1 on table complextable(country) as
'carbondata'")
}.getMessage.contains(errMsg))
assert(intercept[RuntimeException] {
+ sql("create index index_1 on table complextable(country.b) as
'carbondata'")
+ }.getMessage.contains(errMsg))
+ assert(intercept[RuntimeException] {
sql("create index index_1 on table complextable(id) as 'carbondata'")
}.getMessage.contains(errMsg))
assert(intercept[RuntimeException] {
diff --git
a/integration/spark/src/main/scala/org/apache/spark/sql/parser/CarbonSpark2SqlParser.scala
b/integration/spark/src/main/scala/org/apache/spark/sql/parser/CarbonSpark2SqlParser.scala
index 3a9a2ad..225c4df 100644
---
a/integration/spark/src/main/scala/org/apache/spark/sql/parser/CarbonSpark2SqlParser.scala
+++
b/integration/spark/src/main/scala/org/apache/spark/sql/parser/CarbonSpark2SqlParser.scala
@@ -192,7 +192,7 @@ class CarbonSpark2SqlParser extends CarbonDDLSqlParser {
protected lazy val createIndex: Parser[LogicalPlan] =
CREATE ~> INDEX ~> opt(IF ~> NOT ~> EXISTS) ~ ident ~
ontable ~
- ("(" ~> repsep(ident, ",") <~ ")") ~
+ ("(" ~> repsep(element, ",") <~ ")") ~
(AS ~> stringLit) ~
(WITH ~> DEFERRED ~> REFRESH).? ~
(PROPERTIES ~> "(" ~> repsep(options, ",") <~ ")").? <~ opt(";") ^^ {