File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -503,12 +503,7 @@ pub unsafe extern "system" fn Java_org_apache_comet_Native_executePlan(
503503 let task_ctx = exec_context. session_ctx . task_ctx ( ) ;
504504 // Each Comet native execution corresponds to a single Spark partition,
505505 // so we should always execute partition 0.
506- let stream = exec_context
507- . root_op
508- . as_ref ( )
509- . unwrap ( )
510- . native_plan
511- . execute ( 0 , task_ctx) ?;
506+ let stream = root_op. native_plan . execute ( 0 , task_ctx) ?;
512507 exec_context. stream = Some ( stream) ;
513508 } else {
514509 // Pull input batches
@@ -619,8 +614,7 @@ pub extern "system" fn Java_org_apache_comet_Native_releasePlan(
619614
620615/// Updates the metrics of the query plan.
621616fn update_metrics ( env : & mut JNIEnv , exec_context : & mut ExecutionContext ) -> CometResult < ( ) > {
622- if exec_context. root_op . is_some ( ) {
623- let native_query = exec_context. root_op . as_ref ( ) . unwrap ( ) ;
617+ if let Some ( native_query) = & exec_context. root_op {
624618 let metrics = exec_context. metrics . as_obj ( ) ;
625619 update_comet_metric ( env, metrics, native_query)
626620 } else {
Original file line number Diff line number Diff line change @@ -209,10 +209,9 @@ impl SchemaMapper for SchemaMapping {
209209 // If this field only exists in the table, and not in the file, then we need to
210210 // populate a default value for it.
211211 || {
212- if self . default_values . is_some ( ) {
212+ if let Some ( default_values ) = & self . default_values {
213213 // We have a map of default values, see if this field is in there.
214- if let Some ( value) =
215- self . default_values . as_ref ( ) . unwrap ( ) . get ( & field_idx)
214+ if let Some ( value) = default_values. get ( & field_idx)
216215 // Default value exists, construct a column from it.
217216 {
218217 let cv = if field. data_type ( ) == & value. data_type ( ) {
You can’t perform that action at this time.
0 commit comments