-
Notifications
You must be signed in to change notification settings - Fork 591
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(frontend): implement WITH ORDINALITY
clause
#12273
Conversation
create materialized view mv as select * from t cross join unnest(t.arr) WITH ORDINALITY AS x(elts, num); | ||
|
||
statement ok | ||
insert into t values (Array['a','b', 'c']), (Array['d','e']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if update Array['a','b', 'c']
to Array['a', 'c']
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Actually I'm not sure what's your intention 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
src/frontend/src/planner/relation.rs
Outdated
}; | ||
Ok(LogicalValues::create(vec![vec![expr]], schema, self.ctx())) | ||
if with_ordinality { | ||
todo!() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. This is actually a different issue (scalar function WITH ORDINALITY)
Seems related #12204 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
let projected_row_id = InputRef::new(0, DataType::Int64).into(); | ||
let ordinality = FunctionCall::new( | ||
ExprType::Add, | ||
vec![projected_row_id, ExprImpl::literal_bigint(1)], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since projected_row_id
starts from 0, we need to add one to align with with ordinality
Codecov Report
@@ Coverage Diff @@
## main #12273 +/- ##
=======================================
Coverage 69.67% 69.68%
=======================================
Files 1410 1410
Lines 236128 236215 +87
=======================================
+ Hits 164526 164599 +73
- Misses 71602 71616 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 5 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
fix #12043 fix #11167 (duplicate issues)
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
May refer to test cases, and https://www.postgresql.org/docs/current/queries-table-expressions.html#QUERIES-TABLEFUNCTIONS