You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by GitBox <gi...@apache.org> on 2021/08/23 02:43:42 UTC

[GitHub] [carbondata] MarvinLitt commented on a change in pull request #4208: [WIP] Fix create partition table error with spark 3.1

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: dev-unsubscribe@carbondata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org