Skip to content

Commit

Permalink
[spark tests]
Browse files Browse the repository at this point in the history
  • Loading branch information
shehabgamin committed Oct 10, 2024
1 parent 706d873 commit b194325
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/sail-plan/src/extension/function/spark_murmur3_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ impl ScalarUDFImpl for SparkMurmur3Hash {

fn invoke(&self, args: &[ColumnarValue]) -> Result<ColumnarValue> {
let length = args.len();
if length < 1 {
return Err(datafusion::error::DataFusionError::Internal(
"spark_hash requires at least one argument".to_string(),
));
}
let seed = &args[length - 1];
let mut args = args.to_vec();
match seed {
Expand Down
5 changes: 5 additions & 0 deletions crates/sail-plan/src/extension/function/spark_xxhash64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ impl ScalarUDFImpl for SparkXxhash64 {

fn invoke(&self, args: &[ColumnarValue]) -> Result<ColumnarValue> {
let length = args.len();
if length < 1 {
return Err(datafusion::error::DataFusionError::Internal(
"spark_xxhash64 requires at least one argument".to_string(),
));
}
let seed = &args[length - 1];
let mut args = args.to_vec();
match seed {
Expand Down

0 comments on commit b194325

Please sign in to comment.