Skip to content
Closed
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
1 change: 1 addition & 0 deletions rust/arrow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ lazy_static = "1.2"
packed_simd = { version = "0.3.1", optional = true }
chrono = "0.4"
flatbuffers = "0.6.0"
hex = "0.4"

[features]
simd = ["packed_simd"]
Expand Down
2 changes: 1 addition & 1 deletion rust/arrow/benches/csv_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn record_batches_to_csv() {
Field::new("c3", DataType::Boolean, true),
]);

let c1 = BinaryArray::from(vec![
let c1 = StringArray::from(vec![
"Lorem ipsum dolor sit amet",
"consectetur adipiscing elit",
"sed do eiusmod tempor",
Expand Down
6 changes: 3 additions & 3 deletions rust/arrow/examples/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ extern crate arrow;
use std::sync::Arc;

use arrow::array::{
Array, ArrayData, BinaryArray, BooleanArray, Int32Array, Int32Builder, ListArray,
PrimitiveArray, StructArray,
Array, ArrayData, BooleanArray, Int32Array, Int32Builder, ListArray, PrimitiveArray,
StringArray, StructArray,
};
use arrow::buffer::Buffer;
use arrow::datatypes::{DataType, Date64Type, Field, Time64NanosecondType, ToByteSlice};
Expand Down Expand Up @@ -83,7 +83,7 @@ fn main() {
.add_buffer(Buffer::from(&values[..]))
.null_bit_buffer(Buffer::from([0b00000101]))
.build();
let binary_array = BinaryArray::from(array_data);
let binary_array = StringArray::from(array_data);
println!("{:?}", binary_array);

// ListArrays are similar to ByteArrays: they are arrays of other
Expand Down
2 changes: 1 addition & 1 deletion rust/arrow/examples/dynamic_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn main() -> Result<()> {
let nested = StructArray::from(vec![
(
Field::new("a", DataType::Utf8, false),
Arc::new(BinaryArray::from(vec!["a", "b", "c", "d", "e"])) as Arc<dyn Array>,
Arc::new(StringArray::from(vec!["a", "b", "c", "d", "e"])) as Arc<dyn Array>,
),
(
Field::new("b", DataType::Float64, false),
Expand Down
8 changes: 3 additions & 5 deletions rust/arrow/examples/read_csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extern crate arrow;
use std::fs::File;
use std::sync::Arc;

use arrow::array::{BinaryArray, Float64Array};
use arrow::array::{Float64Array, StringArray};
use arrow::csv;
use arrow::datatypes::{DataType, Field, Schema};

Expand All @@ -45,7 +45,7 @@ fn main() {
let city = batch
.column(0)
.as_any()
.downcast_ref::<BinaryArray>()
.downcast_ref::<StringArray>()
.unwrap();
let lat = batch
.column(1)
Expand All @@ -59,11 +59,9 @@ fn main() {
.unwrap();

for i in 0..batch.num_rows() {
let city_name: String = String::from_utf8(city.value(i).to_vec()).unwrap();

println!(
"City: {}, Latitude: {}, Longitude: {}",
city_name,
city.value(i),
lat.value(i),
lng.value(i)
);
Expand Down
8 changes: 3 additions & 5 deletions rust/arrow/examples/read_csv_infer_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

extern crate arrow;

use arrow::array::{BinaryArray, Float64Array};
use arrow::array::{Float64Array, StringArray};
use arrow::csv;
use std::fs::File;

Expand All @@ -40,7 +40,7 @@ fn main() {
let city = batch
.column(0)
.as_any()
.downcast_ref::<BinaryArray>()
.downcast_ref::<StringArray>()
.unwrap();
let lat = batch
.column(1)
Expand All @@ -54,11 +54,9 @@ fn main() {
.unwrap();

for i in 0..batch.num_rows() {
let city_name: String = String::from_utf8(city.value(i).to_vec()).unwrap();

println!(
"City: {}, Latitude: {}, Longitude: {}",
city_name,
city.value(i),
lat.value(i),
lng.value(i)
);
Expand Down
Loading