HyukjinKwon commented on PR #60129:
URL: https://github.com/apache/spark/pull/60129#issuecomment-6699755117

   Thank you for the seventh round, @dongjoon-hyun. 7b39a35 addresses it:
   
   - **The per-batch check** 
([1](https://github.com/apache/spark/pull/60129#discussion_r4498805698), 
[3](https://github.com/apache/spark/pull/60129#discussion_r4498805709), 
[4](https://github.com/apache/spark/pull/60129#discussion_r4498805729)): each 
micro-batch now checks the optimized plan that it runs, in 
`IncrementalExecution.optimizedPlan`, rather than optimizing the query again. 
For each read of a relation whose scan got filters, the conditions of the 
filters over it, through deterministic projections, must imply each pushed 
filter (`checkPushedFilters`). So there's no gap between the check and the 
execution and no second optimization per micro-batch, and the check can't fail 
except with `STREAMING_SCAN_FILTERS_CHANGED`.
   - **The order** 
([2](https://github.com/apache/spark/pull/60129#discussion_r4498805706)): it 
isn't checked per micro-batch. The micro-batch plans put the inferred filters 
first, and the order only decides whether a filter that may fail fails the 
micro-batch; it doesn't change the rows. This is now an open item in the PR 
description.
   - **The plan rewrites** 
([7](https://github.com/apache/spark/pull/60129#discussion_r4498805742), 
[8](https://github.com/apache/spark/pull/60129#discussion_r4498805750), 
[9](https://github.com/apache/spark/pull/60129#discussion_r4498805754)): 
`withPushedFilters` and `withoutRepeatedPushedFilters` are removed. The 
micro-batches apply the filters of the query as written, after the scan, so 
there are no duplicates to drop, and the blocks in `MicroBatchExecution` and 
`ContinuousExecution` are gone.
   - **Others** 
([5](https://github.com/apache/spark/pull/60129#discussion_r4498805717), 
[6](https://github.com/apache/spark/pull/60129#discussion_r4498805732), 
[10](https://github.com/apache/spark/pull/60129#discussion_r4498805760), 
[11](https://github.com/apache/spark/pull/60129#discussion_r4498805764), 
[12](https://github.com/apache/spark/pull/60129#discussion_r4498805773)): 
failing fast in the tests is the default again (`Utils.isTesting`, through the 
internal conf), `PushDownUtils.pushFilters` and `OffsetSeq.scala` are #59943's 
versions, and the fallback warnings have one format.
   
   Tests: `StreamingV2ScanPushDownSuite`, 
`StreamingV2ScanPushDownRealTimeSuite`, `StreamingDataSourceV2Suite`, 
`OffsetSeqLogSuite` and `ColumnarDataSourceSuite` (227 tests) and 
`PythonStreamingDataSourceSuite` pass locally, along with scalastyle. A new 
test calls `checkPushedFilters` on plans that apply a pushed filter or don't, 
and another one has a micro-batch fold a pushed filter into true with an 
equality that it infers through a stream-static join. Each part of the check 
(the check itself, the stops at nondeterministic filters and projections, the 
values of the equalities and their types) makes a test fail when it's removed.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to