-
Notifications
You must be signed in to change notification settings - Fork 328
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
feat: implement DESCRIBE TABLE #558
Conversation
Support DESC[RIBE] TABLE sql clause. Returns following info about table columns: name, type, nullable, default, semantic type.
Codecov Report
@@ Coverage Diff @@
## develop #558 +/- ##
===========================================
+ Coverage 86.38% 86.44% +0.06%
===========================================
Files 398 399 +1
Lines 50042 50610 +568
===========================================
+ Hits 43229 43752 +523
- Misses 6813 6858 +45
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
Thanks @morigs ! This patch is very neat 👍
I've tried it in my local, it works as expect:
mysql> desc table t;
+--------+-----------+------+---------------------+---------------+
| Field | Type | Null | Default | Semantic Type |
+--------+-----------+------+---------------------+---------------+
| host | String | NO | | PRIMARY KEY |
| ts | Timestamp | NO | current_timestamp() | TIME INDEX |
| cpu | Float64 | NO | 0 | VALUE |
| memory | Float64 | YES | | VALUE |
+--------+-----------+------+---------------------+---------------+
(created by)
mysql> CREATE TABLE t (
-> host STRING,
-> ts TIMESTAMP DEFAULT current_timestamp,
-> cpu DOUBLE DEFAULT 0,
-> memory DOUBLE NULL,
-> TIME INDEX (ts),
-> PRIMARY KEY(host)) ENGINE=mito WITH(regions=1);
Query OK, 1 row affected (0.06 sec)
Not sure about Display for Value implementation. Perhaps it should be more sql-ish
Implement Display
for Value
looks good to me. In another patch I also use Display
to draw SQL result table (here https://github.com/GreptimeTeam/greptimedb/blob/integration-test/tests/runner/src/util.rs#L3)
Thanks for the feedback. I'll fix this soon |
Adds support for fully-qualified table names in DESCRIBE TABLE queries.
Currently I'm Ok with the catalog/schema name issue and marked these are resolved. Please fix other comments and we can merge this PR as soon as possible. Don't hesitate to reach us if you need any help! |
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.
LGTM
Also need to support describe table in other catalog/schema
I hereby agree to the terms of the GreptimeDB CLA
What's changed and what's your intention?
Support DESC[RIBE] TABLE sql clause. Returns following info about table columns: name, type, nullable, default, semantic type.
Not sure about
Display for Value
implementation. Perhaps it should be more sql-ishChecklist
Refer to a related PR or issue link (optional)
Resolves #534