This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/main by this push:
new 1d2696d328 chore: expose arrow-schema methods, for use when writing
parquet outside of ArrowWriter (#6916)
1d2696d328 is described below
commit 1d2696d3284266cddb48e0974bd61fc23882a893
Author: wiedld <[email protected]>
AuthorDate: Mon Dec 30 05:57:59 2024 -0500
chore: expose arrow-schema methods, for use when writing parquet outside of
ArrowWriter (#6916)
---
parquet/src/arrow/mod.rs | 4 ++--
parquet/src/arrow/schema/mod.rs | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/parquet/src/arrow/mod.rs b/parquet/src/arrow/mod.rs
index 6777e00fb0..1305bbac83 100644
--- a/parquet/src/arrow/mod.rs
+++ b/parquet/src/arrow/mod.rs
@@ -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
diff --git a/parquet/src/arrow/schema/mod.rs b/parquet/src/arrow/schema/mod.rs
index 212dec5258..8be2439002 100644
--- a/parquet/src/arrow/schema/mod.rs
+++ b/parquet/src/arrow/schema/mod.rs
@@ -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 =
@@ -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 {