You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ja...@apache.org on 2019/12/29 05:33:58 UTC
[carbondata] 01/02: wip
This is an automated email from the ASF dual-hosted git repository.
jackylk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/carbondata.git
commit 32bd37fe082daa413ae7a80c9bcde7e859a5df67
Author: Jacky Li <ja...@qq.com>
AuthorDate: Sun Dec 29 11:20:08 2019 +0800
wip
---
.../carbondata/mv/rewrite/TestAllOperationsOnMV.scala | 2 +-
.../complexType/TestCreateTableWithDouble.scala | 3 +--
.../createTable/TestCreateTableAsSelect.scala | 19 -------------------
.../spark/sql/parser/CarbonSparkSqlParserUtil.scala | 6 ++++++
4 files changed, 8 insertions(+), 22 deletions(-)
diff --git a/datamap/mv/core/src/test/scala/org/apache/carbondata/mv/rewrite/TestAllOperationsOnMV.scala b/datamap/mv/core/src/test/scala/org/apache/carbondata/mv/rewrite/TestAllOperationsOnMV.scala
index d0f9ce2..a81cd2f 100644
--- a/datamap/mv/core/src/test/scala/org/apache/carbondata/mv/rewrite/TestAllOperationsOnMV.scala
+++ b/datamap/mv/core/src/test/scala/org/apache/carbondata/mv/rewrite/TestAllOperationsOnMV.scala
@@ -392,7 +392,7 @@ class TestAllOperationsOnMV extends QueryTest with BeforeAndAfterEach {
sql("insert into table maintable select 'abc',21,2000")
sql("drop datamap if exists dm ")
intercept[MalformedCarbonCommandException] {
- sql("create datamap dm using 'mv' dmproperties('dictionary_include'='name', 'sort_columns'='name') as select name from maintable")
+ sql("create datamap dm using 'mv' dmproperties('sort_columns'='name') as select name from maintable")
}.getMessage.contains("DMProperties dictionary_include,sort_columns are not allowed for this datamap")
}
diff --git a/integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/complexType/TestCreateTableWithDouble.scala b/integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/complexType/TestCreateTableWithDouble.scala
index f08aa20..e46e3ba 100644
--- a/integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/complexType/TestCreateTableWithDouble.scala
+++ b/integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/complexType/TestCreateTableWithDouble.scala
@@ -64,8 +64,7 @@ class TestCreateTableWithDouble extends QueryTest with BeforeAndAfterAll {
try {
sql("CREATE TABLE doubleComplex2 (Id int, number double, name string, " +
"gamePoint array<double>, mac struct<num:double>) " +
- "STORED BY 'org.apache.carbondata.format' " +
- "TBLPROPERTIES('DICTIONARY_INCLUDE'='number,gamePoint,mac')")
+ "STORED BY 'org.apache.carbondata.format' ")
sql(s"LOAD DATA LOCAL INPATH '$dataPath' INTO TABLE doubleComplex2")
countNum = sql(s"SELECT COUNT(*) FROM doubleComplex2").collect
doubleField = sql(s"SELECT number FROM doubleComplex2 SORT BY Id").collect
diff --git a/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/createTable/TestCreateTableAsSelect.scala b/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/createTable/TestCreateTableAsSelect.scala
index 8e4d8fa..7591cd0 100644
--- a/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/createTable/TestCreateTableAsSelect.scala
+++ b/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/createTable/TestCreateTableAsSelect.scala
@@ -145,25 +145,6 @@ class TestCreateTableAsSelect extends QueryTest with BeforeAndAfterAll {
checkAnswer(sql("select * from ctas_select_direct_data"), Seq(Row(300, "carbondata")))
}
- test("test create table as select with TBLPROPERTIES") {
- sql("DROP TABLE IF EXISTS ctas_tblproperties_testt")
- sql(
- "create table ctas_tblproperties_testt stored by 'carbondata' TBLPROPERTIES" +
- "('DICTIONARY_INCLUDE'='key', 'sort_scope'='global_sort') as select * from carbon_ctas_test")
- checkAnswer(sql("select * from ctas_tblproperties_testt"), sql("select * from carbon_ctas_test"))
- val carbonTable = CarbonEnv.getInstance(Spark2TestQueryExecutor.spark).carbonMetaStore
- .lookupRelation(Option("default"), "ctas_tblproperties_testt")(Spark2TestQueryExecutor.spark)
- .asInstanceOf[CarbonRelation].carbonTable
- val metadataFolderPath: CarbonFile = FileFactory.getCarbonFile(carbonTable.getMetadataPath)
- assert(metadataFolderPath.exists())
- val dictFiles: Array[CarbonFile] = metadataFolderPath.listFiles(new CarbonFileFilter {
- override def accept(file: CarbonFile): Boolean = {
- file.getName.contains(".dict") || file.getName.contains(".sortindex")
- }
- })
- assert(dictFiles.length == 3)
- }
-
test("test create table as select with column name as tupleid") {
intercept[Exception] {
sql("create table t2 stored by 'carbondata' as select count(value) AS tupleid from carbon_ctas_test")
diff --git a/integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParserUtil.scala b/integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParserUtil.scala
index 60e5cad..92c1283 100644
--- a/integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParserUtil.scala
+++ b/integration/spark2/src/main/scala/org/apache/spark/sql/parser/CarbonSparkSqlParserUtil.scala
@@ -30,6 +30,7 @@ import org.apache.spark.sql.execution.command.{PartitionerField, TableModel, Tab
import org.apache.spark.sql.execution.command.table.{CarbonCreateTableAsSelectCommand, CarbonCreateTableCommand}
import org.apache.spark.sql.types.StructField
+import org.apache.carbondata.common.exceptions.DeprecatedFeatureException
import org.apache.carbondata.common.exceptions.sql.MalformedCarbonCommandException
import org.apache.carbondata.core.constants.CarbonCommonConstants
import org.apache.carbondata.core.datastore.impl.FileFactory
@@ -135,6 +136,11 @@ object CarbonSparkSqlParserUtil {
}
// validate tblProperties
+ if (tableProperties.contains(CarbonCommonConstants.DICTIONARY_INCLUDE) ||
+ tableProperties.contains(CarbonCommonConstants.DICTIONARY_EXCLUDE)) {
+ throw new DeprecatedFeatureException("global dictionary")
+ }
+
val bucketFields = parser.getBucketFields(tableProperties, fields, options)
var isTransactionalTable: Boolean = true