Skip to content
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

fix(query): table field data type in show create table incorrect #17112

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

forsaken628
Copy link
Collaborator

@forsaken628 forsaken628 commented Dec 25, 2024

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

create table xx (a array(string),b array(string null),c array(string not null));
show create table xx;

-[ RECORD 1 ]-----------------------------------
       Table: xx
Create Table: CREATE TABLE xx (
  a ARRAY(STRING) NULL,
  b ARRAY(STRING) NULL,
  c ARRAY(STRING) NULL
) ENGINE=FUSE

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Explain why

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-bugfix this PR patches a bug in codebase label Dec 25, 2024
@forsaken628 forsaken628 requested review from TCeason and b41sh and removed request for TCeason December 25, 2024 07:08
@forsaken628
Copy link
Collaborator Author

Any more issues like that?

@forsaken628 forsaken628 requested a review from sundy-li December 25, 2024 07:11
@forsaken628 forsaken628 marked this pull request as ready for review December 25, 2024 14:51
@@ -130,7 +130,7 @@ INSERT INTO TABLE `05_0003_at_t4` values('a', 'b', ['c1', 'c2'], ('d1', 'd2'))
query TT
SHOW CREATE TABLE `05_0003_at_t4`
----
05_0003_at_t4 CREATE TABLE "05_0003_at_t4" ( a VARCHAR NOT NULL, b VARCHAR NULL, c ARRAY(STRING) NULL, d TUPLE(1 STRING, 2 STRING) NULL ) ENGINE=FUSE
05_0003_at_t4 CREATE TABLE "05_0003_at_t4" ( a VARCHAR NOT NULL, b VARCHAR NULL, c ARRAY(VARCHAR NULL) NULL, d TUPLE(1 VARCHAR NULL, 2 VARCHAR NULL) NULL ) ENGINE=FUSE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems there's an extra space?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sqllogictests will ignore extra space. uh.. It's so weird.

let ident = display_ident(field.name(), quoted_ident_case_sensitive, sql_dialect);
let data_type = field.data_type().sql_name_explicit_null();
let column_str =
format!(" {ident} {data_type}{default_expr}{computed_expr}{comment}");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe extra space at start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix this PR patches a bug in codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants