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

[#6533] improvement(CLI): Add default values to column list output in CLI #6538

Merged
merged 2 commits into from
Feb 27, 2025

Conversation

Abyss-lord
Copy link
Contributor

@Abyss-lord Abyss-lord commented Feb 26, 2025

What changes were proposed in this pull request?

improvement(CLI): Add default values to column list output in CLI

Why are the changes needed?

Fix: #6533

Does this PR introduce any user-facing change?

No

How was this patch tested?

local test
Hive Catalog

gcli column list -m demo_metalake --name Hive_catalog.default.test_dates -i
name,datatype,default_value,comment,nullable,auto_increment
id,integer,,N/A,true,false
event_date,date,,N/A,true,
event_timestamp,timestamp,,N/A,true,

gcli column list -m demo_metalake --name Hive_catalog.default.test_dates -i --output table
+-----------------+-----------+---------+---------------+----------+---------+
|      Name       |   Type    | Default | AutoIncrement | Nullable | Comment |
+-----------------+-----------+---------+---------------+----------+---------+
| id              | integer   |         | false         | true     | N/A     |
| event_date      | date      |         |               | true     | N/A     |
| event_timestamp | timestamp |         |               | true     | N/A     |
+-----------------+-----------+---------+---------------+----------+---------+

gcli table details -m demo_metalake --name Hive_catalog.default.test_dates -i --output table
+-----------------+-----------+---------+---------------+----------+---------+
|      Name       |   Type    | Default | AutoIncrement | Nullable | Comment |
+-----------------+-----------+---------+---------------+----------+---------+
| id              | integer   |         | false         | true     | N/A     |
| event_date      | date      |         |               | true     | N/A     |
| event_timestamp | timestamp |         |               | true     | N/A     |
+-----------------+-----------+---------+---------------+----------+---------+

Mysql Catalog

gcli column list -m demo_metalake --name Mysql_catalog.gravitino_db.catalog_meta -i
name,datatype,default_value,comment,nullable,auto_increment
catalog_id,long unsigned,,catalog id,false,false
catalog_name,varchar(128),,catalog name,false,
metalake_id,long unsigned,,metalake id,false,false
type,varchar(64),,catalog type,false,
provider,varchar(64),,catalog provider,false,
catalog_comment,varchar(256),'',catalog comment,true,
properties,external(MEDIUMTEXT),,catalog properties,true,
audit_info,external(MEDIUMTEXT),,catalog audit info,false,
current_version,integer unsigned,1,catalog current version,false,false
last_version,integer unsigned,1,catalog last version,false,false
deleted_at,long unsigned,0,catalog deleted at,false,false

gcli column list -m demo_metalake --name Mysql_catalog.gravitino_db.catalog_meta -i --output table
+-----------------+----------------------+---------+---------------+----------+-------------------------+
|      Name       |         Type         | Default | AutoIncrement | Nullable |         Comment         |
+-----------------+----------------------+---------+---------------+----------+-------------------------+
| catalog_id      | long unsigned        |         | false         | false    | catalog id              |
| catalog_name    | varchar(128)         |         |               | false    | catalog name            |
| metalake_id     | long unsigned        |         | false         | false    | metalake id             |
| type            | varchar(64)          |         |               | false    | catalog type            |
| provider        | varchar(64)          |         |               | false    | catalog provider        |
| catalog_comment | varchar(256)         | ''      |               | true     | catalog comment         |
| properties      | external(MEDIUMTEXT) |         |               | true     | catalog properties      |
| audit_info      | external(MEDIUMTEXT) |         |               | false    | catalog audit info      |
| current_version | integer unsigned     | 1       | false         | false    | catalog current version |
| last_version    | integer unsigned     | 1       | false         | false    | catalog last version    |
| deleted_at      | long unsigned        | 0       | false         | false    | catalog deleted at      |
+-----------------+----------------------+---------+---------------+----------+-------------------------+

@Abyss-lord
Copy link
Contributor Author

@justinmclean could you please review this PR when you have time? I’d really appreciate your feedback.

@Abyss-lord
Copy link
Contributor Author

@justinmclean @tengqm I’ve finished updating the code. Please take a look at the PR again when you have time.

…put in CLI

Add default values to column list output in CLI
…mand in Gravitino CLI to command

fix some bugs.
@tengqm
Copy link
Contributor

tengqm commented Feb 26, 2025

/lgtm

Copy link
Member

@justinmclean justinmclean left a comment

Choose a reason for hiding this comment

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

LGTM thanks

@justinmclean justinmclean merged commit a95933d into apache:main Feb 27, 2025
27 checks passed
@Abyss-lord Abyss-lord deleted the improve-column-list branch February 27, 2025 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement] Add default values to column list output in CLI
3 participants