-
Notifications
You must be signed in to change notification settings - Fork 590
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(optimizer): change create mv field name #2662
Conversation
Seems related to #2467, where a unique field name is preferred, and the duplicates originated from different PlanNode.
|
Codecov Report
@@ Coverage Diff @@
## main #2662 +/- ##
=======================================
Coverage 72.19% 72.19%
=======================================
Files 681 681
Lines 88477 88481 +4
=======================================
+ Hits 63872 63875 +3
- Misses 24605 24606 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
so we have two kinds of field names
but in create materialized view statement we use both of them. and we should ensure all column name in materialized view is unique
|
if !c.is_hidden { | ||
let name = out_name_iter.next().unwrap(); | ||
c.column_desc.name = name; | ||
} | ||
c.column_desc.name = if !c.is_hidden { | ||
out_name_iter.next().unwrap() | ||
} else { | ||
match col_names.try_insert(field.name.clone(), 0) { | ||
Ok(_) => field.name.clone(), | ||
Err(mut err) => { | ||
let cnt = err.entry.get_mut(); | ||
*cnt += 1; | ||
field.name.clone() + "#" + &cnt.to_string() | ||
} | ||
} | ||
}; |
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.
the core change is here.
What's changed and what's your intention?
#1363 not really solve the problem, except row id, all columns generated in pk deriving could be not unique.
you can see
src/frontend/test_runner/tests/testdata/pk_derive.yaml
for detailed caseChecklist
Refer to a related PR or issue link (optional)