Skip to content

Commit 7db9aa6

Browse files
authored
chore: Move remaining expressions to spark-expr crate + some minor refactoring (apache#1165)
* move CheckOverflow to spark-expr crate * move NegativeExpr to spark-expr crate * move UnboundColumn to spark-expr crate * move ExpandExec from execution::datafusion::operators to execution::operators * refactoring to remove datafusion subpackage * update imports in benches * fix * fix
1 parent 49cf0d7 commit 7db9aa6

File tree

28 files changed

+63
-104
lines changed

28 files changed

+63
-104
lines changed

native/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

native/core/benches/bloom_filter_agg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use arrow::datatypes::{DataType, Field, Schema};
1919
use arrow_array::builder::Int64Builder;
2020
use arrow_array::{ArrayRef, RecordBatch};
2121
use arrow_schema::SchemaRef;
22-
use comet::execution::datafusion::expressions::bloom_filter_agg::BloomFilterAgg;
22+
use comet::execution::expressions::bloom_filter_agg::BloomFilterAgg;
2323
use criterion::{black_box, criterion_group, criterion_main, Criterion};
2424
use datafusion::physical_expr::PhysicalExpr;
2525
use datafusion::physical_plan::aggregates::{AggregateExec, AggregateMode, PhysicalGroupBy};

native/core/benches/shuffle_writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
use arrow_array::{builder::StringBuilder, RecordBatch};
1919
use arrow_schema::{DataType, Field, Schema};
20-
use comet::execution::datafusion::shuffle_writer::ShuffleWriterExec;
20+
use comet::execution::shuffle::ShuffleWriterExec;
2121
use criterion::{criterion_group, criterion_main, Criterion};
2222
use datafusion::{
2323
physical_plan::{common::collect, memory::MemoryExec, ExecutionPlan},

native/core/src/execution/datafusion/expressions/mod.rs

Lines changed: 0 additions & 35 deletions
This file was deleted.

native/core/src/execution/datafusion/operators/mod.rs

Lines changed: 0 additions & 18 deletions
This file was deleted.

native/core/src/execution/datafusion/expressions/bloom_filter_agg.rs renamed to native/core/src/execution/expressions/bloom_filter_agg.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use arrow_schema::Field;
1919
use datafusion::{arrow::datatypes::DataType, logical_expr::Volatility};
2020
use std::{any::Any, sync::Arc};
2121

22-
use crate::execution::datafusion::util::spark_bloom_filter;
23-
use crate::execution::datafusion::util::spark_bloom_filter::SparkBloomFilter;
22+
use crate::execution::util::spark_bloom_filter;
23+
use crate::execution::util::spark_bloom_filter::SparkBloomFilter;
2424
use arrow::array::ArrayRef;
2525
use arrow_array::BinaryArray;
2626
use datafusion::error::Result;

native/core/src/execution/datafusion/expressions/bloom_filter_might_contain.rs renamed to native/core/src/execution/expressions/bloom_filter_might_contain.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
use crate::{
19-
execution::datafusion::util::spark_bloom_filter::SparkBloomFilter, parquet::data_type::AsBytes,
20-
};
18+
use crate::{execution::util::spark_bloom_filter::SparkBloomFilter, parquet::data_type::AsBytes};
2119
use arrow::record_batch::RecordBatch;
2220
use arrow_array::cast::as_primitive_array;
2321
use arrow_schema::{DataType, Schema};

native/core/src/execution/datafusion/mod.rs renamed to native/core/src/execution/expressions/mod.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
//! Native execution through DataFusion
18+
//! Native DataFusion expressions
1919
20-
pub mod expressions;
21-
mod operators;
22-
pub mod planner;
23-
pub mod shuffle_writer;
24-
pub(crate) mod spark_plan;
25-
mod util;
20+
pub mod bloom_filter_agg;
21+
pub mod bloom_filter_might_contain;
22+
pub mod subquery;
23+
24+
pub use datafusion_comet_spark_expr::EvalMode;

native/core/src/execution/datafusion/expressions/subquery.rs renamed to native/core/src/execution/expressions/subquery.rs

File renamed without changes.

native/core/src/execution/jni_api.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ use super::{serde, utils::SparkArrowConvert, CometMemoryPool};
4545
use crate::{
4646
errors::{try_unwrap_or_throw, CometError, CometResult},
4747
execution::{
48-
datafusion::planner::PhysicalPlanner, metrics::utils::update_comet_metric,
49-
serde::to_arrow_datatype, shuffle::row::process_sorted_row_partition, sort::RdxSort,
48+
metrics::utils::update_comet_metric, planner::PhysicalPlanner, serde::to_arrow_datatype,
49+
shuffle::row::process_sorted_row_partition, sort::RdxSort,
5050
},
5151
jvm_bridge::{jni_new_global_ref, JVMClasses},
5252
};
@@ -59,8 +59,8 @@ use jni::{
5959
};
6060
use tokio::runtime::Runtime;
6161

62-
use crate::execution::datafusion::spark_plan::SparkPlan;
6362
use crate::execution::operators::ScanExec;
63+
use crate::execution::spark_plan::SparkPlan;
6464
use log::info;
6565

6666
/// Comet native execution context. Kept alive across JNI calls.

0 commit comments

Comments
 (0)