[GitHub] [carbondata] VenuReddy2103 commented on a change in pull request #3436: [CARBONDATA-3548]Geospatial Support: Modified to create and load the table with a nonschema dimension sort column. And added InPolygon UDF

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

[GitHub] [carbondata] VenuReddy2103 commented on a change in pull request #3436: [CARBONDATA-3548]Geospatial Support: Modified to create and load the table with a nonschema dimension sort column. And added InPolygon UDF

GitBox
VenuReddy2103 commented on a change in pull request #3436: [CARBONDATA-3548]Geospatial Support: Modified to create and load the table with a nonschema dimension sort column. And added InPolygon UDF
URL: https://github.com/apache/carbondata/pull/3436#discussion_r349535900
 
 

 ##########
 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:
   This is from base code. Same as above.

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