-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Enable user defined display_name for ScalarUDF #10417
Conversation
Do you mind adding |
Cool, will do that. |
It's good now. @jayzhan211 You can review it when you are available. :) datafusion/datafusion/core/tests/user_defined/user_defined_aggregates.rs Lines 165 to 176 in 96487ea
apply_function_rewrites , the logical plan would not create an alias because the display_name of get_field is the same as sq.first[value]
In this PR: Before this PR: |
|
||
Ok(format!("{}[{}]", args[0].display_name()?, name)) | ||
} | ||
|
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.
cli in this PR
DataFusion CLI v38.0.0
> select struct('a');
+-------------------+
| struct(Utf8("a")) |
+-------------------+
| {c0: a} |
+-------------------+
1 row(s) fetched.
Elapsed 0.023 seconds.
> select get_field(struct('a'), 'c0');
+-----------------------+
| struct(Utf8("a"))[c0] |
+-----------------------+
| a |
+-----------------------+
1 row(s) fetched.
Elapsed 0.007 seconds.
main branch:
DataFusion CLI v38.0.0
> select struct('a');
+-------------------+
| struct(Utf8("a")) |
+-------------------+
| {c0: a} |
+-------------------+
1 row(s) fetched.
Elapsed 0.014 seconds.
> select get_field(struct('a'), 'c0');
+-----------------------------------------+
| get_field(struct(Utf8("a")),Utf8("c0")) |
+-----------------------------------------+
| a |
+-----------------------------------------+
1 row(s) fetched.
Elapsed 0.004 seconds.
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.
Yeah, this example has better view. 🙌
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.
👍
Thanks @yyy1000 and @jayzhan211 |
* enable user defined display_name * add display_name to get_field * add physical name
Which issue does this PR close?
Closes #10376 .
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?