Repository navigation
Conversation
|
| sameIdentifier_.forEach(remnantMustFilterFields::remove); | ||
| // Clear the remnant must-filter qualifieds imported through the | ||
| // same FROM item (namespace) as the filtered bypass field | ||
| if (qualified.namespace != null) { |
There was a problem hiding this comment.
Could it be that, within the same subquery, a bypass for one table incorrectly clears the remnant of another?
There was a problem hiding this comment.
Not sure I understand, could you please provide an example?
There was a problem hiding this comment.
I think I got your point, I tried to addressed this potential issue introducing the notion of "Group" in FilterRequirement.
| final SqlValidatorNamespace operandNamespace = | ||
| requireNonNull(validator.getNamespace(operand), | ||
| () -> "namespace for " + operand); | ||
| final FilterRequirement requirement = operandNamespace.getFilterRequirement(); |
There was a problem hiding this comment.
Here, one might need to consider that cross-bypass fields spanning set operation operands could result in valid queries being rejected.
There was a problem hiding this comment.
Do you mean something like
// Only operands that still owe a must-filter constrain the setop's bypass set
if (!requirement.filterFields.isEmpty() || !requirement.remnantFilterFields.isEmpty()) {
bypassFields = bypassFields == null
? requirement.bypassFields
: bypassFields.intersect(requirement.bypassFields);
}
|
退订
Ruben Quesada Lopez ***@***.***> 于2026年9月21日周一 17:54写道:
… ***@***.**** commented on this pull request.
------------------------------
In
core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java
<#5275 (comment)>:
> @@ -4719,12 +4748,11 @@ private static void purgeForBypassFields(SqlNode node, SqlValidatorScope scope,
.collect(Collectors.toList());
sameIdentifier.forEach(qualifieds::remove);
- // Clear all the remnant must-filter qualifieds from the same table identifier
- Collection<SqlQualified> sameIdentifier_ =
- remnantMustFilterFields.stream()
- .filter(q -> qualifiedMatchesIdentifier(q, qualified))
- .collect(Collectors.toList());
- sameIdentifier_.forEach(remnantMustFilterFields::remove);
+ // Clear the remnant must-filter qualifieds imported through the
+ // same FROM item (namespace) as the filtered bypass field
+ if (qualified.namespace != null) {
Not sure I understand, could you please provide an example?
—
Reply to this email directly, view it on GitHub
<#5275?email_source=notifications&email_token=ABQGFUMKDG6X5SKLBETKY2D5QD3GHA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKMRWGUZDENRZGM42M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#discussion_r4060997184>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABQGFUOISMLCL7YGU4HKU535QD3GHAVCNFSNUABEKJSXA33TNF2G64TZHMZDCMJZGM2TENB3JFZXG5LFHM2TKMBSHA4TEMJWGOQXMAQ>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/ABQGFUPVHQHKIRA62HHVAMT5QD3GHA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKMRWGUZDENRZGM42M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSVGM33PORSXEX3JN5ZQ>
and Android
<https://github.com/notifications/mobile/android/ABQGFUMQWP7U26CVYCIGXHL5QD3GHA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTKMRWGUZDENRZGM42M4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ>.
Download it today!
You are receiving this because you are subscribed to this thread.Message
ID: <apache/calcite/pull/5275/review/5265226939 ***@***.***
com>
|
|
@xuzifu666 , just a friendly reminder that there are a couple of comments waiting for your feedback here, nothing urgent, please take a look when you have some time |
98609c1 to
d0a8ee0
Compare
|
…rRequirement to have a per-table-instance tracking
|
@xuzifu666 I've added some extra code, which I think goes aligned with your original remarks. Could you please take another look at this? |



Jira Link
CALCITE-7795
Changes Proposed
Correct certain query shapes (set-ops, alias-with-column-list, PIVOT/UNPIVOT/MATCH_RECOGNIZE/table functions, subqueries, INSERT/UPDATE/MERGE/DELETE sources, cross-scope bypass purge) that silently drop or defuse the FilterRequirement.