Skip to main content

risingwave_common/array/arrow/
arrow_58.rs

1// Copyright 2026 RisingWave Labs
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#[allow(clippy::duplicate_mod)]
16#[path = "./arrow_impl.rs"]
17mod arrow_impl;
18type ArrowIntervalType = arrow_buffer::IntervalMonthDayNano;
19pub use arrow_58_array as arrow_array;
20pub use arrow_58_buffer as arrow_buffer;
21pub use arrow_58_cast as arrow_cast;
22pub use arrow_58_schema as arrow_schema;
23pub use arrow_impl::{
24    FromArrow, ToArrow, is_parquet_field_match_source_schema, is_parquet_schema_match_source_schema,
25};
26
27use crate::array::{ArrayError, DataChunk};
28use crate::types::DataType;
29
30struct DefaultArrowConvert;
31
32impl FromArrow for DefaultArrowConvert {}
33
34/// Converts an Arrow 58 record batch to a [`DataChunk`] with the default conversion rules.
35pub fn from_arrow58_record_batch(
36    batch: &arrow_array::RecordBatch,
37) -> Result<DataChunk, ArrayError> {
38    DefaultArrowConvert.from_record_batch(batch)
39}
40
41/// Converts an Arrow 58 field to a [`DataType`] with the default conversion rules.
42pub fn from_arrow58_field(field: &arrow_schema::Field) -> Result<DataType, ArrayError> {
43    DefaultArrowConvert.from_field(field)
44}