开发者社区> 问答> 正文

PyFlink 作业client 端异常输出的示例是什么?

PyFlink 作业client 端异常输出的示例是什么?

展开
收起
游客qzzytmszf3zhq 2021-12-07 15:19:50 301 0
1 条回答
写回答
取消 提交回答
  • PyFlink 作业也遵循 Flink 作业的提交方式,作业首先会在 client 端编译成 JobGraph,然后提交到 Flink 集群执行。如果作业编译有问题,会导致在 client 端提交作业的时候就抛出异常,此时可以在 client 端看到类似这样的输出:
    
    Traceback (most recent call last):
      File "/Users/dianfu/code/src/github/pyflink-usecases/datastream_api_demo.py", line 50, in <module>
        data_stream_api_demo()
      File "/Users/dianfu/code/src/github/pyflink-usecases/datastream_api_demo.py", line 45, in data_stream_api_demo
        table_result = table.execute_insert("my_")
      File "/Users/dianfu/venv/pyflink-usecases/lib/python3.8/site-packages/pyflink/table/table.py", line 864, in execute_insert
        return TableResult(self._j_table.executeInsert(table_path, overwrite))
      File "/Users/dianfu/venv/pyflink-usecases/lib/python3.8/site-packages/py4j/java_gateway.py", line 1285, in __call__
        return_value = get_return_value(
      File "/Users/dianfu/venv/pyflink-usecases/lib/python3.8/site-packages/pyflink/util/exceptions.py", line 162, in deco
        raise java_exception
    pyflink.util.exceptions.TableException: Sink `default_catalog`.`default_database`.`my_` does not exists
         at org.apache.flink.table.planner.delegation.PlannerBase.translateToRel(PlannerBase.scala:247)
         at org.apache.flink.table.planner.delegation.PlannerBase$$anonfun$1.apply(PlannerBase.scala:159)
         at org.apache.flink.table.planner.delegation.PlannerBase$$anonfun$1.apply(PlannerBase.scala:159)
         at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
         at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
         at scala.collection.Iterator$class.foreach(Iterator.scala:891)
         at scala.collection.AbstractIterator.foreach(Iterator.scala:1334)
         at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
         at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
         at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
         at scala.collection.AbstractTraversable.map(Traversable.scala:104)
         at org.apache.flink.table.planner.delegation.PlannerBase.translate(PlannerBase.scala:159)
         at org.apache.flink.table.api.internal.TableEnvironmentImpl.translate(TableEnvironmentImpl.java:1329)
         at org.apache.flink.table.api.internal.TableEnvironmentImpl.executeInternal(TableEnvironmentImpl.java:676)
         at org.apache.flink.table.api.internal.TableImpl.executeInsert(TableImpl.java:572)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:498)
         at org.apache.flink.api.python.shaded.py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
         at org.apache.flink.api.python.shaded.py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
         at org.apache.flink.api.python.shaded.py4j.Gateway.invoke(Gateway.java:282)
         at org.apache.flink.api.python.shaded.py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)
         at org.apache.flink.api.python.shaded.py4j.commands.CallCommand.execute(CallCommand.java:79)
         at org.apache.flink.api.python.shaded.py4j.GatewayConnection.run(GatewayConnection.java:238)
         at java.lang.Thread.run(Thread.java:748)
    
    Process finished with exit code 1
    比如上述报错说明作业中使用的名字为"my_"的表不存在。
    
    2021-12-07 15:20:03
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
gohbase :HBase go客户端 立即下载
《Apache Flink-重新定义计算》PDF下载 立即下载
Monitoring the Dynamic Resource Usage of Scala and Python Spark Jobs in Yarn 立即下载