You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Xuannan Su (Jira)" <ji...@apache.org> on 2022/07/13 02:16:00 UTC

[jira] [Created] (FLINK-28526) Fail to lateral join with UDTF from Table with timstamp column

Xuannan Su created FLINK-28526:
----------------------------------

             Summary: Fail to lateral join with UDTF from Table with timstamp column
                 Key: FLINK-28526
                 URL: https://issues.apache.org/jira/browse/FLINK-28526
             Project: Flink
          Issue Type: Bug
          Components: API / Python
    Affects Versions: 1.15.1
            Reporter: Xuannan Su


The bug can be reproduced with the following test


{code:python}
    def test_flink(self):
        env = StreamExecutionEnvironment.get_execution_environment()
        t_env = StreamTableEnvironment.create(env)
        table = t_env.from_descriptor(
            TableDescriptor.for_connector("filesystem")
            .schema(
                Schema.new_builder()
                .column("name", DataTypes.STRING())
                .column("cost", DataTypes.INT())
                .column("distance", DataTypes.INT())
                .column("time", DataTypes.TIMESTAMP(3))
                .watermark("time", "`time` - INTERVAL '60' SECOND")
                .build()
            )
            .format("csv")
            .option("path", "./input.csv")
            .build()
        )

        @udtf(result_types=DataTypes.INT())
        def table_func(row: Row):
            return row.cost + row.distance

        table = table.join_lateral(table_func.alias("cost_times_distance"))

        table.execute().print()
{code}

It causes the following exception


{code:none}
E       pyflink.util.exceptions.TableException: org.apache.flink.table.api.TableException: Unsupported Python SqlFunction CAST.
E       	at org.apache.flink.table.planner.plan.nodes.exec.utils.CommonPythonUtil.createPythonFunctionInfo(CommonPythonUtil.java:146)
E       	at org.apache.flink.table.planner.plan.nodes.exec.utils.CommonPythonUtil.createPythonFunctionInfo(CommonPythonUtil.java:429)
E       	at org.apache.flink.table.planner.plan.nodes.exec.utils.CommonPythonUtil.createPythonFunctionInfo(CommonPythonUtil.java:135)
E       	at org.apache.flink.table.planner.plan.nodes.exec.common.CommonExecPythonCorrelate.extractPythonTableFunctionInfo(CommonExecPythonCorrelate.java:133)
E       	at org.apache.flink.table.planner.plan.nodes.exec.common.CommonExecPythonCorrelate.createPythonOneInputTransformation(CommonExecPythonCorrelate.java:106)
E       	at org.apache.flink.table.planner.plan.nodes.exec.common.CommonExecPythonCorrelate.translateToPlanInternal(CommonExecPythonCorrelate.java:95)
E       	at org.apache.flink.table.planner.plan.nodes.exec.ExecNodeBase.translateToPlan(ExecNodeBase.java:148)
E       	at org.apache.flink.table.planner.plan.nodes.exec.ExecEdge.translateToPlan(ExecEdge.java:249)
E       	at org.apache.flink.table.planner.plan.nodes.exec.stream.StreamExecSink.translateToPlanInternal(StreamExecSink.java:136)
E       	at org.apache.flink.table.planner.plan.nodes.exec.ExecNodeBase.translateToPlan(ExecNodeBase.java:148)
E       	at org.apache.flink.table.planner.delegation.StreamPlanner.$anonfun$translateToPlan$1(StreamPlanner.scala:79)
E       	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:233)
E       	at scala.collection.Iterator.foreach(Iterator.scala:937)
E       	at scala.collection.Iterator.foreach$(Iterator.scala:937)
E       	at scala.collection.AbstractIterator.foreach(Iterator.scala:1425)
E       	at scala.collection.IterableLike.foreach(IterableLike.scala:70)
E       	at scala.collection.IterableLike.foreach$(IterableLike.scala:69)
E       	at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
E       	at scala.collection.TraversableLike.map(TraversableLike.scala:233)
E       	at scala.collection.TraversableLike.map$(TraversableLike.scala:226)
E       	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
E       	at org.apache.flink.table.planner.delegation.StreamPlanner.translateToPlan(StreamPlanner.scala:78)
E       	at org.apache.flink.table.planner.delegation.PlannerBase.translate(PlannerBase.scala:181)
E       	at org.apache.flink.table.api.internal.TableEnvironmentImpl.translate(TableEnvironmentImpl.java:1656)
E       	at org.apache.flink.table.api.internal.TableEnvironmentImpl.executeQueryOperation(TableEnvironmentImpl.java:828)
E       	at org.apache.flink.table.api.internal.TableEnvironmentImpl.executeInternal(TableEnvironmentImpl.java:1317)
E       	at org.apache.flink.table.api.internal.TableImpl.execute(TableImpl.java:605)
E       	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
E       	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
E       	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
E       	at java.lang.reflect.Method.invoke(Method.java:498)
E       	at org.apache.flink.api.python.shaded.py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
E       	at org.apache.flink.api.python.shaded.py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
E       	at org.apache.flink.api.python.shaded.py4j.Gateway.invoke(Gateway.java:282)
E       	at org.apache.flink.api.python.shaded.py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
E       	at org.apache.flink.api.python.shaded.py4j.commands.CallCommand.execute(CallCommand.java:79)
E       	at org.apache.flink.api.python.shaded.py4j.GatewayConnection.run(GatewayConnection.java:238)
E       	at java.lang.Thread.run(Thread.java:748)
{code}





--
This message was sent by Atlassian Jira
(v8.20.10#820010)