Skip to main content

Crate hdbconnect_arrow

Crate hdbconnect_arrow 

Source
Expand description

Apache Arrow integration for hdbconnect SAP HANA driver.

This crate provides zero-copy conversion from HANA ResultSets to Apache Arrow RecordBatches, enabling efficient data transfer to Python via PyO3.

§Features

  • Type-safe HANA to Arrow type mapping
  • Streaming RecordBatch iteration for large result sets
  • Sealed traits for API stability
  • Generic Associated Types (GATs) for lending iterators

§Example

use hdbconnect_arrow::{Result, BatchConfig, HanaBatchProcessor};

// Configure batch processing
let config = BatchConfig::default();
let schema = /* Arrow schema */;
let mut processor = HanaBatchProcessor::new(schema, config);

// Process rows
for row in result_set {
    if let Some(batch) = processor.process_row(&row)? {
        // Handle batch
    }
}

// Flush remaining rows
if let Some(batch) = processor.flush()? {
    // Handle final batch
}

Re-exports§

pub use builders::factory::BuilderFactory;
pub use conversion::HanaBatchProcessor;
pub use conversion::rows_to_record_batch;
pub use error::ArrowConversionError;
pub use error::Result;
pub use schema::mapping::SchemaMapper;
pub use traits::builder::HanaCompatibleBuilder;
pub use traits::row::RowLike;
pub use traits::sealed::FromHanaValue;
pub use traits::streaming::BatchConfig;
pub use traits::streaming::BatchProcessor;
pub use traits::streaming::LendingBatchIterator;
pub use types::arrow::FieldMetadataExt;
pub use types::arrow::hana_field_to_arrow;
pub use types::arrow::hana_type_to_arrow;
pub use types::conversion::TypeCategory;
pub use types::hana::Binary;
pub use types::hana::Decimal;
pub use types::hana::DecimalPrecision;
pub use types::hana::DecimalScale;
pub use types::hana::HanaTypeCategory;
pub use types::hana::Lob;
pub use types::hana::Numeric;
pub use types::hana::Spatial;
pub use types::hana::StringType;
pub use types::hana::Temporal;
pub use types::hana::TypedColumn;

Modules§

builders
Arrow array builders for HANA value conversion.
conversion
Conversion utilities for HANA rows to Arrow RecordBatches.
error
Error hierarchy for hdbconnect-arrow.
schema
Schema conversion and mapping utilities.
traits
Trait definitions for HANA to Arrow conversion.
types
Type definitions for HANA to Arrow conversion.