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 @@ -1134,7 +1134,7 @@ pub fn transform_response<V: ValueObject>(
11341134 ) )
11351135 } ) ?;
11361136 // TODO switch parsing to microseconds
1137- if timestamp. timestamp_millis( ) > ( ( ( 1i64 ) << 62 ) / 1_000_000 ) {
1137+ if timestamp. and_utc ( ) . timestamp_millis( ) > ( ( ( 1i64 ) << 62 ) / 1_000_000 ) {
11381138 builder. append_null( ) ?;
11391139 } else if let Some ( nanos) = timestamp. timestamp_nanos_opt( ) {
11401140 builder. append_value( nanos) ?;
@@ -1176,10 +1176,10 @@ pub fn transform_response<V: ValueObject>(
11761176 ) )
11771177 } ) ?;
11781178 // TODO switch parsing to microseconds
1179- if timestamp. timestamp_millis( ) > ( ( ( 1 as i64 ) << 62 ) / 1_000_000 ) {
1179+ if timestamp. and_utc ( ) . timestamp_millis( ) > ( ( ( 1 as i64 ) << 62 ) / 1_000_000 ) {
11801180 builder. append_null( ) ?;
11811181 } else {
1182- builder. append_value( timestamp. timestamp_millis( ) ) ?;
1182+ builder. append_value( timestamp. and_utc ( ) . timestamp_millis( ) ) ?;
11831183 }
11841184 } ,
11851185 } ,
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 ) ?;
@@ -1572,7 +1574,7 @@ pub fn create_str_to_date_udf() -> ScalarUDF {
15721574 } ) ?;
15731575
15741576 Ok ( ColumnarValue :: Scalar ( ScalarValue :: TimestampNanosecond (
1575- Some ( res. timestamp_nanos_opt ( ) . unwrap ( ) ) ,
1577+ Some ( res. and_utc ( ) . timestamp_nanos_opt ( ) . unwrap ( ) ) ,
15761578 None ,
15771579 ) ) )
15781580 } ) ;
@@ -2345,7 +2347,7 @@ macro_rules! generate_series_helper_timestamp {
23452347 ) )
23462348 } ) ?;
23472349 let res = date_addsub_month_day_nano( current_dt, $STEP, true ) ?;
2348- $CURRENT = res. timestamp_nanos_opt( ) . unwrap( ) as $PRIMITIVE_TYPE;
2350+ $CURRENT = res. and_utc ( ) . timestamp_nanos_opt( ) . unwrap( ) as $PRIMITIVE_TYPE;
23492351 } ;
23502352}
23512353
@@ -3230,6 +3232,7 @@ pub fn create_date_to_timestamp_udf() -> ScalarUDF {
32303232 ) ?;
32313233 Ok ( Some (
32323234 NaiveDateTime :: new ( date, time)
3235+ . and_utc ( )
32333236 . timestamp_nanos_opt ( )
32343237 . unwrap ( ) ,
32353238 ) )
Original file line number Diff line number Diff line change @@ -4117,8 +4117,8 @@ impl FilterRules {
41174117 } ;
41184118
41194119 let ( Some ( start_date) , Some ( end_date) ) = (
4120- start_date. timestamp_nanos_opt ( ) ,
4121- end_date. timestamp_nanos_opt ( ) ,
4120+ start_date. and_utc ( ) . timestamp_nanos_opt ( ) ,
4121+ end_date. and_utc ( ) . timestamp_nanos_opt ( ) ,
41224122 ) else {
41234123 return false ;
41244124 } ;
You can’t perform that action at this time.
0 commit comments