Skip to content

Commit

Permalink
chore: expose arrow-schema methods, for use when writing parquet outs…
Browse files Browse the repository at this point in the history
…ide of ArrowWriter (#6916)
  • Loading branch information
wiedld authored Dec 30, 2024
1 parent 191a9ec commit 1d2696d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions parquet/src/arrow/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ use arrow_schema::{FieldRef, Schema};
pub use self::schema::arrow_to_parquet_schema;

pub use self::schema::{
parquet_to_arrow_field_levels, parquet_to_arrow_schema, parquet_to_arrow_schema_by_columns,
ArrowSchemaConverter, FieldLevels,
add_encoded_arrow_schema_to_metadata, encode_arrow_schema, parquet_to_arrow_field_levels,
parquet_to_arrow_schema, parquet_to_arrow_schema_by_columns, ArrowSchemaConverter, FieldLevels,
};

/// Schema metadata key used to store serialized Arrow IPC schema
Expand Down
4 changes: 2 additions & 2 deletions parquet/src/arrow/schema/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ fn get_arrow_schema_from_metadata(encoded_meta: &str) -> Result<Schema> {
}

/// Encodes the Arrow schema into the IPC format, and base64 encodes it
fn encode_arrow_schema(schema: &Schema) -> String {
pub fn encode_arrow_schema(schema: &Schema) -> String {
let options = writer::IpcWriteOptions::default();
#[allow(deprecated)]
let mut dictionary_tracker =
Expand All @@ -192,7 +192,7 @@ fn encode_arrow_schema(schema: &Schema) -> String {

/// Mutates writer metadata by storing the encoded Arrow schema.
/// If there is an existing Arrow schema metadata, it is replaced.
pub(crate) fn add_encoded_arrow_schema_to_metadata(schema: &Schema, props: &mut WriterProperties) {
pub fn add_encoded_arrow_schema_to_metadata(schema: &Schema, props: &mut WriterProperties) {
let encoded = encode_arrow_schema(schema);

let schema_kv = KeyValue {
Expand Down

0 comments on commit 1d2696d

Please sign in to comment.