Commit 77df2ee
[Variant] add strict mode to cast_to_variant (apache#8233)
# Which issue does this PR close?
- Closes apache#8155 .
# Rationale for this change
cast_to_variant will panic for values of Date64 / Timestamp that can not
be converted to NaiveDate
# What changes are included in this PR?
1. add new api :
`pub fn cast_to_variant_with_options(input: &dyn Array, strict: bool) ->
Result<VariantArray, ArrowError>`
- strict = true: Returns errors on conversion failures (default
behavior)
- strict = false: Returns null values for failed conversions
2. add some tests to test non-strict mode.
3. refactor: eliminate duplication in timestamp conversion using macro
# Are these changes tested?
Yes.
# Are there any user-facing changes?
no.
---------
Signed-off-by: codephage2020 <[email protected]>
Co-authored-by: Ryan Johnson <[email protected]>1 parent d9a4b39 commit 77df2ee
File tree
3 files changed
+264
-115
lines changed- parquet-variant-compute/src
3 files changed
+264
-115
lines changed
0 commit comments