[GitHub] [carbondata] akashrn5 commented on a change in pull request #3436: [WIP]Geospatial Support: Modified to create and load table with invisible dimension sort column

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] akashrn5 commented on a change in pull request #3436: [WIP]Geospatial Support: Modified to create and load table with invisible dimension sort column

GitBox
akashrn5 commented on a change in pull request #3436: [WIP]Geospatial Support: Modified to create and load table with invisible dimension sort column
URL: https://github.com/apache/carbondata/pull/3436#discussion_r345025165
 
 

 ##########
 File path: integration/spark-common/src/main/scala/org/apache/spark/sql/catalyst/CarbonDDLSqlParser.scala
 ##########
 @@ -218,6 +220,45 @@ abstract class CarbonDDLSqlParser extends AbstractCarbonSparkSQLParser {
     )
   }
 
+  def getField(col: StructField): Field = {
+    var columnComment: String = ""
+    var plainComment: String = ""
+    if (col.getComment().isDefined) {
+      columnComment = " comment \"" + col.getComment().get + "\""
+      plainComment = col.getComment().get
+    }
+    val x =
+      if (col.dataType.catalogString == "float") {
+        '`' + col.name + '`' + " double" + columnComment
+      } else {
+        '`' + col.name + '`' + ' ' + col.dataType.catalogString + columnComment
+      }
+    val f: Field = anyFieldDef(new lexical.Scanner(x.toLowerCase))
+    match {
+      case Success(field, _) => field.asInstanceOf[Field]
+      case failureOrError => throw new MalformedCarbonCommandException(
+        s"Unsupported data type: ${col.dataType}")
+    }
+    // the data type of the decimal type will be like decimal(10,0)
+    // so checking the start of the string and taking the precision and scale.
+    // resetting the data type with decimal
+    if (f.dataType.getOrElse("").startsWith("decimal")) {
 
 Review comment:
   same as above and wherever hardcoded, please use from Datatypes.java

----------------------------------------------------------------
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:
[hidden email]


With regards,
Apache Git Services