-
Notifications
You must be signed in to change notification settings - Fork 994
feat(hive,spark)!: Support CHANGE COLUMN statements in Hive and CHANGE/ALTER COLUMN statements in Spark #6004
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
feat(hive,spark)!: Support CHANGE COLUMN statements in Hive and CHANGE/ALTER COLUMN statements in Spark #6004
Conversation
Thanks, we'll take a look soon. |
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 for the PR! Left some comments.
* updated syntax handling constant name * Inherit ALTER_PARSERS from parser.Parser * fix column name parsing * revised rename handling
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.
Looks reasonable. Thanks for addressing the comments!
sqlglot/dialects/spark2.py
Outdated
if new_name == this: | ||
if comment: | ||
return f"ALTER COLUMN {this} COMMENT {comment}" | ||
return super(Hive.Generator, self).altercolumn_sql(expression) |
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.
We can simplify this a bit right?
return super(Hive.Generator, self).altercolumn_sql(expression) | |
return super().altercolumn_sql(expression) |
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.
Ended up reverting this, it seems like it didn't like it.
Documentation:
I validated that the test case output were considered syntactically valid by their respective engines.