Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-20715

pyflink DataStream filter error.

Agile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Bug
    • 1.12.0
    • None
    • None
    • Flink 1.12

    Description

      ```
      class MyFilterFunction(FilterFunction):

      def filter(self, value):
      return value[0] % 2 == 0

      def demo_stream():
      see = StreamExecutionEnvironment.get_execution_environment()
      see.set_parallelism(1)
      ds = see.from_collection([(1, 'Hi', 'Hello'), (2, 'Hello', 'Hi')],
      type_info=Types.ROW(
      [Types.INT(), Types.STRING(), Types.STRING()])
      )
      ds.filter(MyFilterFunction()).print()
      ds.print()

      1. 执行任务;
        see.execute('job1')

      if _name_ == '_main_':
      demo_stream()
      ```

       

          raise Py4JError(    raise Py4JError(py4j.protocol.Py4JError: An error occurred while calling o0._getstate. Trace:org.apache.flink.api.python.shaded.py4j.Py4JException: Method __getstate_([]) does not exist at org.apache.flink.api.python.shaded.py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:318) at org.apache.flink.api.python.shaded.py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:326) at org.apache.flink.api.python.shaded.py4j.Gateway.invoke(Gateway.java:274) 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)

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            kingreatwill Enter
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment