[GitHub] [carbondata] akkio-97 opened a new pull request #4115: [WIP]

classic Classic list List threaded Threaded
110 messages Options
123456
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4115: [WIP]

GitBox

CarbonDataQA2 commented on pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#issuecomment-812422053


   Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12602/job/ApacheCarbonPRBuilder2.3/5116/
   


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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4115: [WIP]

GitBox
In reply to this post by GitBox

CarbonDataQA2 commented on pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#issuecomment-812424124


   Build Failed  with Spark 2.4.5, Please check CI http://121.244.95.60:12602/job/ApacheCarbon_PR_Builder_2.4.5/3365/
   


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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4115: [CARBONDATA-4160] Alter carbon schema by adding single-level complex columns(array/struct)

GitBox
In reply to this post by GitBox

CarbonDataQA2 commented on pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#issuecomment-812471222


   Build Failed  with Spark 2.4.5, Please check CI http://121.244.95.60:12602/job/ApacheCarbon_PR_Builder_2.4.5/3366/
   


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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4115: [CARBONDATA-4160] Alter carbon schema by adding single-level complex columns(array/struct)

GitBox
In reply to this post by GitBox

CarbonDataQA2 commented on pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#issuecomment-812471606


   Build Failed  with Spark 2.3.4, Please check CI http://121.244.95.60:12602/job/ApacheCarbonPRBuilder2.3/5117/
   


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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] akkio-97 commented on pull request #4115: [CARBONDATA-4160] Alter carbon schema by adding single-level complex columns(array/struct)

GitBox
In reply to this post by GitBox

akkio-97 commented on pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#issuecomment-812524349


   retest this please


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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4115: [CARBONDATA-4160] Alter carbon schema by adding single-level complex columns(array/struct)

GitBox
In reply to this post by GitBox

CarbonDataQA2 commented on pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#issuecomment-812529197


   Build Failed  with Spark 2.4.5, Please check CI http://121.244.95.60:12602/job/ApacheCarbon_PR_Builder_2.4.5/3368/
   


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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4115: [CARBONDATA-4160] Alter carbon schema by adding single-level complex columns(array/struct)

GitBox
In reply to this post by GitBox

CarbonDataQA2 commented on pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#issuecomment-812529533


   Build Failed  with Spark 2.3.4, Please check CI http://121.244.95.60:12602/job/ApacheCarbonPRBuilder2.3/5119/
   


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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] akkio-97 commented on pull request #4115: [CARBONDATA-4160] Alter carbon schema by adding single-level complex columns(array/struct)

GitBox
In reply to this post by GitBox

akkio-97 commented on pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#issuecomment-813150060


   retest this please


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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4115: [CARBONDATA-4160] Alter carbon schema by adding single-level complex columns(array/struct)

GitBox
In reply to this post by GitBox

CarbonDataQA2 commented on pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#issuecomment-813170864


   Build Failed  with Spark 2.4.5, Please check CI http://121.244.95.60:12602/job/ApacheCarbon_PR_Builder_2.4.5/3370/
   


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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4115: [CARBONDATA-4160] Alter carbon schema by adding single-level complex columns(array/struct)

GitBox
In reply to this post by GitBox

CarbonDataQA2 commented on pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#issuecomment-813171380


   Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12602/job/ApacheCarbonPRBuilder2.3/5121/
   


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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] akkio-97 commented on pull request #4115: [CARBONDATA-4160] Alter carbon schema by adding single-level complex columns(array/struct)

GitBox
In reply to this post by GitBox

akkio-97 commented on pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#issuecomment-813192053


   retest this please


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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4115: [CARBONDATA-4160] Alter carbon schema by adding single-level complex columns(array/struct)

GitBox
In reply to this post by GitBox

CarbonDataQA2 commented on pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#issuecomment-813232084


   Build Success with Spark 2.3.4, Please check CI http://121.244.95.60:12602/job/ApacheCarbonPRBuilder2.3/5123/
   


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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] CarbonDataQA2 commented on pull request #4115: [CARBONDATA-4160] Alter carbon schema by adding single-level complex columns(array/struct)

