Skip to content

Commit 0748deb

Browse files
committed
Fix error
1 parent 7bbdb07 commit 0748deb

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/InMemoryTableScanExec.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ case class InMemoryTableScanExec(
194194
}
195195

196196
// Returned filter predicate should return false iff it is impossible for the input expression
197-
// to evaluate to `true' based on statistics collected about this partition batch.
197+
// to evaluate to `true` based on statistics collected about this partition batch.
198198
@transient lazy val buildFilter: PartialFunction[Expression, Expression] = {
199199
case And(lhs: Expression, rhs: Expression)
200200
if buildFilter.isDefinedAt(lhs) || buildFilter.isDefinedAt(rhs) =>
@@ -241,9 +241,6 @@ case class InMemoryTableScanExec(
241241
case StartsWith(a: AttributeReference, ExtractableLiteral(l)) =>
242242
statsFor(a).lowerBound.substr(0, Length(l)) <= l &&
243243
l <= statsFor(a).upperBound.substr(0, Length(l))
244-
case StartsWith(ExtractableLiteral(l), a: AttributeReference) =>
245-
statsFor(a).lowerBound.substr(0, Length(l)) <= l &&
246-
l <= statsFor(a).upperBound.substr(0, Length(l))
247244
}
248245

249246
lazy val partitionFilters: Seq[Expression] = {

sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/PartitionBatchPruningSuite.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,13 @@ class PartitionBatchPruningSuite
171171
}
172172

173173
// Support `StartsWith` predicate
174-
checkBatchPruning("SELECT CAST(s AS INT) FROM pruningStringData WHERE s like '18%'", 1, 1) {
174+
checkBatchPruning("SELECT CAST(s AS INT) FROM pruningStringData WHERE s like '18%'", 1, 1)(
175175
180 to 189
176-
}
177-
checkBatchPruning("SELECT CAST(s AS INT) FROM pruningStringData WHERE s like '%'", 5, 11) {
176+
)
177+
checkBatchPruning("SELECT CAST(s AS INT) FROM pruningStringData WHERE s like '%'", 5, 11)(
178178
100 to 200
179-
}
179+
)
180+
checkBatchPruning("SELECT CAST(s AS INT) FROM pruningStringData WHERE '18%' like s", 5, 11)(Seq())
180181

181182
// With disable IN_MEMORY_PARTITION_PRUNING option
182183
test("disable IN_MEMORY_PARTITION_PRUNING") {

0 commit comments

Comments
 (0)