File tree Expand file tree Collapse file tree 6 files changed +12
-15
lines changed
packages/cubejs-backend-native
rust/cubesql/cubesql/src/compile Expand file tree Collapse file tree 6 files changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ export class ResultWrapper extends BaseWrapper implements DataResult {
5757 const array = this . getArray ( ) ;
5858 const l = array . length ;
5959
60- return function * ( ) {
60+ return function * yieldArrayItem ( ) {
6161 for ( let i = 0 ; i < l ; i ++ ) {
6262 yield array [ i ] ;
6363 }
Original file line number Diff line number Diff line change @@ -31,12 +31,6 @@ pub fn register_module(cx: &mut ModuleContext) -> NeonResult<()> {
3131 Ok ( ( ) )
3232}
3333
34- // #[derive(Debug, Clone)]
35- // pub enum ResultWrapperData {
36- // JsObj(RecordBatch),
37- // Native()
38- // }
39-
4034#[ derive( Debug , Clone ) ]
4135pub struct ResultWrapper {
4236 transform_data : TransformDataRequest ,
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import * as native from '../js';
66import metaFixture from './meta' ;
77import { FakeRowStream } from './response-fake' ;
88
9- const logger = jest . fn ( ( { event } ) => {
9+ const _logger = jest . fn ( ( { event } ) => {
1010 if (
1111 ! event . error . includes (
1212 'load - strange response, success which contains error'
Original file line number Diff line number Diff line change @@ -1127,7 +1127,7 @@ pub fn transform_response<V: ValueObject>(
11271127 ) )
11281128 } ) ?;
11291129 // TODO switch parsing to microseconds
1130- if timestamp. timestamp_millis( ) > ( ( ( 1i64 ) << 62 ) / 1_000_000 ) {
1130+ if timestamp. and_utc ( ) . timestamp_millis( ) > ( ( ( 1i64 ) << 62 ) / 1_000_000 ) {
11311131 builder. append_null( ) ?;
11321132 } else if let Some ( nanos) = timestamp. timestamp_nanos_opt( ) {
11331133 builder. append_value( nanos) ?;
@@ -1169,10 +1169,10 @@ pub fn transform_response<V: ValueObject>(
11691169 ) )
11701170 } ) ?;
11711171 // TODO switch parsing to microseconds
1172- if timestamp. timestamp_millis( ) > ( ( ( 1 as i64 ) << 62 ) / 1_000_000 ) {
1172+ if timestamp. and_utc ( ) . timestamp_millis( ) > ( ( ( 1 as i64 ) << 62 ) / 1_000_000 ) {
11731173 builder. append_null( ) ?;
11741174 } else {
1175- builder. append_value( timestamp. timestamp_millis( ) ) ?;
1175+ builder. append_value( timestamp. and_utc ( ) . timestamp_millis( ) ) ?;
11761176 }
11771177 } ,
11781178 } ,
Original file line number Diff line number Diff line change @@ -1029,6 +1029,7 @@ pub fn create_date_udf() -> ScalarUDF {
10291029 builder. append_value (
10301030 NaiveDateTime :: parse_from_str ( strings. value ( i) , "%Y-%m-%d %H:%M:%S%.f" )
10311031 . map_err ( |e| DataFusionError :: Execution ( e. to_string ( ) ) ) ?
1032+ . and_utc ( )
10321033 . timestamp_nanos_opt ( )
10331034 . unwrap ( ) ,
10341035 ) ?;
@@ -1233,6 +1234,7 @@ macro_rules! date_math_udf {
12331234 let interval = intervals. value( i) . into( ) ;
12341235 builder. append_value(
12351236 $FUN( timestamp, interval, $IS_ADD) ?
1237+ . and_utc( )
12361238 . timestamp_nanos_opt( )
12371239 . unwrap( ) ,
12381240 ) ?;
@@ -1569,7 +1571,7 @@ pub fn create_str_to_date_udf() -> ScalarUDF {
15691571 } ) ?;
15701572
15711573 Ok ( ColumnarValue :: Scalar ( ScalarValue :: TimestampNanosecond (
1572- Some ( res. timestamp_nanos_opt ( ) . unwrap ( ) ) ,
1574+ Some ( res. and_utc ( ) . timestamp_nanos_opt ( ) . unwrap ( ) ) ,
15731575 None ,
15741576 ) ) )
15751577 } ) ;
@@ -2339,7 +2341,7 @@ macro_rules! generate_series_helper_timestamp {
23392341 ) )
23402342 } ) ?;
23412343 let res = date_addsub_month_day_nano( current_dt, $STEP, true ) ?;
2342- $CURRENT = res. timestamp_nanos_opt( ) . unwrap( ) as $PRIMITIVE_TYPE;
2344+ $CURRENT = res. and_utc ( ) . timestamp_nanos_opt( ) . unwrap( ) as $PRIMITIVE_TYPE;
23432345 } ;
23442346}
23452347
@@ -3397,6 +3399,7 @@ pub fn create_date_to_timestamp_udf() -> ScalarUDF {
33973399 ) ?;
33983400 Ok ( Some (
33993401 NaiveDateTime :: new ( date, time)
3402+ . and_utc ( )
34003403 . timestamp_nanos_opt ( )
34013404 . unwrap ( ) ,
34023405 ) )
Original file line number Diff line number Diff line change @@ -4118,8 +4118,8 @@ impl FilterRules {
41184118 } ;
41194119
41204120 let ( Some ( start_date) , Some ( end_date) ) = (
4121- start_date. timestamp_nanos_opt ( ) ,
4122- end_date. timestamp_nanos_opt ( ) ,
4121+ start_date. and_utc ( ) . timestamp_nanos_opt ( ) ,
4122+ end_date. and_utc ( ) . timestamp_nanos_opt ( ) ,
41234123 ) else {
41244124 return false ;
41254125 } ;
You can’t perform that action at this time.
0 commit comments