[fix](view)Fix show create view not display column_definition - #55819
Merged
Conversation
zddr
requested review from
CalvinKirs,
dataroaring and
morningman
as code owners
September 9, 2025 10:25
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
run buildall |
Contributor
FE UT Coverage ReportIncrement line coverage |
TPC-H: Total hot run time: 34841 ms |
TPC-DS: Total hot run time: 188572 ms |
ClickBench: Total hot run time: 30.19 s |
Contributor
FE Regression Coverage ReportIncrement line coverage |
Contributor
Author
|
run buildall |
TPC-H: Total hot run time: 34903 ms |
TPC-DS: Total hot run time: 189560 ms |
ClickBench: Total hot run time: 29.4 s |
Contributor
FE UT Coverage ReportIncrement line coverage |
Contributor
FE Regression Coverage ReportIncrement line coverage |
Contributor
Author
|
run cloud_p0 |
Contributor
FE Regression Coverage ReportIncrement line coverage |
morrySnow
approved these changes
Sep 16, 2025
Contributor
|
PR approved by at least one committer and no changes requested. |
Contributor
|
PR approved by anyone and no changes requested. |
CalvinKirs
approved these changes
Sep 16, 2025
morrySnow
pushed a commit
that referenced
this pull request
Oct 17, 2025
Hastyshell
pushed a commit
to Hastyshell/doris
that referenced
this pull request
Nov 12, 2025
yiguolei
pushed a commit
to yiguolei/incubator-doris
that referenced
this pull request
Dec 19, 2025
16 tasks
englefly
added a commit
to englefly/incubator-doris
that referenced
this pull request
Aug 7, 2026
…s in SHOW CREATE VIEW ### What problem does this PR solve? Issue Number: None Related PR: apache#55819 Problem Summary: The SHOW CREATE VIEW column-list quoting fix (SqlUtils.getIdentSql in Env.addColNameAndComment) changes the emitted DDL: every view column name in the column definition list is now backtick-quoted, e.g. (user_id,cost) becomes (`user_id`,`cost`). The 7 affected regression .out files are regenerated accordingly, and the hardcoded assertion in mtmv_p0/test_show_create_mtmv is updated to expect the quoted column list (`aa` comment 'aa_comment',`bb`). The replica-3 golden blocks in test_show_create_table_and_views_nereids.out are unchanged by this PR and are preserved. ### Release note None ### Check List (For Author) - Test: Regression test (all 8 listed suites run with -forceGenOut to regenerate, then re-run without the flag and verified passing) - Behavior changed: No (test-only changes) - Does this need documentation: No
englefly
added a commit
that referenced
this pull request
Aug 10, 2026
### What problem does this PR solve? Issue Number: None Related PR: #55819 Problem Summary: When a view is created with a column name containing special characters (e.g. `create view v as select 1 as '(第一列)'` with enable_unicode_name_support enabled), SHOW CREATE VIEW emits an unquoted column definition list like `((第一列))` — the outer parens are the list, the inner `(第一列)` is the raw column name emitted without backtick quoting. The generated DDL is not re-executable: the CREATE VIEW column list grammar requires an identifier (DorisParser.g4 simpleColumnDef -> identifier), and an unquoted name with parens fails to parse (`mismatched input '第一列'`). The column list itself was introduced by #55819 to preserve explicit column definitions/comments in SHOW CREATE VIEW, but Env.addColNameAndComment (Env.java) emitted column names verbatim. Fix: quote every column name with SqlUtils.getIdentSql (backtick-quoting with embedded-backtick escaping) and escape single quotes in column comments. After the fix SHOW CREATE VIEW outputs `CREATE VIEW `v` (`(第一列)`) AS select 1 as `(第一列)`;` which is valid SQL and round-trips.
wyxxxcat
pushed a commit
to wyxxxcat/doris
that referenced
this pull request
Aug 17, 2026
…e#66467) ### What problem does this PR solve? Issue Number: None Related PR: apache#55819 Problem Summary: When a view is created with a column name containing special characters (e.g. `create view v as select 1 as '(第一列)'` with enable_unicode_name_support enabled), SHOW CREATE VIEW emits an unquoted column definition list like `((第一列))` — the outer parens are the list, the inner `(第一列)` is the raw column name emitted without backtick quoting. The generated DDL is not re-executable: the CREATE VIEW column list grammar requires an identifier (DorisParser.g4 simpleColumnDef -> identifier), and an unquoted name with parens fails to parse (`mismatched input '第一列'`). The column list itself was introduced by apache#55819 to preserve explicit column definitions/comments in SHOW CREATE VIEW, but Env.addColNameAndComment (Env.java) emitted column names verbatim. Fix: quote every column name with SqlUtils.getIdentSql (backtick-quoting with embedded-backtick escaping) and escape single quotes in column comments. After the fix SHOW CREATE VIEW outputs `CREATE VIEW `v` (`(第一列)`) AS select 1 as `(第一列)`;` which is valid SQL and round-trips.
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.
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)