Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1321#discussion_r139300959
--- Diff:
integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala
---
@@ -433,10 +442,23 @@ case class LoadTable(
val dateFormat = options.getOrElse("dateformat", null)
ValidateUtil.validateDateFormat(dateFormat, table, tableName)
val maxColumns = options.getOrElse("maxcolumns", null)
- val sortScope = options.getOrElse("sort_scope", null)
+
+ val tableProperties =
table.getTableInfo.getFactTable.getTableProperties
+ val sortScope = if (null == tableProperties) {
+ CarbonCommonConstants.LOAD_SORT_SCOPE_DEFAULT
+ } else {
+ tableProperties.getOrDefault("sort_scope",
+ CarbonCommonConstants.LOAD_SORT_SCOPE_DEFAULT)
+ }
+
--- End diff --
Don't hardcode the sort scope here, you should get from carbon properties.
Please use the code like below.
```
val sortScopeDefault = CarbonProperties.getInstance().
getProperty(CarbonLoadOptionConstants.CARBON_OPTIONS_SORT_SCOPE,
CarbonProperties.getInstance().getProperty(CarbonCommonConstants.LOAD_SORT_SCOPE,
CarbonCommonConstants.LOAD_SORT_SCOPE_DEFAULT))
val sortScope = if (null == tableProperties) {
sortScopeDefault
} else {
tableProperties.getOrDefault("sort_scope", sortScopeDefault)
}
```
---