Skip to content

Commit 4ba26ae

Browse files
committed
Merge remote-tracking branch 'apache/main' into cast-array-to-string
2 parents 6bc1c1b + c27a426 commit 4ba26ae

44 files changed

Lines changed: 391 additions & 353 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/rust-test/action.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,14 @@ runs:
6161
cd common
6262
../mvnw -B clean compile -DskipTests
6363
64+
- name: Install nextest
65+
shell: bash
66+
run: |
67+
cargo install cargo-nextest --locked
68+
6469
- name: Run Cargo test
6570
shell: bash
6671
run: |
6772
cd native
68-
RUST_BACKTRACE=1 cargo test
73+
RUST_BACKTRACE=1 cargo nextest run
74+

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
.PHONY: all core jvm test clean release-linux release bench
1919

2020
define spark_jvm_17_extra_args
21-
$(shell ./mvnw help:evaluate -Dexpression=extraJavaTestArgs | grep -v '\[')
21+
$(shell ./mvnw help:evaluate -q -DforceStdout -Dexpression=extraJavaTestArgs)
2222
endef
2323

2424
# Build optional Comet native features (like hdfs e.g)

common/src/main/spark-3.x/org/apache/comet/shims/CometTypeShim.scala

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.apache.comet.shims
2019

21-
import org.apache.spark.sql.types.DataType
20+
package org.apache.comet.shims
2221

2322
import scala.annotation.nowarn
2423

24+
import org.apache.spark.sql.types.DataType
25+
2526
trait CometTypeShim {
26-
@nowarn // Spark 4 feature; stubbed to false in Spark 3.x for compatibility.
27-
def isStringCollationType(dt: DataType): Boolean = false
28-
}
27+
@nowarn // Spark 4 feature; stubbed to false in Spark 3.x for compatibility.
28+
def isStringCollationType(dt: DataType): Boolean = false
29+
}

common/src/main/spark-4.0/org/apache/comet/shims/CometTypeShim.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19+
1920
package org.apache.comet.shims
2021

2122
import org.apache.spark.sql.internal.types.StringTypeWithCollation
2223
import org.apache.spark.sql.types.DataType
2324

2425
trait CometTypeShim {
25-
def isStringCollationType(dt: DataType): Boolean = dt.isInstanceOf[StringTypeWithCollation]
26-
}
26+
def isStringCollationType(dt: DataType): Boolean = dt.isInstanceOf[StringTypeWithCollation]
27+
}

common/src/main/spark-4.0/org/apache/comet/shims/ShimBatchReader.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,5 @@ object ShimBatchReader {
3232
-1,
3333
Array.empty[String],
3434
0,
35-
0
36-
)
35+
0)
3736
}

native/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ thiserror = "2"
5252
object_store = { version = "0.12.3", features = ["gcp", "azure", "aws", "http"] }
5353
url = "2.2"
5454
aws-config = "1.6.3"
55-
aws-credential-types = "1.2.6"
55+
aws-credential-types = "1.2.7"
5656

5757
[profile.release]
5858
debug = true

native/core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ datafusion-comet-objectstore-hdfs = { path = "../hdfs", optional = true, default
7676
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls-native-roots", "http2"] }
7777
object_store_opendal = {version = "0.54.0", optional = true}
7878
hdfs-sys = {version = "0.3", optional = true, features = ["hdfs_3_3"]}
79-
opendal = { version ="0.54.0", optional = true, features = ["services-hdfs"] }
79+
opendal = { version ="0.54.1", optional = true, features = ["services-hdfs"] }
8080

8181
[target.'cfg(target_os = "linux")'.dependencies]
8282
procfs = "0.18.0"

native/core/src/execution/planner.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,6 @@ impl PhysicalPlanner {
287287
)
288288
}
289289
ExprStruct::IntegralDivide(expr) => {
290-
// TODO respect eval mode
291-
// https://github.com/apache/datafusion-comet/issues/533
292290
let eval_mode = from_protobuf_eval_mode(expr.eval_mode)?;
293291
self.create_binary_expr_with_options(
294292
expr.left.as_ref().unwrap(),
@@ -987,11 +985,12 @@ impl PhysicalPlanner {
987985
} else {
988986
"decimal_div"
989987
};
990-
let fun_expr = create_comet_physical_fun(
988+
let fun_expr = create_comet_physical_fun_with_eval_mode(
991989
func_name,
992990
data_type.clone(),
993991
&self.session_ctx.state(),
994992
None,
993+
eval_mode,
995994
)?;
996995
Ok(Arc::new(ScalarFunctionExpr::new(
997996
func_name,

native/spark-expr/benches/decimal_div.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use arrow::compute::cast;
2020
use arrow::datatypes::DataType;
2121
use criterion::{criterion_group, criterion_main, Criterion};
2222
use datafusion::physical_plan::ColumnarValue;
23-
use datafusion_comet_spark_expr::{spark_decimal_div, spark_decimal_integral_div};
23+
use datafusion_comet_spark_expr::{spark_decimal_div, spark_decimal_integral_div, EvalMode};
2424
use std::hint::black_box;
2525
use std::sync::Arc;
2626

@@ -48,6 +48,7 @@ fn criterion_benchmark(c: &mut Criterion) {
4848
black_box(spark_decimal_div(
4949
black_box(&args),
5050
black_box(&DataType::Decimal128(10, 4)),
51+
EvalMode::Legacy,
5152
))
5253
})
5354
});
@@ -57,6 +58,7 @@ fn criterion_benchmark(c: &mut Criterion) {
5758
black_box(spark_decimal_integral_div(
5859
black_box(&args),
5960
black_box(&DataType::Decimal128(10, 4)),
61+
EvalMode::Legacy,
6062
))
6163
})
6264
});

native/spark-expr/src/comet_scalar_funcs.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,14 @@ pub fn create_comet_physical_fun_with_eval_mode(
137137
make_comet_scalar_udf!("unhex", func, without data_type)
138138
}
139139
"decimal_div" => {
140-
make_comet_scalar_udf!("decimal_div", spark_decimal_div, data_type)
140+
make_comet_scalar_udf!("decimal_div", spark_decimal_div, data_type, eval_mode)
141141
}
142142
"decimal_integral_div" => {
143143
make_comet_scalar_udf!(
144144
"decimal_integral_div",
145145
spark_decimal_integral_div,
146-
data_type
146+
data_type,
147+
eval_mode
147148
)
148149
}
149150
"checked_add" => {

0 commit comments

Comments
 (0)