You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the test case to pass, (may need some tweaking as its just a cut & paste job).
Actual behaviour
NPE thrown :
io.confluent.ksql.util.KsqlStatementException: source
Statement: CREATE TABLE OUTPUT AS SELECT
TEST.ID ID,
EXPLODE(TEST.MY_ARR) VAL
FROM TEST TEST
EMIT CHANGES
Statement: CREATE TABLE OUTPUT AS SELECT ID, EXPLODE(MY_ARR) VAL FROM TEST;
at io.confluent.ksql.test.tools.TestExecutorUtil.execute(TestExecutorUtil.java:321)
at io.confluent.ksql.test.tools.TestExecutorUtil.lambda$execute$3(TestExecutorUtil.java:267)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at io.confluent.ksql.test.tools.TestExecutorUtil.execute(TestExecutorUtil.java:278)
at io.confluent.ksql.test.tools.TestExecutorUtil.doBuildQueries(TestExecutorUtil.java:210)
at io.confluent.ksql.test.tools.TestExecutorUtil.buildStreamsTopologyTestDrivers(TestExecutorUtil.java:100)
at io.confluent.ksql.test.tools.TestExecutor.buildAndExecuteQuery(TestExecutor.java:135)
at io.confluent.ksql.test.EndToEndEngineTestUtil.shouldBuildAndExecuteQuery(EndToEndEngineTestUtil.java:46)
at io.confluent.ksql.test.QueryTranslationTest.shouldBuildAndExecuteQueries(QueryTranslationTest.java:82)
at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
Caused by: java.lang.NullPointerException: source
at java.util.Objects.requireNonNull(Objects.java:228)
at io.confluent.ksql.execution.plan.StreamFlatMap.<init>(StreamFlatMap.java:40)
at io.confluent.ksql.execution.streams.ExecutionStepFactory.streamFlatMap(ExecutionStepFactory.java:195)
at io.confluent.ksql.structured.SchemaKStream.flatMap(SchemaKStream.java:539)
at io.confluent.ksql.planner.plan.FlatMapNode.buildStream(FlatMapNode.java:113)
at io.confluent.ksql.planner.plan.ProjectNode.buildStream(ProjectNode.java:102)
at io.confluent.ksql.planner.plan.KsqlStructuredDataOutputNode.buildStream(KsqlStructuredDataOutputNode.java:114)
at io.confluent.ksql.physical.PhysicalPlanBuilder.buildPhysicalPlan(PhysicalPlanBuilder.java:73)
at io.confluent.ksql.engine.QueryEngine.buildPhysicalPlan(QueryEngine.java:105)
at io.confluent.ksql.engine.EngineExecutor.planQuery(EngineExecutor.java:201)
at io.confluent.ksql.engine.EngineExecutor.plan(EngineExecutor.java:152)
at io.confluent.ksql.engine.KsqlEngine.plan(KsqlEngine.java:176)
at io.confluent.ksql.engine.KsqlEngine.execute(KsqlEngine.java:196)
at io.confluent.ksql.test.tools.TestExecutorUtil.execute(TestExecutorUtil.java:314)
... 43 more
The text was updated successfully, but these errors were encountered:
This is happening because the source is a SchemaKTable not a SchemaKStream - but the flat mapping code needs a SchemaKStream and the underlying KS KTable doesn't support FlatMap anyway.
We could just explicitly disallow table functions where the source is a table. Easy workaround here is for the user to create the source as a stream, is there any advantage of them using a table here?
purplefox
pushed a commit
to purplefox/ksql
that referenced
this issue
Dec 9, 2019
To Reproduce
Steps to reproduce the behavior, include:
Add this test to
table-functions.json
:Expected behavior
For the test case to pass, (may need some tweaking as its just a cut & paste job).
Actual behaviour
NPE thrown :
The text was updated successfully, but these errors were encountered: