-
Notifications
You must be signed in to change notification settings - Fork 13.7k
[FLINK-38508][python] Allow string type specifications in Python UDF … #27106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
final FlinkLogicalTableFunctionScan scan = call.rel(0); | ||
return !RexUtil.containsInputRef(scan.getCall()); | ||
return !RexUtil.containsInputRef(scan.getCall()) | ||
&& PythonUtil.isNonPythonCall(scan.getCall()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am curious why this if has been extended? why is isNonPythonCall important here? Does this have a migration impact?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a unit test for both cases please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently Flink supports the following sql because of the StreamPhysicalConstantTableFunctionRule.
SELECT * FROM LATERAL TABLE(func(1))
If we don't modify this, flink uses the java operator to run the python function. It causes misleading exception here.
I think it's better we use another pr to fix this problem.
'time_param is wrong value %s !' % time_param | ||
return time_param | ||
|
||
@udf(result_type='TIMESTAMP(3)') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we do flink timestamp_ltz as well?
Do you think there is value in testing other TIMESTAMP precisions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
emmm I just move codes from the PyFlinkEmbeddedThreadTests to common test base..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I test timestamp_ltz and I find the results is not correct. I will open another issue to track this.
'array_param is wrong value %s !' % array_param | ||
return array_param[0] | ||
|
||
@udf(result_type='MAP<BIGINT, STRING>') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nested object and array permutations would be worth adding tests for to confirm they are working as expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the result is not corret in pemja. Fix this in FLINK-38526
…decorator for SQL
What is the purpose of the change
Allow to use pyflink function with decorator in sql.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no)Documentation