File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ build-backend = "maturin"
55[project ]
66name = " lakeapi2sql"
77requires-python = " >=3.10"
8- version = " 0.8.1 "
8+ version = " 0.8.2 "
99classifiers = [
1010 " Programming Language :: Rust" ,
1111 " Programming Language :: Python :: Implementation :: CPython" ,
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ use arrow::array::StringArray;
1818use arrow:: array:: Time32SecondArray ;
1919use arrow:: array:: TimestampMicrosecondArray ;
2020use arrow:: array:: TimestampMillisecondArray ;
21+ use arrow:: array:: TimestampNanosecondArray ;
2122use arrow:: array:: UInt16Array ;
2223use arrow:: array:: UInt32Array ;
2324use arrow:: array:: UInt64Array ;
@@ -194,6 +195,27 @@ pub(crate) fn get_token_rows<'a, 'b>(
194195 rowindex += 1 ;
195196 }
196197 }
198+ arrow:: datatypes:: DataType :: Timestamp ( arrow:: datatypes:: TimeUnit :: Nanosecond , _) => {
199+ let ba = col
200+ . as_any ( )
201+ . downcast_ref :: < TimestampNanosecondArray > ( )
202+ . unwrap ( ) ;
203+
204+ let mut rowindex = 0 ;
205+ for val in ba. iter ( ) {
206+ token_rows[ rowindex] . push ( match val {
207+ Some ( vs) => {
208+ if vs < 0 {
209+ ColumnData :: DateTime2 ( None )
210+ } else {
211+ to_col_dt ( ( unix_min + StdDuration :: from_nanos ( vs as u64 ) ) . to_sql ( ) )
212+ }
213+ }
214+ None => ColumnData :: DateTime2 ( None ) ,
215+ } ) ;
216+ rowindex += 1 ;
217+ }
218+ }
197219 arrow:: datatypes:: DataType :: Null => {
198220 if coltype == & ColumnType :: BigVarChar
199221 || coltype == & ColumnType :: Text
You can’t perform that action at this time.
0 commit comments