1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! Export functionality for exporting data from Exasol.
//!
//! This module provides high-level export functions for exporting data from Exasol tables
//! or query results to various destinations including files, streams, in-memory lists,
//! and Arrow RecordBatches.
//!
//! # Architecture
//!
//! Export works using Exasol's HTTP transport protocol:
//! 1. Start an HTTP server on a local port
//! 2. Execute EXPORT SQL statement pointing to our server
//! 3. Exasol connects TO our server and sends data
//! 4. Receive and process the data stream (CSV)
//! 5. Optionally convert CSV to Arrow RecordBatches
//!
//! # Example - CSV Export
//!
//! ```ignore
//! use exarrow_rs::export::{export_to_file, CsvExportOptions};
//! use exarrow_rs::query::export::ExportSource;
//! use std::path::Path;
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! // Export a table to a file
//! let rows_exported = export_to_file(
//! &mut ws_transport,
//! ExportSource::Table {
//! schema: Some("my_schema".to_string()),
//! name: "users".to_string(),
//! columns: vec![],
//! },
//! Path::new("/tmp/users.csv"),
//! CsvExportOptions::default(),
//! ).await?;
//!
//! println!("Exported {} rows", rows_exported);
//! # Ok(())
//! # }
//! ```
//!
//! # Example - Arrow Export
//!
//! ```ignore
//! use exarrow_rs::export::arrow::{ArrowExportOptions, CsvToArrowReader};
//! use arrow::datatypes::{Schema, Field, DataType};
//! use std::sync::Arc;
//!
//! // Create a schema
//! let schema = Arc::new(Schema::new(vec![
//! Field::new("id", DataType::Int64, false),
//! Field::new("name", DataType::Utf8, true),
//! ]));
//!
//! // Create options
//! let options = ArrowExportOptions::default()
//! .with_batch_size(2048)
//! .with_schema(schema);
//! ```
// Re-export CSV types for convenience
pub use ;
// Re-export Parquet types for convenience
pub use ;
// Re-export Arrow types for convenience
pub use ;