Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Exposed IPCWriteOptions in io::ipc::write. #266

Merged
merged 1 commit into from
Aug 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async fn upload_data(
) -> Result {
let (mut upload_tx, upload_rx) = mpsc::channel(10);

let options = write::common::IpcWriteOptions::default();
let options = write::IpcWriteOptions::default();
let mut schema_flight_data =
arrow_flight::utils::flight_data_from_arrow_schema(&schema, &options);
schema_flight_data.flight_descriptor = Some(descriptor.clone());
Expand Down Expand Up @@ -128,7 +128,7 @@ async fn send_batch(
upload_tx: &mut mpsc::Sender<FlightData>,
metadata: &[u8],
batch: &RecordBatch,
options: &write::common::IpcWriteOptions,
options: &write::IpcWriteOptions,
) -> Result {
let (dictionary_flight_data, mut batch_flight_data) =
arrow_flight::utils::flight_data_from_arrow_batch(batch, &options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl FlightService for FlightServiceImpl {
.get(&key)
.ok_or_else(|| Status::not_found(format!("Could not find flight. {}", key)))?;

let options = ipc::write::common::IpcWriteOptions::default();
let options = ipc::write::IpcWriteOptions::default();

let schema = std::iter::once({
Ok(arrow_flight::utils::flight_data_from_arrow_schema(
Expand Down Expand Up @@ -174,7 +174,7 @@ impl FlightService for FlightServiceImpl {

let total_records: usize = flight.chunks.iter().map(|chunk| chunk.num_rows()).sum();

let options = ipc::write::common::IpcWriteOptions::default();
let options = ipc::write::IpcWriteOptions::default();
let schema =
arrow_flight::utils::ipc_message_from_arrow_schema(&flight.schema, &options)
.expect(
Expand Down
3 changes: 2 additions & 1 deletion src/compute/cast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl Default for CastOptions {

impl CastOptions {
fn with_wrapped(&self, v: bool) -> Self {
let mut option = self.clone();
let mut option = *self;
option.wrapped = v;
option
}
Expand Down Expand Up @@ -1234,6 +1234,7 @@ mod tests {
assert_eq!(expected, result.as_ref());
}

#[test]
fn list_to_list() {
let data = vec![
Some(vec![Some(1i32), Some(2), Some(3)]),
Expand Down
6 changes: 1 addition & 5 deletions src/compute/cast/primitive_to.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,7 @@ where
I: NativeType + num::traits::AsPrimitive<O>,
O: NativeType,
{
unary(
from,
|x| num::traits::AsPrimitive::<O>::as_(x),
to_type.clone(),
)
unary(from, num::traits::AsPrimitive::<O>::as_, to_type.clone())
}

/// Cast [`PrimitiveArray`] to a [`PrimitiveArray`] of the same physical type.
Expand Down
1 change: 1 addition & 0 deletions src/io/ipc/write/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ mod stream;
mod writer;

pub use super::gen::Schema::MetadataVersion;
pub use common::IpcWriteOptions;
pub use schema::schema_to_bytes;
pub use serialize::{write, write_dictionary};
pub use stream::StreamWriter;
Expand Down