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

feat: impl show index and show columns #3577

Merged
merged 5 commits into from
Mar 29, 2024

Conversation

killme2008
Copy link
Contributor

@killme2008 killme2008 commented Mar 26, 2024

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

#3354

What's changed and what's your intention?

Impl SHOW COLUMNS FROM [tbl] and SHOW INDEX FROM [tbl].

For example:

SHOW COLUMNS FROM system_metrics;

+-------------+----------------------+------+------------+---------------------+-------+
| Field       | Type                 | Null | Key        | Default             | Extra |
+-------------+----------------------+------+------------+---------------------+-------+
| cpu_util    | Float64              | Yes  |            |                     |       |
| disk_util   | Float64              | Yes  |            |                     |       |
| host        | String               | Yes  | PRI        |                     |       |
| idc         | String               | Yes  | PRI        |                     |       |
| memory_util | Float64              | Yes  |            |                     |       |
| ts          | TimestampMillisecond | No   | TIME INDEX | current_timestamp() |       |
+-------------+----------------------+------+------------+---------------------+-------+

SHOW INDEX FROM system_metrics;

+----------------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+----------------------------+---------+---------------+---------+------------+
| Table          | Non_unique | Key_name   | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type                 | Comment | Index_comment | Visible | Expression |
+----------------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+----------------------------+---------+---------------+---------+------------+
| system_metrics | 1          | PRIMARY    | 1            | host        | A         |             |          |        | YES  | greptime-inverted-index-v1 |         |               | YES     |            |
| system_metrics | 1          | PRIMARY    | 2            | idc         | A         |             |          |        | YES  | greptime-inverted-index-v1 |         |               | YES     |            |
| system_metrics | 1          | TIME INDEX | 1            | ts          | A         |             |          |        | NO   | greptime-inverted-index-v1 |         |               | YES     |            |
+----------------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+----------------------------+---------+---------------+---------+------------+

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR does not require documentation updates.

@github-actions github-actions bot added the docs-not-required This change does not impact docs. label Mar 26, 2024
@github-actions github-actions bot added docs-required This change requires docs update. and removed docs-not-required This change does not impact docs. labels Mar 26, 2024
@killme2008 killme2008 force-pushed the feature/show-columns-index branch from 1b3ee8e to 5e6a6c6 Compare March 26, 2024 03:16
@killme2008 killme2008 marked this pull request as ready for review March 26, 2024 03:16
Copy link

codecov bot commented Mar 26, 2024

Codecov Report

Attention: Patch coverage is 51.77305% with 204 lines in your changes are missing coverage. Please review.

Project coverage is 84.88%. Comparing base (e3b37ee) to head (a6077a6).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3577      +/-   ##
==========================================
- Coverage   85.34%   84.88%   -0.46%     
==========================================
  Files         931      931              
  Lines      154619   155023     +404     
==========================================
- Hits       131956   131593     -363     
- Misses      22663    23430     +767     

@killme2008
Copy link
Contributor Author

@waynexia @Taylor-lagrange @tisonkun Help to take a look, thank you.

Copy link
Collaborator

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

Generally look good.

src/query/src/sql.rs Show resolved Hide resolved
@fengjiachun fengjiachun enabled auto-merge March 29, 2024 08:47
@fengjiachun fengjiachun added this pull request to the merge queue Mar 29, 2024
Merged via the queue into GreptimeTeam:main with commit 4a5bb69 Mar 29, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-required This change requires docs update.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants