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()
- 执行任务;
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)