Github user gvramana commented on a diff in the pull request:

    
https://github.com/apache/incubator-carbondata/pull/681#discussion_r107334744
  
    --- Diff: 
integration/spark-common/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala
 ---
    @@ -229,31 +229,37 @@ class AlterTableProcessor(
               tablePropertiesMap.put(x._1, x._2)
             }
         }
    -    for (elem <- alterTableModel.tableProperties) {
    -      if (elem._1.toLowerCase.startsWith("default.value.")) {
    -        val col = newCols.filter(p => 
p.getColumnName.equalsIgnoreCase(elem._1.substring(14)))
    -        if (col.size == 1) {
    -          val data = 
DataTypeUtil.convertDataToBytesBasedOnDataType(elem._2, col(0).getDataType)
    -          if (null != data) {
    -            col(0).setDefaultValue(data)
    -          } else {
    -            LOGGER
    -              .error(
    -                "Invalid default value for new column " + dbName + "." + 
alterTableModel.tableName +
    -                "." + col(0).getColumnName + " : " + elem._2)
    -          }
    -          if (col(0).getEncodingList.contains(Encoding.DICTIONARY) &&
    -              
!col(0).getEncodingList.contains(Encoding.DIRECT_DICTIONARY)) {
    -            GlobalDictionaryUtil
    -              .loadDefaultDictionaryValueForNewColumn(carbonTablePath,
    -                col(0),
    -                tableIdentifier,
    -                storePath,
    -                elem._2)
    +
    +    newCols.foreach { col =>
    +      var rawData: String = null
    +      for (elem <- alterTableModel.tableProperties) {
    +        if (elem._1.toLowerCase.startsWith("default.value.")) {
    +          if (col.getColumnName.equalsIgnoreCase(elem._1.substring(14))) {
    --- End diff --
    
    create and a val for "default.value." and use length function. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to