HIVE-29059: SHOW CREATE TABLE ignores all strings after tab character for VIEWs#6563
Open
cyanzheng2926 wants to merge 1 commit into
Open
Conversation
|
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes HIVE-29059 where SHOW CREATE TABLE for VIEWs can truncate output after literal tab characters by escaping tab characters in the rendered VIEW DDL, and adds a qtest covering several tab-containing VIEW definitions.
Changes:
- Escape literal tab characters (
\t) inSHOW CREATE TABLEoutput for VIEWs. - Add a new clientpositive qtest that creates/views with tabs in whitespace and string literals and verifies
\tescaping. - Add the corresponding LLAP expected output file for the new qtest.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/create/show/ShowCreateTableOperation.java |
Escapes tab characters in the generated CREATE VIEW statement before writing results. |
ql/src/test/queries/clientpositive/show_create_table_tab_view.q |
New qtest query file exercising tab characters in VIEW definitions and literals. |
ql/src/test/results/clientpositive/llap/show_create_table_tab_view.q.out |
New LLAP golden output validating \t escaping and non-view behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1
to
+3
| -- Test SHOW CREATE TABLE when view is expanded text contains a tab (HIVE-29059). | ||
| -- IDE may replace tabs with spaces during edit. | ||
| -- This test qfile requires actual tabs instead of soft tabs/spaces to function properly |
Comment on lines
56
to
+57
| if (table.isView()) { | ||
| command = ddlObj.getCreateViewCommand(table, desc.isRelative()); | ||
| command = ddlObj.getCreateViewCommand(table, desc.isRelative()).replace("\t", "\\t"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



… for views
What changes were proposed in this pull request?
Addresses the issue for HIVE-29059 when a view is created with actual tabs, the SHOW CREATE TABLE output would truncate all strings after the tab.
Why are the changes needed?
SHOW CREATE TABLE of a view's create comment containing tab characters should have the same behaviour as COMMENTs when running SHOW CREATE TABLE on a normal table, which should display tab as \t instead of truncating all contents after it.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Created show_create_table_tab_view.q which contains testing tab for several cases