[GitHub] carbondata pull request #2501: [CARBONDATA-2738]Block Preaggregate, Dictiona...

classic Classic list List threaded Threaded
46 messages Options
123
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2501: [CARBONDATA-2738]Block Preaggregate, Dictionary Excl...

qiuchenjian-2
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/2501
 
    SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/5865/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2501: [CARBONDATA-2738]Block Preaggregate, Dictionary Excl...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ajantha-bhat commented on the issue:

    https://github.com/apache/carbondata/pull/2501
 
    check and handle check style for all the new changes, example: CarbonProjectForUpdateCommand.scala


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2501: [CARBONDATA-2738]Block Preaggregate, Dictiona...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ajantha-bhat commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2501#discussion_r202696222
 
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/mutation/CarbonProjectForUpdateCommand.scala ---
    @@ -22,7 +22,7 @@ import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, Project}
     import org.apache.spark.sql.execution.command._
     import org.apache.spark.sql.execution.command.management.CarbonLoadDataCommand
     import org.apache.spark.sql.execution.datasources.LogicalRelation
    -import org.apache.spark.sql.types.ArrayType
    +import org.apache.spark.sql.types.{ArrayType, StructType}
    --- End diff --
   
    might be redundant import. run check style manually.


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2501: [CARBONDATA-2738]Block Preaggregate, Compaction, Dic...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2501
 
    Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/5995/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2501: [CARBONDATA-2738]Block Preaggregate, Compaction, Dic...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2501
 
    Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/5999/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2501: [CARBONDATA-2738]Block Preaggregate, Compaction, Dic...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/2501
 
    SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/5881/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2501: [CARBONDATA-2738]Block Preaggregate, Compaction, Dic...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ajantha-bhat commented on the issue:

    https://github.com/apache/carbondata/pull/2501
 
    LGTM


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2501: [CARBONDATA-2738]Block Preaggregate, Compacti...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user kunal642 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2501#discussion_r202903937
 
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/mutation/CarbonProjectForUpdateCommand.scala ---
    @@ -59,6 +60,13 @@ private[sql] case class CarbonProjectForUpdateCommand(
           return Seq.empty
         }
         val carbonTable = CarbonEnv.getCarbonTable(databaseNameOp, tableName)(sparkSession)
    +    columns.foreach { col =>
    +      val dataType = carbonTable.getColumnByName(tableName, col).getColumnSchema.getDataType
    +      if (dataType.isComplexType) {
    +        throw new MalformedCarbonCommandException("Unsupported operation on Complex data type")
    --- End diff --
   
    throw UnsupportedOperationException


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2501: [CARBONDATA-2738]Block Preaggregate, Compacti...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user kunal642 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2501#discussion_r202904600
 
    --- Diff: integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/complexType/TestComplexDataType.scala ---
    @@ -712,5 +713,166 @@ class TestComplexDataType extends QueryTest with BeforeAndAfterAll {
         checkAnswer(sql("select a.b,id,a.c,person.detail[0],d.e,d.f,person.detail[1],id from test"),Seq(Row(2,1,3,5,3,2,6,1)))
         checkAnswer(sql("select a.b,id,a.c,person.detail[0],d.e,d.f,person.detail[1],id,1,a.b from test"),Seq(Row(2,1,3,5,3,2,6,1,1,2)))
       }
    -  
    +
    +  test("test block Update for complex datatype") {
    +    sql("DROP TABLE IF EXISTS test")
    +    sql("create table test(id int,a struct<b:int,c:int>,d array<int>) stored by 'carbondata'")
    +    sql("insert into test values(1,'2$3',4)")
    +    val structException = intercept[MalformedCarbonCommandException](
    +    sql("update test set(a.b)=(4) where id=1").show(false))
    +    assertResult("Unsupported operation on Complex data type")(structException.getMessage)
    +    val arrayException = intercept[MalformedCarbonCommandException](
    +    sql("update test set(a)=(4) where id=1").show(false))
    +    assertResult("Unsupported operation on Complex data type")(arrayException.getMessage)
    +  }
    +
    +  test("test block partition column") {
    +    sql("DROP TABLE IF EXISTS list_table_area_origin")
    +    val arrayException = intercept[AnalysisException](
    +    sql("""
    +          | CREATE TABLE IF NOT EXISTS list_table_area_origin
    +          | (
    +          | id Int,
    +          | vin string,
    +          | logdate Timestamp,
    +          | phonenumber Long,
    +          | country array<string>,
    +          | salary Int
    +          | )
    +          | PARTITIONED BY (area array<string>)
    +          | STORED BY 'carbondata'
    +        """.stripMargin))
    +    assertResult("Cannot use array<string> for partition column;")(arrayException.getMessage)
    +    sql("DROP TABLE IF EXISTS list_table_area_origin")
    +    val structException = intercept[AnalysisException](
    +      sql("""
    +            | CREATE TABLE IF NOT EXISTS list_table_area_origin
    +            | (
    +            | id Int,
    +            | vin string,
    +            | logdate Timestamp,
    +            | phonenumber Long,
    +            | country array<string>,
    +            | salary Int
    +            | )
    +            | PARTITIONED BY (area struct<b:int>)
    +            | STORED BY 'carbondata'
    +          """.stripMargin)
    +    )
    +    assertResult("Cannot use struct<b:int> for partition column;")(structException.getMessage)
    +  }
    +
    +  test("test block preaggregate") {
    +    sql("DROP TABLE IF EXISTS test")
    +    sql("create table test(id int,a struct<b:int>) stored by 'carbondata'")
    +    sql("insert into test values (1,2)")
    +    sql("insert into test values (1,2)")
    +    sql("insert into test values (1,2)")
    +    val structException = intercept[MalformedCarbonCommandException](
    +      sql("create datamap preagg_sum on table test using 'preaggregate' as select id,sum(a.b) from test group by id"))
    +    assertResult("Preaggregate is unsupported for ComplexData type column: a.b")(structException.getMessage)
    +    sql("DROP TABLE IF EXISTS test")
    +    sql("create table test(id int,a array<int>) stored by 'carbondata'")
    +    sql("insert into test values (1,2)")
    +    val arrayException = intercept[MalformedCarbonCommandException](
    +      sql("create datamap preagg_sum on table test using 'preaggregate' as select id,sum(a[0]) from test group by id"))
    +    assertResult("Preaggregate is unsupported for ComplexData type column: a[0]")(arrayException.getMessage)
    +  }
    +
    +  test("test block dictionary exclude for child column") {
    +    sql("DROP TABLE IF EXISTS table1")
    +    sql(
    +      "create table table1 (roll int,a struct<b:int,c:string,d:int,e:string,f:struct<g:int," +
    +      "h:string,i:int>,j:int>) stored " +
    +      "by " +
    +      "'carbondata' tblproperties('dictionary_exclude'='a')")
    +    sql("insert into table1 values(1,'1$abc$2$efg$3:mno:4$5')")
    +    checkAnswer(sql("select a.b from table1"), Seq(Row(1)))
    +    sql("DROP TABLE IF EXISTS table1")
    +    val structException = intercept[MalformedCarbonCommandException](
    +    sql(
    +      "create table table1 (roll int,a struct<b:int,c:string,d:int,e:string,f:struct<g:int," +
    +      "h:string,i:int>,j:int>) stored " +
    +      "by " +
    +      "'carbondata' tblproperties('dictionary_exclude'='a.b')"))
    +    assertResult(
    +      "DICTIONARY_EXCLUDE column: a.b does not exist in table or unsupported for complex child " +
    +      "column. Please check create table statement.")(
    +      structException.getMessage)
    +    sql("DROP TABLE IF EXISTS table1")
    --- End diff --
   
    drop will not be executred if assertion fails. Please make sure all tables are deleted in afterAll also.


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2501: [CARBONDATA-2738]Block Preaggregate, Compacti...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user kunal642 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2501#discussion_r202904039
 
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/preaaggregate/PreAggregateUtil.scala ---
    @@ -354,7 +354,13 @@ object PreAggregateUtil {
             !expression.isInstanceOf[AttributeReference]) {
           newColumnName
         } else {
    -      expression.asInstanceOf[AttributeReference].name
    +      if (expression.isInstanceOf[GetStructField] || expression.isInstanceOf[GetArrayItem]) {
    +        throw new MalformedCarbonCommandException(
    --- End diff --
   
    throw UnsupportedOperationException


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2501: [CARBONDATA-2738]Block Preaggregate, Compacti...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user kunal642 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2501#discussion_r202903870
 
    --- Diff: integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonAlterTableCompactionCommand.scala ---
    @@ -82,6 +82,12 @@ case class CarbonAlterTableCompactionCommand(
           throw new MalformedCarbonCommandException("Unsupported operation on non transactional table")
         }
     
    +    if (table.getTableInfo.getFactTable.getListOfColumns.asScala
    +      .exists(m => m.getDataType.isComplexType)) {
    +      throw new MalformedCarbonCommandException(
    --- End diff --
   
    throw UnsupportedOperationException


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2501: [CARBONDATA-2738]Block Preaggregate, Compacti...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user kunal642 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2501#discussion_r202904751
 
    --- Diff: integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/complexType/TestComplexDataType.scala ---
    @@ -712,5 +713,166 @@ class TestComplexDataType extends QueryTest with BeforeAndAfterAll {
         checkAnswer(sql("select a.b,id,a.c,person.detail[0],d.e,d.f,person.detail[1],id from test"),Seq(Row(2,1,3,5,3,2,6,1)))
         checkAnswer(sql("select a.b,id,a.c,person.detail[0],d.e,d.f,person.detail[1],id,1,a.b from test"),Seq(Row(2,1,3,5,3,2,6,1,1,2)))
       }
    -  
    +
    +  test("test block Update for complex datatype") {
    +    sql("DROP TABLE IF EXISTS test")
    +    sql("create table test(id int,a struct<b:int,c:int>,d array<int>) stored by 'carbondata'")
    +    sql("insert into test values(1,'2$3',4)")
    +    val structException = intercept[MalformedCarbonCommandException](
    +    sql("update test set(a.b)=(4) where id=1").show(false))
    +    assertResult("Unsupported operation on Complex data type")(structException.getMessage)
    +    val arrayException = intercept[MalformedCarbonCommandException](
    +    sql("update test set(a)=(4) where id=1").show(false))
    +    assertResult("Unsupported operation on Complex data type")(arrayException.getMessage)
    +  }
    +
    +  test("test block partition column") {
    +    sql("DROP TABLE IF EXISTS list_table_area_origin")
    +    val arrayException = intercept[AnalysisException](
    +    sql("""
    +          | CREATE TABLE IF NOT EXISTS list_table_area_origin
    +          | (
    +          | id Int,
    +          | vin string,
    +          | logdate Timestamp,
    +          | phonenumber Long,
    +          | country array<string>,
    +          | salary Int
    +          | )
    +          | PARTITIONED BY (area array<string>)
    +          | STORED BY 'carbondata'
    +        """.stripMargin))
    +    assertResult("Cannot use array<string> for partition column;")(arrayException.getMessage)
    +    sql("DROP TABLE IF EXISTS list_table_area_origin")
    +    val structException = intercept[AnalysisException](
    +      sql("""
    +            | CREATE TABLE IF NOT EXISTS list_table_area_origin
    +            | (
    +            | id Int,
    +            | vin string,
    +            | logdate Timestamp,
    +            | phonenumber Long,
    +            | country array<string>,
    +            | salary Int
    +            | )
    +            | PARTITIONED BY (area struct<b:int>)
    +            | STORED BY 'carbondata'
    +          """.stripMargin)
    +    )
    +    assertResult("Cannot use struct<b:int> for partition column;")(structException.getMessage)
    +  }
    +
    +  test("test block preaggregate") {
    +    sql("DROP TABLE IF EXISTS test")
    +    sql("create table test(id int,a struct<b:int>) stored by 'carbondata'")
    +    sql("insert into test values (1,2)")
    +    sql("insert into test values (1,2)")
    +    sql("insert into test values (1,2)")
    +    val structException = intercept[MalformedCarbonCommandException](
    +      sql("create datamap preagg_sum on table test using 'preaggregate' as select id,sum(a.b) from test group by id"))
    +    assertResult("Preaggregate is unsupported for ComplexData type column: a.b")(structException.getMessage)
    +    sql("DROP TABLE IF EXISTS test")
    +    sql("create table test(id int,a array<int>) stored by 'carbondata'")
    +    sql("insert into test values (1,2)")
    +    val arrayException = intercept[MalformedCarbonCommandException](
    +      sql("create datamap preagg_sum on table test using 'preaggregate' as select id,sum(a[0]) from test group by id"))
    +    assertResult("Preaggregate is unsupported for ComplexData type column: a[0]")(arrayException.getMessage)
    +  }
    +
    +  test("test block dictionary exclude for child column") {
    +    sql("DROP TABLE IF EXISTS table1")
    +    sql(
    +      "create table table1 (roll int,a struct<b:int,c:string,d:int,e:string,f:struct<g:int," +
    +      "h:string,i:int>,j:int>) stored " +
    +      "by " +
    +      "'carbondata' tblproperties('dictionary_exclude'='a')")
    +    sql("insert into table1 values(1,'1$abc$2$efg$3:mno:4$5')")
    +    checkAnswer(sql("select a.b from table1"), Seq(Row(1)))
    +    sql("DROP TABLE IF EXISTS table1")
    +    val structException = intercept[MalformedCarbonCommandException](
    +    sql(
    +      "create table table1 (roll int,a struct<b:int,c:string,d:int,e:string,f:struct<g:int," +
    +      "h:string,i:int>,j:int>) stored " +
    +      "by " +
    +      "'carbondata' tblproperties('dictionary_exclude'='a.b')"))
    +    assertResult(
    +      "DICTIONARY_EXCLUDE column: a.b does not exist in table or unsupported for complex child " +
    +      "column. Please check create table statement.")(
    +      structException.getMessage)
    +    sql("DROP TABLE IF EXISTS table1")
    +    val arrayException = intercept[MalformedCarbonCommandException](
    +      sql(
    +        "create table table1 (roll int,a array<int>) stored " +
    +        "by " +
    +        "'carbondata' tblproperties('dictionary_exclude'='a[0]')"))
    +    assertResult(
    +      "DICTIONARY_EXCLUDE column: a[0] does not exist in table or unsupported for complex child " +
    +      "column. Please check create table statement.")(
    +      arrayException.getMessage)
    +  }
    +
    +  test("test block dictionary include for child column") {
    +    sql("DROP TABLE IF EXISTS table1")
    +    val structException = intercept[MalformedCarbonCommandException](
    +      sql(
    +        "create table table1 (roll int,a struct<b:int,c:string,d:int,e:string,f:struct<g:int," +
    +        "h:string,i:int>,j:int>) stored " +
    +        "by " +
    +        "'carbondata' tblproperties('dictionary_include'='a.b')"))
    +    assertResult(
    +      "DICTIONARY_INCLUDE column: a.b does not exist in table or unsupported for complex child " +
    +      "column. Please check create table statement.")(
    +      structException.getMessage)
    +    sql("DROP TABLE IF EXISTS table1")
    +    val arrayException = intercept[MalformedCarbonCommandException](
    +      sql(
    +        "create table table1 (roll int,a array<int>) stored " +
    +        "by " +
    +        "'carbondata' tblproperties('dictionary_include'='a[0]')"))
    +    assertResult(
    +      "DICTIONARY_INCLUDE column: a[0] does not exist in table or unsupported for complex child " +
    +      "column. Please check create table statement.")(
    +      arrayException.getMessage)
    +  }
    +
    +  test("test block compaction") {
    +    sql("DROP TABLE IF EXISTS table1")
    +    sql(
    +      "create table table1 (roll int,person Struct<detail:int,age:string,height:double>) stored " +
    +      "by 'carbondata'")
    +    sql(
    +      "load data inpath '" + resourcesPath +
    +      "/Struct.csv' into table table1 options('delimiter'=','," +
    +      "'quotechar'='\"','fileheader'='roll,person','complex_delimiter_level_1'='$'," +
    +      "'complex_delimiter_level_2'='&')")
    +    sql(
    +      "load data inpath '" + resourcesPath +
    +      "/Struct.csv' into table table1 options('delimiter'=','," +
    +      "'quotechar'='\"','fileheader'='roll,person','complex_delimiter_level_1'='$'," +
    +      "'complex_delimiter_level_2'='&')")
    +    val exception = intercept[MalformedCarbonCommandException](
    +      sql("alter table table1 compact 'major'").show(false))
    +    assertResult(
    +      "Compaction is unsupported for Table containing Complex Columns")(
    +      exception.getMessage)
    +    val exception1 = intercept[MalformedCarbonCommandException](
    +      sql("alter table table1 compact 'minor'").show(false))
    --- End diff --
   
    remove .show from from all queries


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2501: [CARBONDATA-2738]Block Preaggregate, Compaction, Dic...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2501
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/7242/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2501: [CARBONDATA-2738]Block Preaggregate, Compaction, Dic...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user Indhumathi27 commented on the issue:

    https://github.com/apache/carbondata/pull/2501
 
    Retest this please


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2501: [CARBONDATA-2738]Block Preaggregate, Compaction, Dic...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2501
 
    Build Failed with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/6016/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2501: [CARBONDATA-2738]Block Preaggregate, Compaction, Dic...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user brijoobopanna commented on the issue:

    https://github.com/apache/carbondata/pull/2501
 
    retest sdv please


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2501: [CARBONDATA-2738]Block Preaggregate, Compaction, Dic...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2501
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/7253/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2501: [CARBONDATA-2738]Block Preaggregate, Compaction, Dic...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:

    https://github.com/apache/carbondata/pull/2501
 
    SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/5889/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2501: [CARBONDATA-2738]Block Preaggregate, Compaction, Dic...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user brijoobopanna commented on the issue:

    https://github.com/apache/carbondata/pull/2501
 
    retest this please


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2501: [CARBONDATA-2738]Block Preaggregate, Compaction, Dic...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2501
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/7263/



---
123