[
https://issues.apache.org/jira/browse/CALCITE-489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Vladimir Sitnikov reopened CALCITE-489:
---------------------------------------
Need more corrections.
I believe we should avoid mess with multiple ConnectionFactories
implementations.
Otherwise things like unimplmentedexception would be here and there.
And some surprises would be hidden: CalciteAssert.that().with("prop",
"value").with(CalciteAssert.Config.FOODMART_CLONE) silently ignores "prop". I
believe it is bad.
For instance:
{code:java}
@Test public void testJoinCorreScalarSubQ()
throws ClassNotFoundException, SQLException {
CalciteAssert.that()
.with(CalciteAssert.Config.FOODMART_CLONE)
.with(CalciteConnectionProperty.LEX.name(), Lex.JAVA.toString())
.query("select e.employee_id, d.department_id "
+ " from employee e, department d "
+ " where e.department_id = d.department_id and "
+ " e.salary > (select avg(e2.salary) "
+ " from employee e2 "
+ " where e2.store_id = e.store_id)"
).returnsCount(0);
}
{code}
Fails with:
{noformat}
java.lang.UnsupportedOperationException
at
org.apache.calcite.test.CalciteAssert$AbstractConnectionFactory.with(CalciteAssert.java:949)
at
org.apache.calcite.test.CalciteAssert$AssertThat.with(CalciteAssert.java:799)
at
org.apache.calcite.test.JdbcTest.testJoinCorreScalarSubQ2(JdbcTest.java:4235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
at
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
{noformat}
> Teach CalciteAssert to respect multiple settings
> ------------------------------------------------
>
> Key: CALCITE-489
> URL: https://issues.apache.org/jira/browse/CALCITE-489
> Project: Calcite
> Issue Type: Bug
> Affects Versions: 1.0.0-incubating
> Reporter: Vladimir Sitnikov
> Assignee: Julian Hyde
> Labels: newbie
> Fix For: 1.0.0-incubating
>
>
> Currently {{CalciteAssert}} allows to specify _either_ custom connection
> properties via {{with(Map)}} or custom schema via {{with(String, Object)}}.
> Often it is required to set both simultaneously:
> For instance, {{lex=JAVA}} is an easy way to write queries without quotes.
> For testing correlation runtime, it is required to set
> {{forceDecorrelate=true/false}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)