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: add some missing columns and views to support atlas #15151

Merged
merged 2 commits into from
Feb 23, 2024

Conversation

yezizp2012
Copy link
Contributor

@yezizp2012 yezizp2012 commented Feb 20, 2024

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Resolve #15120
Resolve #15121
Resolve #15122

As title, added some missing columns in system catalog and introduced a dummy system table pg_catalog.pg_partitioned_table.
It is worth noting that the columns is_generated and generation_expression have been added to the column system catalogs rw_catalog.rw_columns and information_schema.columns.

dev=> show create table t2;
   Name    |                     Create Sql
-----------+-----------------------------------------------------
 public.t2 | CREATE TABLE t2 (v1 INT, v2 INT, v3 INT AS v1 + v2)
(1 row)

dev=> select * from rw_columns where name = 'v3';
 relation_id | name | position | is_hidden | is_primary_key | is_distribution_key | is_generated | generation_expression | data_type | type_oid | type_len | udt_type
-------------+------+----------+-----------+----------------+---------------------+--------------+-----------------------+-----------+----------+----------+----------
        2002 | v3   |        3 | f         | f              | f                   | t            | (v1 + v2)             | integer   |       23 |        4 | int4
(1 row)

dev=> select * from information_schema.columns where column_name = 'v3';
 table_catalog | table_schema | table_name | column_name | column_default | character_maximum_length | numeric_precision | numeric_scale | ordinal_position | is_nullable | data_type | udt_catalog | udt_schema | udt_name | character_set_catalog | character_set_schema | character_set_name | collation_catalog | collation_schema | collation_name | domain_catalog | domain_schema | domain_name | scope_catalog | scope_schema | scope_name | is_identity | identity_generation | identity_start | identity_increment | identity_maximum | identity_minimum | identity_cycle | is_generated | generation_expression
---------------+--------------+------------+-------------+----------------+--------------------------+-------------------+---------------+------------------+-------------+-----------+-------------+------------+----------+-----------------------+----------------------+--------------------+-------------------+------------------+----------------+----------------+---------------+-------------+---------------+--------------+------------+-------------+---------------------+----------------+--------------------+------------------+------------------+----------------+--------------+-----------------------
 dev           | public       | t2         | v3          |                |                          |                   |               |                3 | YES         | integer   | dev         | pg_catalog | int4     |                       |                      |                    |                   |                  |                |                |               |             |               |              |            | NO          |                     |                |                    |                  |                  |                | ALWAYS       | (v1 + v2)
(1 row)

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

  1. add some missing columns for system catalog: pg_catalog.pg_index, rw_catalog.rw_columns and information_schema.columns.
  2. add a new dummy system view pg_catalog.pg_partitioned_table.

@yezizp2012 yezizp2012 added the user-facing-changes Contains changes that are visible to users label Feb 20, 2024
Copy link
Contributor

@neverchanje neverchanje left a comment

Choose a reason for hiding this comment

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

Thanks! Let me try on your branch later today.

@yezizp2012
Copy link
Contributor Author

Thanks! Let me try on your branch later today.

I didn't upgrade the PG version in this PR, I am not sure if the implementation of rw is compatible with higher versions and whether upgrading will break some other tools that are already integrated.

@neverchanje
Copy link
Contributor

It's alright. I did the hack so it won't affect my testing. 😄

@yezizp2012 yezizp2012 added this pull request to the merge queue Feb 23, 2024
Merged via the queue into main with commit 07bd890 Feb 23, 2024
31 of 32 checks passed
@yezizp2012 yezizp2012 deleted the zp/support-sys-catalog-atlas branch February 23, 2024 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature user-facing-changes Contains changes that are visible to users
Projects
None yet
3 participants