Pastoray commented on PR #394: URL: https://github.com/apache/datafusion-spark/pull/394#issuecomment-7087283568
Thanks for the review. I rebased on main, regenerated the docs and pushed the changes. **Spark verification.** I built VARIANTs from raw bytes with `VariantVal(value, metadata)` on Spark 4.2.0 and ran `is_variant_null` on them. - Empty `metadata` does not raise in Spark. `is_variant_null` returns `true` for a null `value`, and the same holds for a bad version byte, so this PR matches. This covers values handed to the expression. A reader such as Parquet may validate the metadata earlier. - An empty `value` raises `[MALFORMED_VARIANT] Variant binary is malformed. Please check the data source is valid. SQLSTATE: 22023`. This matches the PR. - A NULL `value` inside a non-null VARIANT cannot be built in Spark. A `VariantVal` with a NULL value fails with a `NullPointerException`. So that case has no Spark equivalent. I labeled it as DataFusion-only in the `.slt`. - I also ran all 256 one-byte values. Only `X'00'` is `true` and none of them raise, so a header with an unknown type id such as `X'7C'` is `false`. I added a record for that. I also removed the claim that Spark 4.0.4 and 4.1.3 behave the same. I only checked 4.2.0, and the comment now says so. **Sliced struct test.** Added `test_sliced_struct_with_offset`. It slices at offsets 0, 1 and 2 and keeps a NULL row that has an empty `value`, which must not be read. The rows alternate answers, so a `value` column and validity buffer that are out of step would change the result. **Stale docs.** Rebased on main and reran `dev/update_function_docs.sh`. The PR now only adds the Variant page and the `is_variant_null` README entries. -- 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]
