Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion arrow-cast/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,8 @@ macro_rules! decimal_display {

decimal_display!(Decimal32Type, Decimal64Type, Decimal128Type, Decimal256Type);

fn write_timestamp(
/// Writes a timestamp value to the output using the given representation.
pub fn write_timestamp(
f: &mut dyn Write,
naive: NaiveDateTime,
timezone: Option<Tz>,
Expand Down
9 changes: 8 additions & 1 deletion arrow-cast/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,14 @@ fn parse_extended_ymd(string: &str) -> Option<(i32, u32, u32)> {
Some((year, month, day))
}

fn parse_date(string: &str) -> Option<NaiveDate> {
/// Parse a given date string into a `NaiveDate`.
///
/// Supports:
/// - ISO date strings: `"2026-06-10"`, `"2026-6-9"`, `"2026-06-9"`, `"2026-6-09"`
/// - ISO extended (signed) year date strings: `"+2026-06-10"`, `"-2026-06-10"`
/// - No hyphen date strings: `"20260610"`
/// - Datetime strings:`"2026-06-10T14:23:45"`
pub fn parse_date(string: &str) -> Option<NaiveDate> {
// If the date has an extended (signed) year such as "+10999-12-31" or "-0012-05-06"
//
// According to [ISO 8601], years have:
Expand Down
8 changes: 7 additions & 1 deletion parquet-variant-compute/src/shred_variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ pub(crate) fn shred_variant_with_options(
cast_options,
array.len(),
NullValue::TopLevelVariant,
true,
)?;
for i in 0..array.len() {
if array.is_null(i) {
Expand Down Expand Up @@ -145,6 +146,7 @@ pub(crate) fn make_variant_to_shredded_variant_arrow_row_builder<'a>(
cast_options: &'a CastOptions,
capacity: usize,
null_value: NullValue,
shred: bool,
) -> Result<VariantToShreddedVariantRowBuilder<'a>> {
let builder = match data_type {
DataType::Struct(fields) => {
Expand Down Expand Up @@ -193,7 +195,7 @@ pub(crate) fn make_variant_to_shredded_variant_arrow_row_builder<'a>(
| DataType::FixedSizeBinary(16) // UUID
=> {
let builder =
make_primitive_variant_to_arrow_row_builder(data_type, cast_options, capacity)?;
make_primitive_variant_to_arrow_row_builder(data_type, cast_options, capacity, shred)?;
let typed_value_builder =
VariantToShreddedPrimitiveVariantRowBuilder::new(builder, capacity, null_value);
VariantToShreddedVariantRowBuilder::Primitive(typed_value_builder)
Expand Down Expand Up @@ -376,6 +378,7 @@ impl<'a> VariantToShreddedObjectVariantRowBuilder<'a> {
cast_options,
capacity,
NullValue::ObjectField,
true,
)?;
Ok((field.name().as_str(), builder))
});
Expand Down Expand Up @@ -1046,6 +1049,7 @@ mod tests {
&cast_options,
1,
mode,
true,
)
.unwrap();
primitive_builder.append_null().unwrap();
Expand Down Expand Up @@ -1076,6 +1080,7 @@ mod tests {
&cast_options,
1,
mode,
true,
)
.unwrap();
array_builder.append_null().unwrap();
Expand Down Expand Up @@ -1104,6 +1109,7 @@ mod tests {
&cast_options,
1,
mode,
true,
)
.unwrap();
object_builder.append_null().unwrap();
Expand Down
Loading
Loading