Github user gvramana commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/927#discussion_r117488392
--- Diff:
integration/spark-common/src/main/scala/org/apache/spark/sql/catalyst/CarbonDDLSqlParser.scala
---
@@ -495,15 +495,36 @@ abstract class CarbonDDLSqlParser extends
AbstractCarbonSparkSQLParser {
// check duplicate columns and only 1 col left
val distinctCols = noInvertedIdxColsProps.toSet
// extract the no inverted index columns
+ val dictionaryInclude =
tableProperties.getOrElse(CarbonCommonConstants.DICTIONARY_INCLUDE, "")
+ .split(",")
+ val sortColumns =
tableProperties.getOrElse(CarbonCommonConstants.SORT_COLUMNS, "").split(",")
fields.foreach(field => {
- if (distinctCols.exists(x => x.equalsIgnoreCase(field.column))) {
+ if (distinctCols.exists(x => x.equalsIgnoreCase(field.column)) &&
+ validateColumnsForInvertedIndex(field, dictionaryInclude ++
sortColumns)) {
noInvertedIdxCols :+= field.column
}
}
)
noInvertedIdxCols
}
+
+ private def validateColumnsForInvertedIndex(field: Field,
+ dictionaryIncludeOrSortColumn: Array[String]): Boolean = {
+ val invertedIndexColumns = Array("date", "timestamp", "struct",
"array")
--- End diff --
Struct, array will not have invertedindex, while data and timestamp will
have invertedindex
---
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 [email protected] or file a JIRA ticket
with INFRA.
---