[ 
https://issues.apache.org/jira/browse/FLINK-22728?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dian Fu closed FLINK-22728.
---------------------------
    Resolution: Not A Problem

> a problem of loading udf
> ------------------------
>
>                 Key: FLINK-22728
>                 URL: https://issues.apache.org/jira/browse/FLINK-22728
>             Project: Flink
>          Issue Type: Bug
>          Components: API / Python
>    Affects Versions: 1.13.0
>         Environment: python3.7
> centos 8
> pyflink1.13.0
> java1.11
>            Reporter: JYXL
>            Priority: Major
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> hi:
>  I'm using the stream udf by python.
>  udf as bellow:
>  
>  class MyKeySelector(KeySelector):
>  def __init__(self, partitions: int=6):
>  self.partitions = partitions
>  def get_key(self, value):
>  return random.randint(0, self.partitions)
>  
>  when I code it with the main task in the same script, it works, 
>  but when I make it in a simgle script, it cannot work.
>  the archives as bellow:
>  
>  project:
>      | __init__.py
>      | key_function.py
>      | main_task.py
>  
>  I'm confused when I use env.add_python_file method, it cannot work either, 
>  no matter the parameter `file_path` is '~/project' or 
> '~/project/key_function.py.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to