HIVE-29610: Add support for SQL wildcards (% and _) in SHOW COLUMNS aligning with other SHOW commands#6481
HIVE-29610: Add support for SQL wildcards (% and _) in SHOW COLUMNS aligning with other SHOW commands#6481Aggarwal-Raghav wants to merge 2 commits into
Conversation
…ligning with other SHOW commands
|
After HIVE-23359 the behaviour in Hive3 vs Hive4.0.1 for regex pattern was changed i.e. breaking change until HIVE-28292 was merged. The following overloaded method where In |
|
CC @wecharyu @deniskuzZ , requesting for review and feedback on the approach. |
|
UT failure is un-related. will re-run post review comments |
soumyakanti3578
left a comment
There was a problem hiding this comment.
Overall this looks quite good, but needs cleaning up in a few places and also needs more tests.
| SHOW TABLES LIKE 'wild%'; | ||
| SHOW TABLES LIKE 'wild*'; | ||
| SHOW TABLES LIKE 'none|wildcard_table'; |
There was a problem hiding this comment.
These seem out of scope as this PR is fixing SHOW COLUMNS ... LIKE.
There was a problem hiding this comment.
These tests were out of place in the show columns test file. You can add these in an appropriate file for show tables if these are missing.
|
|
Thanks for the review @soumyakanti3578 , I've addressed the review comments. |
| SHOW COLUMNS FROM wildcard_table LIKE 'another_mixed_col'; | ||
| SHOW COLUMNS FROM wildcard_table LIKE 'id*'; | ||
| SHOW COLUMNS FROM wildcard_table LIKE 'id_primary|name_first'; | ||
|
|
There was a problem hiding this comment.
I think we still need to test escape sequences. For example, add another column to the table - idxprimary or something similar, and test with
SHOW COLUMNS FROM wildcard_table LIKE 'id\_primary';
which should return just id_primary and not idxprimary.



What changes were proposed in this pull request?
Check HIVE-29610
Why are the changes needed?
ShowColumnsOperationdoesn't make use ofUDFLike#likePatternToRegExp()and only resolve*regex pattern and not the%which was introduced in HIVE-23359.Does this PR introduce any user-facing change?
Yes, show columns will start supporint query like
SHOW COLUMNS FROM tbl LIKE 'name_%';and will be backward compatible to support*.How was this patch tested?
Running the following UT and cluster testing
Before

After
