You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by GitBox <gi...@apache.org> on 2020/12/10 05:20:49 UTC

[GitHub] [carbondata] Indhumathi27 commented on a change in pull request #4042: [CARBONDATA-4069] [CARBONDATA-4068] handled set streaming and long string for SI table or table having SI.

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:
users@infra.apache.org