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

refactor(types): assign name f{} to unnamed fields of struct (record) #20490

Merged
merged 7 commits into from
Feb 20, 2025

Conversation

BugenZhao
Copy link
Member

@BugenZhao BugenZhao commented Feb 13, 2025

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

What's changed and what's your intention?

In Postgres, record type (typically created by ROW expression) have fields implicitly named f1 f2 etc. This PR makes our implementation more consistent with theirs.

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • My PR contains critical fixes that are necessary to be merged into the latest release.

Documentation

  • My PR needs documentation updates.
Release note

Signed-off-by: Bugen Zhao <[email protected]>
@BugenZhao BugenZhao changed the title refactor(types): assign name f{} to unnamed fields of struct refactor(types): assign name f{} to unnamed fields of struct (record) Feb 17, 2025
Signed-off-by: Bugen Zhao <[email protected]>
@kwannoel
Copy link
Contributor

nice

└─BatchScan { table: t, columns: [t.v1, t.v2, t.v3], scan_ranges: [(t.v1, t.v2) >= (Int32(1), Int32(2))], distribution: UpstreamHashShard(t.v1, t.v2, t.v3) }
- sql: |
create table t1(v1 int, v2 int, v3 int);
create materialized view mv1 as select * from t1 order by v1 asc, v2 asc, v3 desc;
select * from mv1 where (v1,v2,v3) > (1,3,1);
batch_plan: |-
BatchExchange { order: [], dist: Single }
└─BatchFilter { predicate: (Row(mv1.v1, mv1.v2, mv1.v3) > '(1,3,1)':Struct(StructType { field_names: [], field_types: [Int32, Int32, Int32] })) }
└─BatchFilter { predicate: (Row(mv1.v1, mv1.v2, mv1.v3) > '(1,3,1)':Struct(StructType { fields: [("f1", Int32), ("f2", Int32), ("f3", Int32)] })) }
Copy link
Member

Choose a reason for hiding this comment

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

maybe we could further simplify Struct(StructType to just Struct?

Copy link
Member

@xxchan xxchan left a comment

Choose a reason for hiding this comment

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

👍 👍 👍 👍 👍 👍

Signed-off-by: Bugen Zhao <[email protected]>
@BugenZhao BugenZhao added this pull request to the merge queue Feb 20, 2025
Merged via the queue into main with commit 034bda0 Feb 20, 2025
30 checks passed
@BugenZhao BugenZhao deleted the bz/struct-part-1 branch February 20, 2025 07:36
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.

4 participants