Conversation
andygrove
left a comment
There was a problem hiding this comment.
Thanks for picking this up. The cleanup reads nicely, and the reserved lines match how we retire proto fields elsewhere. native/core doesn't compile with this change though. schema_adapter.rs:1353 still passes self.parquet_options.allow_incompat as a third argument to SparkCastOptions::new, and cargo check --workspace --all-targets fails with error[E0061]: this function takes 2 arguments but 3 arguments were supplied. Could you drop that argument? Running cargo clippy --all-targets --workspace -- -D warnings from native/ is what CI runs, so it will catch anything else across the crates.
Once that argument is gone, SparkParquetOptions::allow_incompat in parquet_support.rs has no reader left. The production constructors in parquet_exec.rs and iceberg_scan.rs both pass false, and the field still has the "Allow casts that are supported but not guaranteed to be 100% compatible" doc comment. That leaves readers with the same wrong impression #5077 is trying to remove. Would you be up for removing it from SparkParquetOptions and its two constructors in this PR too? Most of the call sites are tests.
| castBuilder.setAllowIncompat( | ||
| SQLConf.get | ||
| .getConfString(CometConf.getExprAllowIncompatConfigKey(classOf[Cast]), "false") | ||
| .toBoolean) |
There was a problem hiding this comment.
This removes the last use of CometConf in this file, so import org.apache.comet.CometConf at the top is now unused. The lint-java jobs run scalafix's RemoveUnused rule in check mode, so this will fail all four of them. Could you remove the import? make format handles it too.
The flag has no remaining reader after the cast-option cleanup, and the unused CometConf import fails scalafix.
Which issue does this PR close?
Closes #5077.
Rationale for this change
allowIncompatiblecontrols whether the JVM planner may offload casts that are not guaranteed to be fully compatible. It is a JVM planning decision, but it was unnecessarily serialized in theCastprotobuf and carried through native cast options despite having no native consumer.Keeping this unused flag in the JVM-to-native contract obscures the ownership of the compatibility decision and leaves dead state in the native cast API.
What changes are included in this PR?
allow_incompatinCastexpressions.SparkCastOptions.allowIncompatibleis enforced by the JVM planner only.How are these changes tested?
No new tests were added because this PR removes unused JVM-to-native cast-option plumbing and does not change cast behavior.