-
Notifications
You must be signed in to change notification settings - Fork 560
[GLUTEN-9849][VL] Avoid VeloxBloomFilterMightContain being applied to FileSourceScan partition filters #9850
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.gluten.execution | ||
|
|
||
| /** | ||
| * GlutenExpression is a marker trait for expressions that are specific to Gluten execution. It can | ||
| * be used to identify expressions that should only be evaluated in the context of a Spark task. | ||
| */ | ||
| trait GlutenExpression { | ||
|
|
||
| def onlyInSparkTask(): Boolean = false | ||
|
|
||
| } | ||
|
|
||
| trait GlutenTaskOnlyExpression extends GlutenExpression { | ||
|
|
||
| override def onlyInSparkTask(): Boolean = true | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,11 +25,17 @@ object ScanTransformerFactory { | |
|
|
||
| def createFileSourceScanTransformer( | ||
| scanExec: FileSourceScanExec): FileSourceScanExecTransformerBase = { | ||
| // Partition filters will be evaluated in driver side, so we can remove | ||
| // GlutenTaskOnlyExpressions | ||
| val partitionFilters = scanExec.partitionFilters.filter { | ||
| case _: GlutenTaskOnlyExpression => false | ||
| case _ => true | ||
| } | ||
| FileSourceScanExecTransformer( | ||
| scanExec.relation, | ||
| scanExec.output, | ||
| scanExec.requiredSchema, | ||
| scanExec.partitionFilters, | ||
| partitionFilters, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you need to consider this issue also for the BatchScanTransformer? Thanks.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There are no partition filters in |
||
| scanExec.optionalBucketSet, | ||
| scanExec.optionalNumCoalescedBuckets, | ||
| scanExec.dataFilters, | ||
|
|
||
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.
@zhztheplayer @jinchengchenghh I added a comment to record this improvement, how about we merge this PR first?
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.
No problem from my end. cc @jinchengchenghh
And can we log an issue highlighting the performance gap because of the unavailability of scan + might_contain?
Also I guess vanilla Spark's scan + Velox might_contain will cause the issue as well?
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.
In what scenarios does a vanilla spark scan with native expressions occur? Do we have an existing test case?
Uh oh!
There was an error while loading. Please reload this page.
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.
I meant when velox_might_contain is included in a vanilla Spark scan node, which for whatever reason was fallen back by Gluten. I was just guessing whether the same issue will happen in the case.
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.
Oh, I see.
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.
Filed an issue #10071