Github user gvramana commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1432#discussion_r150860743
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSpark2SqlParser.scala
---
@@ -424,11 +424,20 @@ class CarbonSpark2SqlParser extends
CarbonDDLSqlParser {
def getFields(schema: Seq[StructField]): Seq[Field] = {
schema.map { col =>
- val x = if (col.dataType.catalogString == "float") {
- '`' + col.name + '`' + " double"
- }
- else {
- '`' + col.name + '`' + ' ' + col.dataType.catalogString
+ val colComment = col.getComment()
+ val x = if (colComment.isDefined) {
+ val columnComment = " comment \"" + colComment.get + "\""
--- End diff --
No need to repeat logic, just add columnComment as empty string if no
colComment
---