0lai0 commented on code in PR #4987: URL: https://github.com/apache/datafusion-comet/pull/4987#discussion_r4423906471
########## spark/src/test/resources/sql-tests/windows/window_functions.sql: ########## @@ -248,16 +248,14 @@ ORDER BY cate, val_date -- Ported from Spark's typeCoercion/native/windowFrameCoercion.sql: -- SELECT COUNT(*) OVER (PARTITION BY 1 ORDER BY cast(1 as decimal(10, 0)) DESC -- RANGE BETWEEN CURRENT ROW AND 1 FOLLOWING) FROM t --- Comet falls back because Spark decimal arithmetic widens precision on --- +/-, so the native frame-boundary arithmetic produces e.g. Decimal(11,0) --- while the current row stays Decimal(10,0), and DataFusion's comparator --- fails with "Uncomparable values". Once the native planner preserves the --- ORDER BY column's precision when computing RANGE boundaries, the guard --- in CometWindowExec can be removed and this test will start failing --- because Comet stops falling back — that's the signal to re-enable it. +-- Runs natively: Spark's WindowFrameTypeCoercion casts the frame offset to +-- the same Decimal type as the ORDER BY column, so the boundary arithmetic +-- keeps the current row's precision and DataFusion's comparator has matching +-- operands. The DATE case in 1.11 keeps an IntegerType offset instead, which +-- the native planner coerces to IntervalDayTime. Review Comment: Agreed, applied your wording. -- 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]
