File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
rust/cubesql/cubesql/src/compile/rewrite Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -261,8 +261,12 @@ macro_rules! variant_field_struct {
261261
262262 impl FromStr for [ <$variant $var_field: camel>] {
263263 type Err = $crate:: compile:: rewrite:: language:: LanguageParseError ;
264- fn from_str( _s: & str ) -> Result <Self , Self :: Err > {
265- Err ( Self :: Err :: NotSupported )
264+ fn from_str( s: & str ) -> Result <Self , Self :: Err > {
265+ const PREFIX : & ' static str = concat!( std:: stringify!( [ <$variant $var_field: camel>] ) , ":" ) ;
266+ if let Some ( suffix) = s. strip_prefix( PREFIX ) {
267+ return Ok ( [ <$variant $var_field: camel>] ( suffix. to_string( ) ) ) ;
268+ }
269+ Err ( Self :: Err :: ShouldStartWith ( PREFIX ) )
266270 }
267271 }
268272
Original file line number Diff line number Diff line change @@ -1419,9 +1419,13 @@ fn window_fun_expr_var_arg(
14191419}
14201420
14211421fn udaf_expr ( fun_name : impl Display , args : Vec < impl Display > ) -> String {
1422+ let prefix = if fun_name. to_string ( ) . starts_with ( "?" ) {
1423+ ""
1424+ } else {
1425+ "AggregateUDFExprFun:"
1426+ } ;
14221427 format ! (
1423- "(AggregateUDFExpr {} {})" ,
1424- fun_name,
1428+ "(AggregateUDFExpr {prefix}{fun_name} {})" ,
14251429 list_expr( "AggregateUDFExprArgs" , args) ,
14261430 )
14271431}
You can’t perform that action at this time.
0 commit comments