LinSimon-901101 commented on code in PR #7155: URL: https://github.com/apache/datafusion-comet/pull/7155#discussion_r4771791676
########## docs/source/user-guide/latest/iceberg.md: ########## @@ -519,7 +519,34 @@ output. A write that runs natively shows `CometIcebergWrite` under `IcebergCommi plan; an ineligible write keeps `IcebergWrite`. The native writer reads its input as Arrow batches from a Comet operator, so the write's input -must itself run in Comet. A write whose input is a local relation, such as `INSERT ... VALUES` or +must supply Arrow data. When Spark inserts `AssertNotNull` checks for nullable input written to +required fields, those checks remain in Spark. Eligible output is converted to Arrow at the writer +boundary, allowing native writes without a shuffle. + +For a partitioned clustered writer, this new conversion also requires a Spark sort to fully consume +each writer partition before writing; only local or global limits may wrap that sort. Unsorted or +otherwise deferred row input keeps the iceberg-java writer. For example, a row that violates +partition order must fail before a later row's NOT NULL assertion; filling an Arrow batch first +could reverse those errors. Unpartitioned and fanout writers do not require this additional +condition. + +Writes with `fixed(N)` fields, including nested fields, keep iceberg-java when this row conversion +would be needed, even with a sort. A row with the wrong byte length must still report the Java +writer's validation failure before a later assertion or Arrow conversion error. These restrictions +preserve the exception type and meaningful message for this newly enabled row conversion. They do +not guarantee identical errors for every existing native write: writes that already supply Arrow +batches retain their eligibility and can report an Arrow cast error instead of iceberg-java's +Parquet error. + +This conversion requires proof that string values, including nested strings, contain valid UTF-8. +For example, it accepts input from Comet operators through recognized Spark projections that +preserve those strings or use validated literals. Extracting existing map keys and rebuilding a map +from arrays whose strings are already proven valid also qualify. Unproven sources or +string-producing expressions, such as Spark text input, Spark binary-to-string casts, or unproven +string-bearing collection transforms, keep the iceberg-java writer to preserve the original bytes. +The same table and schema eligibility checks apply. Review Comment: I've added all three under “Not planned”, with the reason for each. -- 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]
