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

Commit

Permalink
update to odbc-api 0.36.0 (#925)
Browse files Browse the repository at this point in the history
  • Loading branch information
pacman82 committed Mar 21, 2022
1 parent be5c88e commit b62868d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ strength_reduce = { version = "0.2", optional = true }
multiversion = { version = "0.6.1", optional = true }

# For support for odbc
odbc-api = { version = "0.35", optional = true }
odbc-api = { version = "0.36", optional = true }

[dev-dependencies]
criterion = "0.3"
Expand Down
14 changes: 7 additions & 7 deletions src/io/odbc/read/deserialize.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use chrono::{NaiveDate, NaiveDateTime};
use odbc_api::buffers::{BinColumnIt, TextColumnIt};
use odbc_api::buffers::{BinColumnView, TextColumnView};
use odbc_api::Bit;

use crate::array::{Array, BinaryArray, BooleanArray, PrimitiveArray, Utf8Array};
Expand All @@ -14,9 +14,9 @@ use super::super::api::buffers::AnyColumnView;
/// This is CPU-bounded
pub fn deserialize(column: AnyColumnView, data_type: DataType) -> Box<dyn Array> {
match column {
AnyColumnView::Text(iter) => Box::new(utf8(data_type, iter)) as _,
AnyColumnView::Text(view) => Box::new(utf8(data_type, view)) as _,
AnyColumnView::WText(_) => todo!(),
AnyColumnView::Binary(iter) => Box::new(binary(data_type, iter)) as _,
AnyColumnView::Binary(view) => Box::new(binary(data_type, view)) as _,
AnyColumnView::Date(values) => Box::new(date(data_type, values)) as _,
AnyColumnView::Time(values) => Box::new(time(data_type, values)) as _,
AnyColumnView::Timestamp(values) => Box::new(timestamp(data_type, values)) as _,
Expand Down Expand Up @@ -139,15 +139,15 @@ fn binary_generic<'a>(
(offsets.into(), values.into(), validity.into())
}

fn binary(data_type: DataType, iter: BinColumnIt) -> BinaryArray<i32> {
let (offsets, values, validity) = binary_generic(iter);
fn binary(data_type: DataType, view: BinColumnView) -> BinaryArray<i32> {
let (offsets, values, validity) = binary_generic(view.iter());

// this O(N) check is not necessary
BinaryArray::from_data(data_type, offsets, values, validity)
}

fn utf8(data_type: DataType, iter: TextColumnIt<u8>) -> Utf8Array<i32> {
let (offsets, values, validity) = binary_generic(iter);
fn utf8(data_type: DataType, view: TextColumnView<u8>) -> Utf8Array<i32> {
let (offsets, values, validity) = binary_generic(view.iter());

// this O(N) check is necessary for the utf8 validity
Utf8Array::from_data(data_type, offsets, values, validity)
Expand Down

0 comments on commit b62868d

Please sign in to comment.