Github user ajantha-bhat commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2966#discussion_r241677372
--- Diff:
integration/spark-common/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala
---
@@ -848,6 +848,19 @@ class TableNewProcessor(cm: TableModel) {
tableSchema.getTableId,
cm.databaseNameOp.getOrElse("default"))
tablePropertiesMap.put("bad_record_path", badRecordsPath)
+ if (tablePropertiesMap.get("sort_columns") != null) {
+ val sortCol = tablePropertiesMap.get("sort_columns")
+ if ((!sortCol.trim.isEmpty) && tablePropertiesMap.get("sort_scope")
== null) {
+ // If sort_scope is not specified, but sort_columns are present,
set sort_scope as
+ // local_sort in carbon_properties (cannot add in table properties
as if user sets carbon
+ // properties it won't be reflected as table properties is given
higher priority)
+ if
(CarbonProperties.getInstance().getProperty(CarbonCommonConstants.LOAD_SORT_SCOPE)
==
+ null) {
+ CarbonProperties.getInstance()
+ .addProperty(CarbonCommonConstants.LOAD_SORT_SCOPE,
"LOCAL_SORT")
--- End diff --
ok. changed back to table properties
---