Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1065#discussion_r123231920
  
    --- Diff: 
integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/aggquery/IntegerDataTypeTestCase.scala
 ---
    @@ -39,6 +42,79 @@ 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(
    +      CarbonCommonConstants.ENABLE_UNSAFE_COLUMN_PAGE_LOADING,
    +      CarbonCommonConstants.ENABLE_UNSAFE_COLUMN_PAGE_LOADING_DEFAULT
    +    )
    +  }
    +
       override def afterAll {
         sql("drop table integertypetableAgg")
    --- End diff --
    
    ok


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to