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/14 10:24:13 UTC

[GitHub] [carbondata] Indhumathi27 commented on a change in pull request #4037: [CARBONDATA-4070] [CARBONDATA-4059] Fixed SI issues and improved FT.

Indhumathi27 commented on a change in pull request #4037:
URL: https://github.com/apache/carbondata/pull/4037#discussion_r542265677



##########
File path: integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/datacompaction/CarbonIndexFileMergeTestCase.scala
##########
@@ -111,6 +111,32 @@ class CarbonIndexFileMergeTestCase
     checkAnswer(sql("""Select count(*) from nonindexmerge"""), rows)
   }
 
+  test("verify index file merge for SI") {

Review comment:
       This test  case looks like a duplicate case. Already present in CarbonIndexFileMergeTestCaseWithSI#Verify command of index merge

##########
File path: index/secondary-index/src/test/scala/org/apache/carbondata/spark/testsuite/secondaryindex/TestSIWithRangeColumn.scala
##########
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.carbondata.spark.testsuite.secondaryindex
+
+import org.apache.spark.sql.Row
+import org.apache.spark.sql.test.util.QueryTest
+
+class TestSIWithRangeColumn extends QueryTest {
+  test("test SI on range column with and without global sort") {
+    sql("drop table if exists carbon_range_column")
+    sql(
+      """
+        | CREATE TABLE carbon_range_column(id INT, name STRING, city STRING, age INT)
+        | STORED AS carbondata
+        | TBLPROPERTIES(
+        | 'SORT_SCOPE'='LOCAL_SORT', 'SORT_COLUMNS'='name, city', 'range_column'='city')
+      """.stripMargin)
+    sql("CREATE INDEX range_si on carbon_range_column(city) as 'carbondata'")
+    sql("INSERT into carbon_range_column values(1,'nko','blr',25)")
+    checkAnswer(sql("SELECT count(*) FROM range_si"), Seq(Row(1)))
+    checkAnswer(sql("SELECT name FROM carbon_range_column where city='blr'"), Seq(Row("nko")))
+    sql("drop index if exists range_si on carbon_range_column")
+    sql("CREATE INDEX range_si on carbon_range_column(city) as 'carbondata'" +
+      " PROPERTIES('sort_scope'='global_sort', 'Global_sort_partitions'='1')")
+    checkAnswer(sql("SELECT count(*) FROM range_si"), Seq(Row(1)))
+    sql("drop table if exists carbon_range_column")
+  }
+
+  test("test SI creation with range column") {
+    sql("drop table if exists carbon_range_column")
+    sql(

Review comment:
       can extract to new method and reuse create table

##########
File path: integration/spark/src/main/scala/org/apache/spark/sql/execution/command/table/CarbonCreateTableLikeCommand.scala
##########
@@ -48,8 +48,9 @@ case class CarbonCreateTableLikeCommand(
     if (!srcTable.isTransactionalTable) {
       throw new MalformedCarbonCommandException("Unsupported operation on non transactional table")
     }
-    if (srcTable.isMV) {
-      throw new MalformedCarbonCommandException("Unsupported operation on child table or MV")
+    if (srcTable.isMV || srcTable.isIndexTable) {
+      throw new MalformedCarbonCommandException("Unsupported operation on child " +

Review comment:
       ```suggestion
         throw new MalformedCarbonCommandException("Unsupported operation on SI table or MV")
   ```

##########
File path: integration/spark/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonAlterTableCompactionCommand.scala
##########
@@ -102,6 +102,10 @@ case class CarbonAlterTableCompactionCommand(
         throw new MalformedCarbonCommandException(
           "Unsupported alter operation on carbon table")
     }
+    if (table.isIndexTable) {
+      throw new MalformedCarbonCommandException(
+        "Unsupported alter operation on carbon table: Compaction not supported on SI table")

Review comment:
       ```suggestion
           "Unsupported alter operation on carbon table: Compaction is not supported on SI table")
   ```




----------------------------------------------------------------
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