-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[SPARK-3855][SQL] Preserve the result attribute of python UDFs though transformations #2717
Conversation
QA tests have started for PR 2717 at commit
|
It's reproducable by this query:
|
QA tests have finished for PR 2717 at commit
|
Test PASSed. |
@marmbrus Could you add a test in pyhon/pyspark/tests.py (SQLTests) ? |
QA tests have started for PR 2717 at commit
|
QA tests have finished for PR 2717 at commit
|
Test FAILed. |
QA tests have started for PR 2717 at commit
|
QA tests have finished for PR 2717 at commit
|
QA tests have started for PR 2717 at commit
|
QA tests have finished for PR 2717 at commit
|
@@ -679,6 +679,12 @@ def test_udf(self): | |||
[row] = self.sqlCtx.sql("SELECT twoArgs('test', 1)").collect() | |||
self.assertEqual(row[0], 5) | |||
|
|||
def test_udf2(self): | |||
self.sqlCtx.registerFunction("strlen", lambda string: len(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.
data type should be IntegerType
QA tests have started for PR 2717 at commit
|
QA tests have finished for PR 2717 at commit
|
Test FAILed. |
@marmbrus LGTM, just wonder that why you do not use IntegerType as returnType in the tests? I looks wired that we compare stringType with |
@davies, I was lazy and didn't want to look up the syntax for that :P You are right its a little weird, but Hive supports it. |
Jenkins, retest this please. |
QA tests have started for PR 2717 at commit
|
QA tests have finished for PR 2717 at commit
|
Test FAILed. |
Jenkins - retest this please. |
Test FAILed. |
QA tests have started for PR 2717 at commit
|
QA tests have finished for PR 2717 at commit
|
I'd like to pull this in - is that alright @marmbrus? |
Yes, please do.
|
In the current implementation it was possible for the reference to change after analysis.