Posted by
GitBox on
Dec 10, 2020; 5:20am
URL: http://apache-carbondata-dev-mailing-list-archive.168.s1.nabble.com/GitHub-carbondata-nihal0107-opened-a-new-pull-request-4042-CARBONDATA-4069-handled-set-streaming-for-tp104245p104601.html
Indhumathi27 commented on a change in pull request #4042:
URL:
https://github.com/apache/carbondata/pull/4042#discussion_r539851556##########
File path: integration/spark/src/main/scala/org/apache/spark/util/AlterTableUtil.scala
##########
@@ -916,6 +930,19 @@ object AlterTableUtil {
}
}
}
+ // should not be present in index tables
+ val indexTables = CarbonIndexUtil.getSecondaryIndexes(carbonTable)
Review comment:
Instead of getting from index table, can directly get the index Column names from carbonTable.getIndexesMap.get(IndexType.SI.getIndexProviderName) -> CarbonCommonConstants.INDEX_COLUMNS
##########
File path: integration/spark/src/main/scala/org/apache/spark/util/AlterTableUtil.scala
##########
@@ -450,14 +451,27 @@ object AlterTableUtil {
// validate long string columns
val longStringColumns = lowerCasePropertiesMap.get("long_string_columns");
if (longStringColumns.isDefined) {
- validateLongStringColumns(longStringColumns.get, carbonTable)
+ validateLongStringColumns(longStringColumns.get, carbonTable, sparkSession)
// update schema for long string columns
updateSchemaForLongStringColumns(thriftTable, longStringColumns.get)
} else if (propKeys.exists(_.equalsIgnoreCase("long_string_columns") && !set)) {
if (tblPropertiesMap.exists(prop => prop._1.equalsIgnoreCase("long_string_columns"))) {
updateSchemaForLongStringColumns(thriftTable, "")
}
}
+ // validate set for streaming table
+ val streamingOption = lowerCasePropertiesMap.get("streaming")
+ if (streamingOption.isDefined && set) {
+ if (carbonTable.isIndexTable) {
+ throw new UnsupportedOperationException("Set streaming table is " +
+ "not allowed for index table.")
Review comment:
```suggestion
"not allowed on the index table.")
```
##########
File path: integration/spark/src/main/scala/org/apache/spark/util/AlterTableUtil.scala
##########
@@ -916,6 +930,19 @@ object AlterTableUtil {
}
}
}
+ // should not be present in index tables
+ val indexTables = CarbonIndexUtil.getSecondaryIndexes(carbonTable)
+ if (!indexTables.isEmpty) {
+ indexTables.asScala.map(indexTable => {
+ CarbonEnv.getCarbonTable(Some(carbonTable.getDatabaseName), indexTable)(sparkSession)
+ .getCreateOrderColumn.asScala.map(column => {
+ if (longStringCols.contains(column.getColName)) {
+ throw new MalformedCarbonCommandException(s"col ${column.getColName} is " +
Review comment:
Can change to, "Cannot Alter column 'b' to Long_string_column, as the column exists in a secondary index with name `indexTable`. LONG_STRING_COLUMNS is not allowed on secondary index."
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[hidden email]