metanil commented on PR #55885:
URL: https://github.com/apache/spark/pull/55885#issuecomment-6908939765

   @peter-toth #59760 has landed, and this is merged with master as of 
`e1c66b9`, so it's ready for your pass. Since `0f5f590`:
   
   **SPARK-60027 integration** (`05b973e`, on the merge `64c2195`). As the 
overlap note said, this PR no longer has its own evaluate-time argument check: 
`argsMatchInputTypes` and `retargetForIdentity` are gone, the identity reduce 
and the one-side shuffle use `evaluableFunction` as on master, and the identity 
reducer arm is master's. The literal parameters are children, so they reach 
`evaluableFunction` as arguments like the column. The one master path that read 
a transform's first child, the cogroup key error, now names the column argument 
rather than the bucket count. The exact-type migration entry and its cogroup 
sentence are gone, since #59760 widens and keeps the cogroup pairing; that also 
settles 27. `literalParamsMatchInputTypes`, before the generalized reducer 
only, is the one type check left here.
   
   **Finding 24, follow-up.** I know you said the layout check was fine with no 
flag, but I found a wrong result with it, so I'd like you to look at `4443db3`. 
The layout check can't tell `bucket(n, c)` from a width-first `truncate(w, c)`, 
which is how Iceberg writes truncate. A connector whose truncate inherits a 
bucket-style deprecated overload (a base class shared with its bucket, no check 
on the other function) got a gcd reducer for a truncate pair: `itrunc(4, id)` 
against `itrunc(8, id)` over 40 ids under `allowCompatibleTransforms` returned 
4 rows, master 40. Through finding 25 it also reached a 4.4 connector: one that 
implements the generalized overload but declares its width as `BIGINT` against 
the `INT` literal skips the generalized overload, and its inherited deprecated 
one answered, again 4 rows.
   
   So `V2ExpressionUtils` now marks a transform resolved from a V2 
`bucket(numBuckets, col)` (I begrudgingly added 
`TransformExpression.fromBucketTransform` to track it), and the fallback 
requires the mark on both sides, which is master's condition, the one 
`numBucketsOpt` carried. It is not part of `functionId`, and `stringArgs` now 
names the fields it prints, so plans look as before. It is part of case-class 
equality; hand-built bucket transforms in the tests are built marked, as 
master's were with `Some(n)`. If you'd rather keep the layout check and 
document the case instead, it's one commit to revert.
   
   **Finding 15.** The volume part is in `65fd0ff`: both reducer warnings are 
logged at WARN once per function and at DEBUG every time. Two cases where the 
message was wrong are fixed along the way (`4443db3`, `1edc324`): a literal 
type mismatch no longer says "implements no reducer, override ...", and a pair 
of the same function, which needs no reducer, logs nothing. The remaining 
rewording stays the separate change we agreed on.
   
   **Few additional changes:**
   - `65fd0ff`: connector code that throws while a pair is decided, 
`inputTypes()` or a reducer, a `LinkageError` included, makes the pair not 
reducible rather than failing planning; and a `sorted_bucket` is recognised by 
name before `BucketTransform` reads it, so `bucket(4, identity(ts))` no longer 
fails with a `ClassCastException`.
   - `1edc324`: `pairReducers` decides a pair with a side that has no identity, 
for both callers; nested transform arguments line up by identity, as 
`functionId` compares them; a connector failure is reported against the 
function whose code threw; and comments that misstated the contract are 
corrected.
   - `9078003`: simplification, no behavior change.
   
   **A question: should there be a dedicated opt-out?** @peter-toth @sunchao 
@szehon-ho (cc @dongjoon-hyun ) A scan partitioned by a transform with literal 
parameters now reports its partitioning, so aggregates and windows over a 
`truncate(name, 1)` table, say, skip their shuffle and run one task group per 
key instead of `spark.sql.shuffle.partitions`, and with no shuffle AQE can't 
split a skewed key. The only way back today is 
`spark.sql.sources.v2.bucketing.enabled=false`, which also turns off the bucket 
joins users already have. I would suggest 
`spark.sql.sources.v2.bucketing.parameterizedTransforms.enabled`, default 
`true`: off, `supportsExpressions` refuses a transform with a literal parameter 
unless it came from a V2 `bucket` (`fromBucketTransform`), which reproduces 
master exactly. Would you rather have it default on, default off (as 
`allowCompatibleTransforms` shipped), or no conf at all? 
   
   


-- 
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