MarvinLitt commented on a change in pull request #4208:
URL: https://github.com/apache/carbondata/pull/4208#discussion_r693614269



##########
File path: 
integration/spark/src/main/spark3.1/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala
##########
@@ -129,9 +129,32 @@ class CarbonHelperSqlAstBuilder(conf: SQLConf,
     val properties: Map[String, String] = 
getPropertyKeyValues(tablePropertyList)
     val tableProperties = convertPropertiesToLowercase(properties)
 
+    var partitionTransformList: Seq[Transform] = Seq()
+    var partitionByStructFields: Seq[StructField] = Seq()
     // validate partition clause
-    val partitionByStructFields = Option(partitionColumns).toSeq
-        .flatMap(x => visitPartitionFieldList(x)._2)
+    var partitionTransformList: Seq[Transform] = Seq()
+    var partitionByStructFields: Seq[StructField] = Seq()
+    Option(partitionColumns).toSeq.foreach(x => {
+      val (t, s) = visitPartitionFieldList(x)
+      partitionTransformList = partitionTransformList ++ t
+      partitionByStructFields = partitionByStructFields ++ s
+    })

Review comment:
        Option(partitionColumns).toSeq.foreach(x => {
         val (t, s) = visitPartitionFieldList(x)
         partitionTransformList = partitionTransformList ++ t
         partitionByStructFields = partitionByStructFields ++ s
       })  
   does this no need to use foreach, the input of visitPartitionFieldList is 
PartitionFieldListContext type and after func visitPartitionFieldList the 
result is two list.




-- 
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]


Reply via email to