carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gvramana <...@git.apache.org>
Subject [GitHub] carbondata pull request #1432: [CARBONDATA-1608]Support Column Comment for C...
Date Tue, 14 Nov 2017 15:13:10 GMT
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


---

Mime
View raw message