Github user kumarvishal09 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2433#discussion_r200999110
--- Diff:
integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParser.scala
---
@@ -293,6 +296,29 @@ class CarbonHelperSqlAstBuilder(conf: SQLConf,
table.getFactTable.getTableProperties.put("_external", "true")
table.getFactTable.getTableProperties.put("_filelevelformat",
"false")
}
+ // setting local dictionary for all string coloumn for external table
+ var isLocalDic_enabled = table.getFactTable.getTableProperties
+ .get(CarbonCommonConstants.LOCAL_DICTIONARY_ENABLE)
+ if (null == isLocalDic_enabled) {
+ table.getFactTable.getTableProperties
+ .put(CarbonCommonConstants.LOCAL_DICTIONARY_ENABLE,
+ CarbonCommonConstants.LOCAL_DICTIONARY_ENABLE_DEFAULT)
+ }
+ isLocalDic_enabled = table.getFactTable.getTableProperties
+ .get(CarbonCommonConstants.LOCAL_DICTIONARY_ENABLE)
+ if
(CarbonScalaUtil.validateLocalDictionaryEnable(isLocalDic_enabled) &&
+ isLocalDic_enabled.toBoolean) {
+ val allcolumns = table.getFactTable.getListOfColumns
+ for (i <- 0 until allcolumns.size()) {
+ val cols = allcolumns.get(i)
+ if (cols.getDataType == DataTypes.STRING) {
--- End diff --
Handle for varchar type
---