File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
packages/cubejs-backend-native/src
rust/cubeorchestrator/src Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -510,15 +510,15 @@ fn debug_js_to_clrepr_to_js(mut cx: FunctionContext) -> JsResult<JsValue> {
510510
511511fn parse_cubestore_ws_result_message ( mut cx : FunctionContext ) -> JsResult < JsValue > {
512512 let msg = cx. argument :: < JsBuffer > ( 0 ) ?;
513- let msg_data = msg. as_slice ( & cx) ;
514- match parse_cubestore_ws_result ( msg_data) {
513+ let msg_data = msg. as_slice ( & cx) . to_vec ( ) ;
514+ match parse_cubestore_ws_result ( & * msg_data) {
515515 Ok ( result) => {
516516 let js_array = JsArray :: new ( & mut cx, result. len ( ) ) ;
517517 for ( i, row) in result. into_iter ( ) . enumerate ( ) {
518518 let js_row = JsObject :: new ( & mut cx) ;
519519 for ( key, value) in row. into_iter ( ) {
520- let js_key = cx. string ( & key) ;
521- let js_value = cx. string ( & value) ;
520+ let js_key = cx. string ( key) ;
521+ let js_value = cx. string ( value) ;
522522 js_row. set ( & mut cx, js_key, js_value) ?;
523523 }
524524 js_array. set ( & mut cx, i as u32 , js_row) ?;
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ impl std::error::Error for ParseError {}
3030
3131pub fn parse_cubestore_ws_result (
3232 msg_data : & [ u8 ] ,
33- ) -> Result < Vec < HashMap < String , String > > , ParseError > {
33+ ) -> Result < Vec < HashMap < & str , & str > > , ParseError > {
3434 let http_message =
3535 root_as_http_message ( msg_data) . map_err ( |_| ParseError :: FlatBufferError ) ?;
3636
@@ -57,7 +57,7 @@ pub fn parse_cubestore_ws_result(
5757 if column. is_empty ( ) {
5858 return Err ( ParseError :: ColumnNameNotDefined ) ;
5959 }
60- columns. push ( column. to_string ( ) ) ;
60+ columns. push ( column) ;
6161 }
6262
6363 let result_set_rows = result_set. rows ( ) . ok_or ( ParseError :: EmptyResultSet ) ?;
@@ -69,7 +69,7 @@ pub fn parse_cubestore_ws_result(
6969
7070 for ( i, val) in values. iter ( ) . enumerate ( ) {
7171 let value = val. string_value ( ) . ok_or ( ParseError :: ColumnValueMissed ) ?;
72- row_obj. insert ( columns[ i] . clone ( ) , value. to_string ( ) ) ;
72+ row_obj. insert ( columns[ i] , value) ;
7373 }
7474
7575 result. push ( row_obj) ;
You can’t perform that action at this time.
0 commit comments