GitHub user nareshpr opened a pull request:
https://github.com/apache/incubator-carbondata/pull/681 [CARBONDATA-802]Select query is throwing exception when newly column is added without any default value If user does not provide default value in add column, dictionary & sort index file will not be created which is throwing exception while querying. Current change will create dictionary file with default null value if not default value is provided in add column query You can merge this pull request into a Git repository by running: $ git pull https://github.com/nareshpr/incubator-carbondata altertablefixes Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-carbondata/pull/681.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #681 ---- ---- --- 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 [hidden email] or file a JIRA ticket with INFRA. --- |
Github user CarbonDataQA commented on the issue:
https://github.com/apache/incubator-carbondata/pull/681 Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1266/ --- 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 [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
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 [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/incubator-carbondata/pull/681 Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1273/ --- 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 [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user nareshpr commented on the issue:
https://github.com/apache/incubator-carbondata/pull/681 Fixed review comments. Pls review and merge --- 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 [hidden email] or file a JIRA ticket with INFRA. --- |
In reply to this post by qiuchenjian-2
Github user asfgit closed the pull request at:
https://github.com/apache/incubator-carbondata/pull/681 --- 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 [hidden email] or file a JIRA ticket with INFRA. --- |
Free forum by Nabble | Edit this page |