Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions native/core/src/execution/jni_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,12 +503,7 @@ pub unsafe extern "system" fn Java_org_apache_comet_Native_executePlan(
let task_ctx = exec_context.session_ctx.task_ctx();
// Each Comet native execution corresponds to a single Spark partition,
// so we should always execute partition 0.
let stream = exec_context
.root_op
.as_ref()
.unwrap()
.native_plan
.execute(0, task_ctx)?;
let stream = root_op.native_plan.execute(0, task_ctx)?;
exec_context.stream = Some(stream);
} else {
// Pull input batches
Expand Down Expand Up @@ -619,8 +614,7 @@ pub extern "system" fn Java_org_apache_comet_Native_releasePlan(

/// Updates the metrics of the query plan.
fn update_metrics(env: &mut JNIEnv, exec_context: &mut ExecutionContext) -> CometResult<()> {
if exec_context.root_op.is_some() {
let native_query = exec_context.root_op.as_ref().unwrap();
if let Some(native_query) = &exec_context.root_op {
let metrics = exec_context.metrics.as_obj();
update_comet_metric(env, metrics, native_query)
} else {
Expand Down
5 changes: 2 additions & 3 deletions native/core/src/parquet/schema_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,9 @@ impl SchemaMapper for SchemaMapping {
// If this field only exists in the table, and not in the file, then we need to
// populate a default value for it.
|| {
if self.default_values.is_some() {
if let Some(default_values) = &self.default_values {
// We have a map of default values, see if this field is in there.
if let Some(value) =
self.default_values.as_ref().unwrap().get(&field_idx)
if let Some(value) = default_values.get(&field_idx)
// Default value exists, construct a column from it.
{
let cv = if field.data_type() == &value.data_type() {
Expand Down
Loading