Skip to content

Commit 64cc561

Browse files
committed
some conversion
1 parent 2b9ab7d commit 64cc561

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lake2sql"
3-
version = "0.8.1"
3+
version = "0.8.3"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "maturin"
55
[project]
66
name = "lakeapi2sql"
77
requires-python = ">=3.10"
8-
version = "0.8.2"
8+
version = "0.8.3"
99
classifiers = [
1010
"Programming Language :: Rust",
1111
"Programming Language :: Python :: Implementation :: CPython",

src/arrow_convert.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -352,11 +352,21 @@ pub(crate) fn get_token_rows<'a, 'b>(
352352
}
353353
arrow::datatypes::DataType::Float64 => {
354354
let ba = col.as_any().downcast_ref::<Float64Array>().unwrap();
355-
356-
let mut rowindex = 0;
357-
for val in ba.iter() {
358-
token_rows[rowindex].push(ColumnData::F64(val));
359-
rowindex += 1;
355+
if coltype == &ColumnType::Int4 || coltype == &ColumnType::Intn {
356+
let mut rowindex = 0;
357+
for val in ba.iter() {
358+
token_rows[rowindex].push(ColumnData::I32(match val {
359+
Some(v) => Some(v as i32),
360+
None => None,
361+
}));
362+
rowindex += 1;
363+
}
364+
} else {
365+
let mut rowindex = 0;
366+
for val in ba.iter() {
367+
token_rows[rowindex].push(ColumnData::F64(val));
368+
rowindex += 1;
369+
}
360370
}
361371
}
362372
arrow::datatypes::DataType::Date32 => {

0 commit comments

Comments
 (0)