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: implement pg_catalog upon local execution mode #3387

Merged
merged 12 commits into from
Jun 22, 2022
Merged

Conversation

yezizp2012
Copy link
Contributor

@yezizp2012 yezizp2012 commented Jun 21, 2022

I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.

As title, implemented pg_type/pg_namespace/pg_cast and some other rules for ddl:

  1. introduce a new SysRowSeqScanExecutor to support scanning on system table, only works in local execution mode.
  2. init pg_catalog schema and system tables for all new created database, and drop them when database dropped.
  3. refuse to create schema with prefix pg_.
  4. refuse to create any relation under pg_catalog.

todo:

  1. auto enable local mode when query on pg_catalog.
  2. support more system tables.

Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Refer to a related PR or issue link (optional)

Part of #2954

@codecov
Copy link

codecov bot commented Jun 22, 2022

Codecov Report

Merging #3387 (3c6501d) into main (86e7742) will decrease coverage by 0.14%.
The diff coverage is 44.39%.

@@            Coverage Diff             @@
##             main    #3387      +/-   ##
==========================================
- Coverage   73.73%   73.58%   -0.15%     
==========================================
  Files         761      766       +5     
  Lines      104506   104879     +373     
==========================================
+ Hits        77054    77175     +121     
- Misses      27452    27704     +252     
Flag Coverage Δ
rust 73.58% <44.39%> (-0.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/batch/src/executor/mod.rs 75.80% <ø> (ø)
src/batch/src/executor/sys_row_seq_scan.rs 0.00% <0.00%> (ø)
src/batch/src/task/context.rs 15.38% <0.00%> (-1.29%) ⬇️
src/common/src/catalog/mod.rs 60.44% <ø> (ø)
src/frontend/src/binder/mod.rs 100.00% <ø> (ø)
src/frontend/src/binder/relation/mod.rs 87.41% <ø> (ø)
src/frontend/src/binder/relation/table_function.rs 76.41% <0.00%> (ø)
src/frontend/src/catalog/pg_catalog/pg_cast.rs 0.00% <0.00%> (ø)
src/frontend/src/catalog/pg_catalog/pg_type.rs 0.00% <0.00%> (ø)
src/frontend/src/expr/mod.rs 87.09% <ø> (ø)
... and 33 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@yezizp2012 yezizp2012 marked this pull request as ready for review June 22, 2022 06:21
Copy link
Contributor

@lmatz lmatz left a comment

Choose a reason for hiding this comment

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

Scheduler and Batch execution parts LGTM!

src/frontend/src/scheduler/local.rs Outdated Show resolved Hide resolved
src/frontend/src/scheduler/task_context.rs Outdated Show resolved Hide resolved
@liurenjie1024
Copy link
Contributor

Generally LGTM

@yezizp2012 yezizp2012 merged commit 3ab970c into main Jun 22, 2022
@yezizp2012 yezizp2012 deleted the feat/pg_catalog branch June 22, 2022 11:29
@hengm3467
Copy link
Contributor

@yezizp2012 @xiangjinwu Are these changes visible to users? Does it mean that in local execution mode, RisingWave supports casts, namespaces, and types exactly the same as in PG? Thanks.

@xiangjinwu
Copy link
Contributor

@yezizp2012 @xiangjinwu Are these changes visible to users? Does it mean that in local execution mode, RisingWave supports casts, namespaces, and types exactly the same as in PG? Thanks.

  • These changes are visible to users.
  • However, we do not want to encourage users to use them. They are here to support bigger user-friendly features that are not complete yet. PostgreSQL also exposes these "internal" things to user, but practically it adds little value to normal users.
  • They are not exactly the same as in PG.

@hengm3467
Copy link
Contributor

@xiangjinwu Thanks for the detailed explanation! I think it makes senses that we do not disclose these details until the bigger features are completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants