flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "JYXL (Jira)" <j...@apache.org>
Subject [jira] [Updated] (FLINK-22728) a problem of loading udf
Date Thu, 20 May 2021 13:31:00 GMT

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

JYXL updated FLINK-22728:
-------------------------
    Description: 
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.

  was:
_强调文本_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.


> 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: Blocker
>   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)

Mime
View raw message