You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by kunal642 <gi...@git.apache.org> on 2018/12/03 04:39:13 UTC
[GitHub] carbondata pull request #2940: [CARBONDATA-3116] Support set carbon.query.di...
Github user kunal642 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2940#discussion_r238142863
--- Diff: integration/spark-common-test/src/test/scala/org/apache/carbondata/integration/spark/testsuite/preaggregate/TestPreAggCreateCommand.scala ---
@@ -463,6 +464,39 @@ class TestPreAggCreateCommand extends QueryTest with BeforeAndAfterAll {
executorService.shutdown()
}
+ test("support set carbon.query.directQueryOnDataMap.enabled=true") {
+ val rootPath = new File(this.getClass.getResource("/").getPath
+ + "../../../..").getCanonicalPath
+ val testData = s"$rootPath/integration/spark-common-test/src/test/resources/sample.csv"
+ sql("drop table if exists mainTable")
+ sql(
+ s"""
+ | CREATE TABLE mainTable
+ | (id Int,
+ | name String,
+ | city String,
+ | age Int)
+ | STORED BY 'org.apache.carbondata.format'
+ """.stripMargin);
+
+
+ sql(
+ s"""
+ | LOAD DATA LOCAL INPATH '$testData'
+ | into table mainTable
+ """.stripMargin);
+
+ sql(
+ s"""
+ | create datamap preagg_sum on table mainTable
+ | using 'preaggregate'
+ | as select id,sum(age) from mainTable group by id
+ """.stripMargin);
+
+ sql("set carbon.query.directQueryOnDataMap.enabled=true");
--- End diff --
Setting this property here would not be of use as this property is never validated in tests.
Check https://github.com/apache/carbondata/blob/master/integration/spark-common/src/main/scala/org/apache/spark/sql/test/util/QueryTest.scala#L45 for reference
---