File tree Expand file tree Collapse file tree 3 files changed +13
-11
lines changed
core/src/execution/expressions
spark-expr/src/json_funcs
spark/src/test/scala/org/apache/comet Expand file tree Collapse file tree 3 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -112,16 +112,15 @@ impl ExpressionBuilder for FromJsonBuilder {
112112 ) -> Result < Arc < dyn PhysicalExpr > , ExecutionError > {
113113 let expr = extract_expr ! ( spark_expr, FromJson ) ;
114114 let child = planner. create_expr (
115- expr. child
116- . as_ref ( )
117- . ok_or_else ( || ExecutionError :: GeneralError ( "FromJson missing child" . to_string ( ) ) ) ?,
115+ expr. child . as_ref ( ) . ok_or_else ( || {
116+ ExecutionError :: GeneralError ( "FromJson missing child" . to_string ( ) )
117+ } ) ?,
118118 input_schema,
119119 ) ?;
120- let schema = to_arrow_datatype (
121- expr. schema
122- . as_ref ( )
123- . ok_or_else ( || ExecutionError :: GeneralError ( "FromJson missing schema" . to_string ( ) ) ) ?,
124- ) ;
120+ let schema =
121+ to_arrow_datatype ( expr. schema . as_ref ( ) . ok_or_else ( || {
122+ ExecutionError :: GeneralError ( "FromJson missing schema" . to_string ( ) )
123+ } ) ?) ;
125124 Ok ( Arc :: new ( FromJson :: new ( child, schema, & expr. timezone ) ) )
126125 }
127126}
Original file line number Diff line number Diff line change @@ -501,7 +501,11 @@ mod tests {
501501
502502 // All rows should have non-null structs with null field values
503503 for i in 0 ..4 {
504- assert ! ( !struct_array. is_null( i) , "Row {} struct should not be null" , i) ;
504+ assert ! (
505+ !struct_array. is_null( i) ,
506+ "Row {} struct should not be null" ,
507+ i
508+ ) ;
505509 assert ! ( a_array. is_null( i) , "Row {} field a should be null" , i) ;
506510 assert ! ( b_array. is_null( i) , "Row {} field b should be null" , i) ;
507511 }
Original file line number Diff line number Diff line change @@ -33,8 +33,7 @@ class CometJsonExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelpe
3333 override protected def test (testName : String , testTags : Tag * )(testFun : => Any )(implicit
3434 pos : Position ): Unit = {
3535 super .test(testName, testTags : _* ) {
36- withSQLConf(
37- CometConf .getExprAllowIncompatConfigKey(classOf [JsonToStructs ]) -> " true" ) {
36+ withSQLConf(CometConf .getExprAllowIncompatConfigKey(classOf [JsonToStructs ]) -> " true" ) {
3837 testFun
3938 }
4039 }
You can’t perform that action at this time.
0 commit comments