You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/10/12 14:42:04 UTC
[GitHub] [pinot] walterddr commented on a change in pull request #7565: allow queries to missing columns to fill in default value
walterddr commented on a change in pull request #7565:
URL: https://github.com/apache/pinot/pull/7565#discussion_r727208269
##########
File path: pinot-core/src/main/java/org/apache/pinot/core/query/pruner/DataSchemaSegmentPruner.java
##########
@@ -35,7 +35,13 @@ public void init(PinotConfiguration config) {
@Override
public boolean prune(IndexSegment segment, QueryContext query) {
- return !segment.getColumnNames().containsAll(query.getColumns());
+ for (String column : query.getColumns()) {
+ if (segment.getColumnNames().contains(column)) {
+ return false;
+ }
+ }
+ // don't prune unless the segment has none of the relevant columns
+ return !query.getColumns().isEmpty();
Review comment:
how about directly using Collections.disjoint?
```suggestion
return !query.getColumns().isEmpty()
&& Collections.disjoint(segment.getColumnNames(), query.getColumns()).isEmpty()
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org