[GitHub] carbondata pull request #877: [CARBONDATA-951] create table ddl can specify ...

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #877: [CARBONDATA-951] create table ddl can specify ...

qiuchenjian-2
Github user mayunSaicmotor commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/877#discussion_r115936997
 
    --- Diff: integration/spark/src/test/scala/org/apache/carbondata/spark/testsuite/createtable/TestCreateTableSyntax.scala ---
    @@ -31,7 +36,60 @@ class TestCreateTableSyntax extends QueryTest with BeforeAndAfterAll {
       
       override def beforeAll {
       }
    +  test("test carbon table create with bitmap column") {
    +
    +    sql("drop table if exists carbontable")
    +      sql("""
    +           CREATE TABLE IF NOT EXISTS carbontable
    +           (ID Int, date Date, country String,
    +           name String, phonetype String, serialname char(10), salary Int)
    +           STORED BY 'carbondata'
    +           TBLPROPERTIES ('BITMAP'='name,country')
    +           """)
    +    val dataBaseName = "default"
    +    val tableName = "carbontable"
    +    val carbonRelation = CarbonEnv.get.carbonMetastore.lookupRelation1(Option(dataBaseName),
    +      tableName)(sqlContext).asInstanceOf[CarbonRelation]
    +    val carbonTable = carbonRelation.tableMeta.carbonTable
    +    val dimensions = carbonTable.getDimensionByTableName(tableName.toLowerCase())
    +      .toArray.map(_.asInstanceOf[CarbonDimension])
    +    assert(dimensions(1).getColumnSchema.getColumnName.equals("country"))
    +    assert(dimensions(2).getColumnSchema.getColumnName.equals("name"))
    +    assert(dimensions(1).getColumnSchema.hasEncoding(Encoding.BITMAP))
    +    assert(dimensions(2).getColumnSchema.hasEncoding(Encoding.BITMAP))
    --- End diff --
   
    the table will be dropped in after all  method  
    override def afterAll {
        sql("drop table if exists hivetable")
        sql("drop table if exists carbontable")
        sql("drop table if exists hiveRenamedTable")
        sql("drop table if exists carbonRenamedTable")
        sql("drop table if exists carbontablePrecision")
      }


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---