carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From QiangCai <...@git.apache.org>
Subject [GitHub] carbondata pull request #1065: [CARBONDATA-1196] Add 3 bytes data type suppo...
Date Thu, 22 Jun 2017 15:29:50 GMT
Github user QiangCai commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1065#discussion_r123543556
  
    --- Diff: integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/aggquery/IntegerDataTypeTestCase.scala
---
    @@ -39,7 +43,80 @@ class IntegerDataTypeTestCase extends QueryTest with BeforeAndAfterAll
{
           Seq(Row(11), Row(12), Row(13), Row(14), Row(15), Row(16), Row(17), Row(18), Row(19),
Row(20)))
       }
     
    +  test("short int table boundary test, safe column page") {
    +    sql(
    +      """
    +        | DROP TABLE IF EXISTS short_int_table
    +      """.stripMargin)
    +    // value column is less than short int, value2 column is bigger than short int
    +    sql(
    +      """
    +        | CREATE TABLE short_int_table
    +        | (value int, value2 int, name string)
    +        | STORED BY 'org.apache.carbondata.format'
    +      """.stripMargin)
    +    sql(
    +      s"""
    +        | LOAD DATA LOCAL INPATH '$resourcesPath/shortintboundary.csv'
    +        | INTO TABLE short_int_table
    +      """.stripMargin)
    +    checkAnswer(
    +      sql("select value from short_int_table"),
    +      Seq(Row(0), Row(127), Row(128), Row(-127), Row(-128), Row(32767), Row(-32767),
Row(32768), Row(-32768), Row(65535),
    +        Row(-65535), Row(8388606), Row(-8388606), Row(8388607), Row(-8388607), Row(0),
Row(0), Row(0), Row(0))
    +    )
    +    checkAnswer(
    +      sql("select value2 from short_int_table"),
    +      Seq(Row(0), Row(0), Row(0), Row(0), Row(0), Row(0), Row(0), Row(0), Row(0), Row(0),
    +        Row(0), Row(0), Row(0), Row(0), Row(0), Row(8388608), Row(-8388608), Row(8388609),
Row(-8388609))
    +    )
    +    sql(
    +      """
    +        | DROP TABLE short_int_table
    +      """.stripMargin)
    +  }
    +
    +  test("short int table boundary test, unsafe column page") {
    +    CarbonProperties.getInstance().addProperty(
    +      CarbonCommonConstants.ENABLE_UNSAFE_COLUMN_PAGE_LOADING, "true"
    +    )
    +    sql(
    +      """
    +        | DROP TABLE IF EXISTS short_int_table
    +      """.stripMargin)
    +    // value column is less than short int, value2 column is bigger than short int
    +    sql(
    +      """
    +        | CREATE TABLE short_int_table
    +        | (value int, value2 int, name string)
    +        | STORED BY 'org.apache.carbondata.format'
    +      """.stripMargin)
    +    sql(
    +      s"""
    +         | LOAD DATA LOCAL INPATH '$resourcesPath/shortintboundary.csv'
    +         | INTO TABLE short_int_table
    +      """.stripMargin)
    +    checkAnswer(
    +      sql("select value from short_int_table"),
    +      Seq(Row(0), Row(127), Row(128), Row(-127), Row(-128), Row(32767), Row(-32767),
Row(32768), Row(-32768), Row(65535),
    +        Row(-65535), Row(8388606), Row(-8388606), Row(8388607), Row(-8388607), Row(0),
Row(0), Row(0), Row(0))
    +    )
    +    checkAnswer(
    +      sql("select value2 from short_int_table"),
    +      Seq(Row(0), Row(0), Row(0), Row(0), Row(0), Row(0), Row(0), Row(0), Row(0), Row(0),
    +        Row(0), Row(0), Row(0), Row(0), Row(0), Row(8388608), Row(-8388608), Row(8388609),
Row(-8388609))
    +    )
    +    sql(
    +      """
    +        | DROP TABLE short_int_table
    +      """.stripMargin)
    +    CarbonProperties.getInstance().addProperty(
    --- End diff --
    
    please move this code to afterAll function


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message