Github user ajantha-bhat commented on a diff in the pull request: https://github.com/apache/carbondata/pull/2966#discussion_r241643126 --- Diff: store/sdk/src/main/java/org/apache/carbondata/sdk/file/CarbonWriterBuilder.java --- @@ -501,6 +502,17 @@ public CarbonLoadModel buildLoadModel(Schema carbonSchema) } // for the longstring field, change the datatype from string to varchar this.schema = updateSchemaFields(carbonSchema, longStringColumns); + if (sortColumns != null && sortColumns.length != 0) { + if (options == null || options.get("sort_scope") == null) { + // If sort_columns are specified and sort_scope is not specified, + // change sort scope to local_sort as now by default sort scope is no_sort. + if (options == null) { + options = new HashMap<>(); + } + //TODO: add in carbon property instead of load options --- End diff -- example, sort_columns are mentioned in table properties, but sort_scope is present as "Batch_sort" in carbon properties, so in this time If I set in table properties, test case fails. that too they set carbon properties after creating the table !
---