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

pyflink DataStream filter error.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: 1.12.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      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

            People

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

              Dates

              • Created:
                Updated:
                Resolved: