Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B5C08200C63 for ; Thu, 11 May 2017 10:10:27 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B2B06160BC7; Thu, 11 May 2017 08:10:27 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0538E160BB2 for ; Thu, 11 May 2017 10:10:26 +0200 (CEST) Received: (qmail 6076 invoked by uid 500); 11 May 2017 08:10:26 -0000 Mailing-List: contact issues-help@carbondata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@carbondata.apache.org Delivered-To: mailing list issues@carbondata.apache.org Received: (qmail 6067 invoked by uid 99); 11 May 2017 08:10:26 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 May 2017 08:10:26 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1BE4ADFC2E; Thu, 11 May 2017 08:10:26 +0000 (UTC) From: chenerlu To: issues@carbondata.apache.org Reply-To: issues@carbondata.apache.org References: In-Reply-To: Subject: [GitHub] carbondata pull request #877: [CARBONDATA-951] create table ddl can specify ... Content-Type: text/plain Message-Id: <20170511081026.1BE4ADFC2E@git1-us-west.apache.org> Date: Thu, 11 May 2017 08:10:26 +0000 (UTC) archived-at: Thu, 11 May 2017 08:10:27 -0000 Github user chenerlu commented on a diff in the pull request: https://github.com/apache/carbondata/pull/877#discussion_r115928229 --- 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 -- after assertion, pls drop table for avoiding other test. --- 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. ---