GitBox
In reply to this post by GitBox

CarbonDataQA2 commented on pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#issuecomment-813232378


   Build Success with Spark 2.4.5, Please check CI http://121.244.95.60:12602/job/ApacheCarbon_PR_Builder_2.4.5/3372/
   


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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] akashrn5 commented on pull request #4115: [CARBONDATA-4160] Alter carbon schema by adding single-level complex columns(array/struct)

GitBox
In reply to this post by GitBox

akashrn5 commented on pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#issuecomment-813866247


   @akkio-97 , please create a single parent jira for alter support for complex types, and then create sub tasks based on the different phase activities. After that you can give the sub jira name in title and change title as support Add column


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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] Indhumathi27 commented on a change in pull request #4115: [CARBONDATA-4163] Support adding of single-level complex columns(array/struct)

GitBox
In reply to this post by GitBox

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



##########
File path: integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala
##########
@@ -275,6 +275,56 @@ class AlterTableColumnSchemaGenerator(
         allColumns ++= Seq(columnSchema)
       }
       newCols ++= Seq(columnSchema)
+      if(field.dataType== Some("Array") ) {
+        columnSchema.setNumberOfChild(field.children.size)
+        val childField = field.children.get(0)

Review comment:
       Please handle if array<complex>/struct<complex> column is provided for add column

##########
File path: integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/alterTable/TestAlterTableAddColumns.scala
##########
@@ -136,6 +137,155 @@ class TestAlterTableAddColumns extends QueryTest with BeforeAndAfterAll {
     sql(s"""DROP TABLE IF EXISTS ${ tableName }""")
   }
 
+  test("Test alter add for arrays enabling local dictionary") {
+    sql("DROP TABLE IF EXISTS alter_com")
+    sql(
+      "CREATE TABLE alter_com(intField INT, arr1 array<int>) " +
+      "STORED AS carbondata TBLPROPERTIES('local_dictionary_enable'='true')")
+
+    sql("insert into alter_com values(1,array(1) )")
+    sql("insert into alter_com values(2,array(9,0) )")
+    sql("insert into alter_com values(3,array(11,12,13) )")
+
+    sql(
+      "ALTER TABLE alter_com ADD COLUMNS(arr2 array<int>, arr3 array<string>) TBLPROPERTIES" +
+      "('LOCAL_DICTIONARY_INCLUDE'='arr3')")
+    val schema = sql("describe alter_com").collect()
+    assert(schema.size == 4)
+
+    // For the previous segments the default value for newly added array column is null
+    sql("insert into alter_com values(4,array(2),array(1,2,3,4),array('abc','def'))")
+    sql("insert into alter_com values(5,array(1,2),array(1), array('Hulk','Thor'))")
+    sql(
+      "insert into alter_com values(6,array(1,2,3),array(1234,8,33333),array('Iron','Man'," +
+      "'Jarvis'))")
+
+    val totalRows = sql("select * from alter_com").collect()
+    val a = sql("select * from alter_com where array_contains(arr2,2)").collect
+    val b = sql("select * from alter_com where array_contains(arr3,'Thor')").collect
+    val c = sql("select * from alter_com where intField = 1").collect
+    assert(totalRows.size == 6)
+    assert(a.size == 1)
+    assert(b.size == 1)
+    // check default value for newly added array column that is index - 3 and 4
+    assert(c(0)(2) == null && c(0)(3) == null)
+    sql("DROP TABLE IF EXISTS alter_com")
+
+  }
+
+  test("Test alter add for arrays disabling local dictionary") {
+    sql("DROP TABLE IF EXISTS alter_com")
+    sql(
+      "CREATE TABLE alter_com(intField INT, arr1 array<int>) " +
+      "STORED AS carbondata TBLPROPERTIES('local_dictionary_enable'='false')")
+
+    sql("insert into alter_com values(1,array(1) )")
+    sql("insert into alter_com values(2,array(9,0) )")
+    sql("insert into alter_com values(3,array(11,12,13) )")
+    sql(
+      "ALTER TABLE alter_com ADD COLUMNS(arr2 array<double>, arr3 array<string>) TBLPROPERTIES" +
+      "('LOCAL_DICTIONARY_EXCLUDE'='arr3')")
+    val schema = sql("describe alter_com").collect()
+    assert(schema.size == 4)
+
+    // For the previous segments the default value for newly added array column is null
+    sql("insert into alter_com values(4,array(2),array(1,2,3,4),array('abc','def'))")
+    sql("insert into alter_com values(5,array(1,2),array(1), array('Hulk','Thor'))")
+    sql(
+      "insert into alter_com values(6,array(1,2,3),array(1234,80,3333),array('Iron','Man'," +
+      "'Jarvis'))")
+
+    val totalRows = sql("select * from alter_com").collect()
+    val a = sql("select * from alter_com where array_contains(arr2,2)").collect
+    val b = sql("select * from alter_com where array_contains(arr3,'Thor')").collect
+    val c = sql("select * from alter_com where intField = 1").collect
+    assert(totalRows.size == 6)
+    assert(a.size == 1)
+    assert(b.size == 1)
+    // check default value for newly added array column that is index - 3 and 4
+    assert(c(0)(2) == null && c(0)(3) == null)
+    sql("DROP TABLE IF EXISTS alter_com")
+
+  }
+
+  test("Test alter add for structs enabling local dictionary") {
+    sql("DROP TABLE IF EXISTS alter_struct")
+    sql(
+      "create table alter_struct(roll int, department struct<id1:string,name1:string>) STORED AS " +
+      "carbondata TBLPROPERTIES('local_dictionary_enable'='true')")
+    sql(
+      "insert into alter_struct values(1, named_struct('id1', 'id1','name1','name1'))")
+    sql(
+      "ALTER TABLE alter_struct ADD COLUMNS(struct1 struct<a:string,b:string>, temp string," +
+      " intField int, struct2 struct<c:string,d:string,e:int>, arr array<int>) TBLPROPERTIES " +
+      "('LOCAL_DICTIONARY_INCLUDE'='struct1, struct2')")
+    val schema = sql("describe alter_struct").collect()
+    assert(schema.size == 7)
+
+    sql(
+      "insert into alter_struct values(2, named_struct('id1', 'id1','name1','name1'), " +
+      "named_struct('a','id2','b', 'abc2'), 'hello world', 5, named_struct('c','id3'," +
+      "'d', 'abc3','e', 22), array(1,2,3)  )")
+    sql(
+      "insert into alter_struct values(3, named_struct('id1', 'id1','name1','name1'), " +
+      "named_struct('a','id2.1','b', 'abc2.1'), 'India', 5, named_struct('c','id3.1'," +
+      "'d', 'abc3.1','e', 25), array(4,5)  )")
+
+    val totalRows = sql("select * from alter_struct").collect()
+    val a = sql("select * from alter_struct where struct1.a = 'id2' ").collect()
+    val b = sql(
+      "select * from alter_struct where struct1.a = 'id2' or struct2.c = 'id3.1' or " +
+      "array_contains(arr,5) ").collect()
+    val c = sql("select * from alter_struct where roll = 1").collect()
+
+    assert(totalRows.size == 3)
+    assert(a.size == 1)
+    assert(b.size == 2)
+    // check default value for newly added struct column
+    assert(c(0)(2) == null)
+    sql("DROP TABLE IF EXISTS alter_struct")
+
+  }
+
+  test("Test alter add for structs, disabling local dictionary") {
+    sql("DROP TABLE IF EXISTS alter_struct")
+    sql(
+      "create table alter_struct(roll int, department struct<id1:string,name1:string>) STORED AS " +
+      "carbondata TBLPROPERTIES('local_dictionary_enable'='false')")

Review comment:
       Please move common queries to a method, for Local Dict enable/disable, for both array and struct

##########
File path: core/src/main/java/org/apache/carbondata/core/scan/executor/util/QueryUtil.java
##########
@@ -280,6 +280,9 @@ public static void fillQueryDimensionChunkIndexes(
 
   private static void fillParentDetails(Map<Integer, Integer> dimensionToBlockIndexMap,
       CarbonDimension dimension, Map<Integer, GenericQueryType> complexTypeMap) {
+    if (!dimensionToBlockIndexMap.containsKey(dimension.getOrdinal())) {

Review comment:
       Please add comments why this change is required

##########
File path: index/secondary-index/src/test/scala/org/apache/carbondata/spark/testsuite/secondaryindex/TestSIWithComplexArrayType.scala
##########
@@ -43,6 +43,83 @@ class TestSIWithComplexArrayType extends QueryTest with BeforeAndAfterEach {
     sql("drop table if exists complextable5")
   }
 
+  test("Test alter add array column before creating SI") {
+    sql("drop table if exists complextable")
+    sql("create table complextable (id string, country array<string>, name string) stored as carbondata")
+    sql("insert into complextable select 1,array('china', 'us'), 'b'")
+    sql("insert into complextable select 2,array('pak'), 'v'")
+
+    sql("drop index if exists index_11 on complextable")
+    sql(
+      "ALTER TABLE complextable ADD COLUMNS(arr2 array<string>)")
+    sql("insert into complextable select 3,array('china'), 'f',array('hello','world')")
+    sql("insert into complextable select 4,array('india'),'g',array('iron','man','jarvis')")
+
+    val result1 = sql("select * from complextable where array_contains(arr2,'iron')")
+    val result2 = sql("select * from complextable where arr2[0]='iron'")
+    sql("create index index_11 on table complextable(arr2) as 'carbondata'")
+    val df1 = sql(" select * from complextable where array_contains(arr2,'iron')")
+    val df2 = sql(" select * from complextable where arr2[0]='iron'")
+    if (!isFilterPushedDownToSI(df1.queryExecution.sparkPlan)) {
+      assert(false)
+    } else {
+      assert(true)
+    }
+    if (!isFilterPushedDownToSI(df2.queryExecution.sparkPlan)) {
+      assert(false)
+    } else {
+      assert(true)
+    }
+    val doNotHitSIDf = sql(" select * from complextable where array_contains(arr2,'iron') and array_contains(arr2,'man')")
+    if (isFilterPushedDownToSI(doNotHitSIDf.queryExecution.sparkPlan)) {
+      assert(false)
+    } else {
+      assert(true)
+    }
+    checkAnswer(result1, df1)
+    checkAnswer(result2, df2)
+  }
+
+  test("Test alter add array column after creating SI") {
+    sql("drop table if exists complextable")
+    sql("create table complextable (id string, country array<string>, name string) stored as carbondata")
+    sql("insert into complextable select 1,array('china', 'us'), 'b'")
+    sql("insert into complextable select 2,array('pak'), 'v'")
+
+    sql("drop index if exists index_11 on complextable")
+    sql("create index index_11 on table complextable(country) as 'carbondata'")
+
+    sql(

Review comment:
       Please add testcases for Add column of array & struct of all primitive types




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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] akashrn5 commented on a change in pull request #4115: [CARBONDATA-4163] Support adding of single-level complex columns(array/struct)

GitBox
In reply to this post by GitBox

akashrn5 commented on a change in pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#discussion_r609663124



##########
File path: integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala
##########
@@ -275,6 +275,56 @@ class AlterTableColumnSchemaGenerator(
         allColumns ++= Seq(columnSchema)
       }
       newCols ++= Seq(columnSchema)
+      if(field.dataType== Some("Array") ) {
+        columnSchema.setNumberOfChild(field.children.size)
+        val childField = field.children.get(0)
+        val childSchema: ColumnSchema = TableNewProcessor.createColumnSchema(
+          childField,

Review comment:
       @akkio-97 i think here once you added column, the column will be at last, i mean to say like below
   
   existing dim + new added dim + existing measures + new measures, same has to be present in thrift column schema also, you can refer the existing test cases to know better.
   
   Also, have a test cases, with sort column, measures in sort column, dim in sort column etc,
   
   please recheck and correct this and confirm.

##########
File path: core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelFilterExecutorImpl.java
##########
@@ -585,7 +585,9 @@ public void readColumnChunks(RawBlockletColumnChunks rawBlockletColumnChunks) th
         }
       } else {
         GenericQueryType complexType = complexDimensionInfoMap.get(dimensionChunkIndex[i]);
-        complexType.fillRequiredBlockData(rawBlockletColumnChunks);
+        if (complexType != null) {

Review comment:
       before this PR, why null check was not  there?




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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] akkio-97 commented on a change in pull request #4115: [CARBONDATA-4163] Support adding of single-level complex columns(array/struct)

GitBox
In reply to this post by GitBox

akkio-97 commented on a change in pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#discussion_r609792211



##########
File path: integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala
##########
@@ -275,6 +275,56 @@ class AlterTableColumnSchemaGenerator(
         allColumns ++= Seq(columnSchema)
       }
       newCols ++= Seq(columnSchema)
+      if(field.dataType== Some("Array") ) {
+        columnSchema.setNumberOfChild(field.children.size)
+        val childField = field.children.get(0)
+        val childSchema: ColumnSchema = TableNewProcessor.createColumnSchema(
+          childField,

Review comment:
       The order is maintained like above. The thrift column schema does not contain new columns.
   The new dimensions(including complex) are added after the old dimensions only. After which all measure columns are added.




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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] akashrn5 commented on a change in pull request #4115: [CARBONDATA-4163] Support adding of single-level complex columns(array/struct)

GitBox
In reply to this post by GitBox

akashrn5 commented on a change in pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#discussion_r609828600



##########
File path: integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala
##########
@@ -275,6 +275,56 @@ class AlterTableColumnSchemaGenerator(
         allColumns ++= Seq(columnSchema)
       }
       newCols ++= Seq(columnSchema)
+      if(field.dataType== Some("Array") ) {
+        columnSchema.setNumberOfChild(field.children.size)
+        val childField = field.children.get(0)
+        val childSchema: ColumnSchema = TableNewProcessor.createColumnSchema(
+          childField,

Review comment:
       then how come when i debug your test case, i get the wrong order?
   ![image](https://user-images.githubusercontent.com/21074821/114054749-c235c500-98ad-11eb-9ddb-9700446d449d.png)
   




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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] akashrn5 commented on a change in pull request #4115: [CARBONDATA-4163] Support adding of single-level complex columns(array/struct)

GitBox
In reply to this post by GitBox

akashrn5 commented on a change in pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#discussion_r609832608



##########
File path: integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala
##########
@@ -275,6 +275,56 @@ class AlterTableColumnSchemaGenerator(
         allColumns ++= Seq(columnSchema)
       }
       newCols ++= Seq(columnSchema)
+      if(field.dataType== Some("Array") ) {
+        columnSchema.setNumberOfChild(field.children.size)
+        val childField = field.children.get(0)
+        val childSchema: ColumnSchema = TableNewProcessor.createColumnSchema(
+          childField,

Review comment:
       @akkio-97 , my bad, i debugged a test case where there were no dimensions




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


Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] akashrn5 commented on a change in pull request #4115: [CARBONDATA-4163] Support adding of single-level complex columns(array/struct)

GitBox
In reply to this post by GitBox

akashrn5 commented on a change in pull request #4115:
URL: https://github.com/apache/carbondata/pull/4115#discussion_r609832608



##########
File path: integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchemaCommon.scala
##########
@@ -275,6 +275,56 @@ class AlterTableColumnSchemaGenerator(
         allColumns ++= Seq(columnSchema)
       }
       newCols ++= Seq(columnSchema)
+      if(field.dataType== Some("Array") ) {
+        columnSchema.setNumberOfChild(field.children.size)
+        val childField = field.children.get(0)
+        val childSchema: ColumnSchema = TableNewProcessor.createColumnSchema(
+          childField,

Review comment:
       @akkio-97 , my bad, i debugged a test case where there were no dimensions. And just to correct you, thrift will be changed if you can see the thriftTable object which you receive after process method call, so that it will be updated in hive metastore freshly and carbon metadata cache also by removing old 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:
[hidden email]


123456