英文:
How to use CalciteAssert when test my own adapter?
问题
@Test public void testFilter() {
CalciteAssert.that()
.with(TWISSANDRA)
.query("select * from \"userline\" where \"username\"='!PUBLIC!'")
.limit(1)
.returns("username=!PUBLIC!; time=e8754000-80b8-1fe9-8e73-e3698c967ddd; "
+ "tweet_id=f3c329de-d05b-11e5-b58b-90e2ba530b12\n")
.explainContains("PLAN=CassandraToEnumerableConverter\n"
+ " CassandraFilter(condition=[=($0, '!PUBLIC!')])\n"
+ " CassandraTableScan(table=[[twissandra, userline]]");
}
英文:
I wrote a calcite adapter and now I want to write some tests to verify my physical plan. I want to use CalciteAssert to do that like in Cassandra Adapter, but outside the Calcite Project how can I do that?
@Test public void testFilter() {
CalciteAssert.that()
.with(TWISSANDRA)
.query("select * from \"userline\" where \"username\"='!PUBLIC!'")
.limit(1)
.returns("username=!PUBLIC!; time=e8754000-80b8-1fe9-8e73-e3698c967ddd; "
+ "tweet_id=f3c329de-d05b-11e5-b58b-90e2ba530b12\n")
.explainContains("PLAN=CassandraToEnumerableConverter\n"
+ " CassandraFilter(condition=[=($0, '!PUBLIC!')])\n"
+ " CassandraTableScan(table=[[twissandra, userline]]");
}
答案1
得分: 1
目前有关将来更改此内容的讨论,但目前您可以将测试代码添加为项目的依赖项。在Maven中,这将类似于以下内容:
<dependency>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-core</artifactId>
<version>1.20.0</version>
<classifier>tests</classifier>
<type>test-jar</type>
</dependency>
英文:
There has been talk of changing this in the future, but currently you can add the test code as a dependency to your project. In Maven, this would look something like this:
<dependency>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-core</artifactId>
<version>1.20.0</version>
<classifier>tests</classifier>
<type>test-jar</type>
</dependency>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论