-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-27337: Trim the starting and trailing white spaces in HMS for cr… #4316
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
HIVE-27337: Trim the starting and trailing white spaces in HMS for cr… #4316
Conversation
…eate and alter queries
...ne-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/HMSHandler.java
Outdated
Show resolved
Hide resolved
aturoczy
left a comment
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.
+1 for normalizeIdentifier
|
Looks like the failed tests related... cloud you please check them? |
| POSTHOOK: Input: default@hbase_table_test_1 | ||
| POSTHOOK: Output: database:default | ||
| POSTHOOK: Output: default@VIEW_HBASE_TABLE_TEST_1 | ||
| POSTHOOK: Lineage: VIEW_HBASE_TABLE_TEST_1.ccount SIMPLE [(hbase_table_test_1)hbase_table_test_1.FieldSchema(name:ccount, type:int, comment:), ] |
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.
nit: do you know why these are converted to lowercased, we don't change the HS2 side.
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.
This is a Post Executor hook, this hook pulls out the metadata info from HMS and prints it out. So this is a expected change.
| + " already exists"); | ||
| } | ||
|
|
||
| tbl.setDbName(normalizeIdentifier(tbl.getDbName())); |
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.
The lineage info will feed into downstream project, so I'm a little nervous when the info changes.
I think we can make changes here like:
Table tbl = new Table(req.getTable());
tbl.setDbName(normalizeIdentifier(tbl.getDbName()));
tbl.setTableName(normalizeIdentifier(tbl.getTableName()));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 tried to implement your suggestion but 29 tests are failing because the tests are doing assert on the Table to construct a table path or table SD or something that is expected to be modified in HMS. So I think this change is not necessary.
Having changes in qfile files that change lineage info (which is anyway expected) is far better than changing 29 tests to do something else. Thanks.
eebb03e to
0ad5061
Compare
|
Kudos, SonarCloud Quality Gate passed! |
…eate and alter queries (apache#4316) (Sai Hemanth G, Reviewed by Zhihua Deng, Attila Turoczy)
…eate and alter queries (apache#4316) (Sai Hemanth G, Reviewed by Zhihua Deng, Attila Turoczy)








…eate and alter queries
What changes were proposed in this pull request?
Trimming the white spaces if provided in create and alter queries.
Why are the changes needed?
If the users are providing white spaces, the queries should execute without issues.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Manual testing. Will add unit tests in the next commit.