-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-45418][SQL][PYTHON][CONNECT] Change current_database() column alias to current_schema() #43235
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
4e3f072 to
35e9b77
Compare
| override def dataType: DataType = StringType | ||
| override def nullable: Boolean = false | ||
| override def prettyName: String = "current_database" | ||
| override def prettyName: String = "current_schema" |
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.
If we change current_database to current_schema, we should rename CurrentDatabase to CurrentSchema.
How about using current_database as a unified 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.
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.
CurrentDatabase was there since 1.6.0 and seems safer to not rename it now. The expression class name is not user-facing anyway.
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.
AFAIK schema is a more standard name to reference to a namespace that keeps database objects.
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.
So, how about using current_database as a unified name? it is consistent with class 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.
Sorry I'm a bit confused. This PR tries to use the name schema more widely as it's more SQL standard. Are you saying no to this PR and want to stick with database?
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 know this PR want to use the name schema here, it's okay. However, it caused inconsistent between the class name of the CurrentDatabase and its prettyName. Is this a problem? If not, then it's okay.
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.
It's fine, TruncTimestamp overrides prettyName as date_trunc
|
also cc @cloud-fan @peter-toth |
|
thanks, merging to master! |
What changes were proposed in this pull request?
Change column alias for current_database() to current_schema.
Why are the changes needed?
To better align with preferred usage of schema rather than database for three part namespace.
Does this PR introduce any user-facing change?
Yes,
current_database()column alias is nowcurrent_schema().How was this patch tested?
Unit tests pass.
Was this patch authored or co-authored using generative AI tooling?
No.