ShreelekhyaG commented on a change in pull request #4208:
URL: https://github.com/apache/carbondata/pull/4208#discussion_r695729008
##########
File path:
integration/spark/src/main/spark3.1/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala
##########
@@ -130,8 +131,24 @@ class CarbonHelperSqlAstBuilder(conf: SQLConf,
val tableProperties = convertPropertiesToLowercase(properties)
// validate partition clause
- val partitionByStructFields = Option(partitionColumns).toSeq
- .flatMap(x => visitPartitionFieldList(x)._2)
+ var (partitionTransformList,
+ partitionByStructFields) = visitPartitionFieldList(partitionColumns)
+ // If the struct fields is empty but partition columns are given,
+ // then search in table columns to extract the struct fields.
+ if (partitionByStructFields.isEmpty && !partitionTransformList.isEmpty) {
+ val partitionNames = partitionTransformList
+ .flatMap(_.references().flatMap(_.fieldNames()))
+ partitionNames.foreach(partName => {
+ val ans = cols.find(x => x.name.equals(partName))
Review comment:
Done
##########
File path:
integration/spark/src/main/spark3.1/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala
##########
@@ -130,8 +131,24 @@ class CarbonHelperSqlAstBuilder(conf: SQLConf,
val tableProperties = convertPropertiesToLowercase(properties)
// validate partition clause
- val partitionByStructFields = Option(partitionColumns).toSeq
- .flatMap(x => visitPartitionFieldList(x)._2)
+ var (partitionTransformList,
+ partitionByStructFields) = visitPartitionFieldList(partitionColumns)
+ // If the struct fields is empty but partition columns are given,
+ // then search in table columns to extract the struct fields.
+ if (partitionByStructFields.isEmpty && !partitionTransformList.isEmpty) {
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]