Skip to content

Commit

Permalink
optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
Lordworms committed Aug 22, 2024
1 parent c3e810a commit f1066e9
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions datafusion/functions/src/string/split_part.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ use datafusion_expr::TypeSignature::*;
use datafusion_expr::{ColumnarValue, Volatility};
use datafusion_expr::{ScalarUDFImpl, Signature};
use std::any::Any;
use std::fmt::Write;
use std::sync::Arc;

use crate::utils::utf8_to_str_type;
Expand Down Expand Up @@ -99,7 +98,7 @@ impl ScalarUDFImpl for SplitPartFunc {
.iter()
.map(|arg| match arg {
ColumnarValue::Scalar(scalar) => scalar.to_array_of_size(inferred_length),
ColumnarValue::Array(array) => Ok(array.clone()),
ColumnarValue::Array(array) => Ok(Arc::clone(array)),
})
.collect::<Result<Vec<_>>>()?;

Expand Down Expand Up @@ -214,9 +213,7 @@ where

if index < len {
builder.append_value(split_string[index]);
builder.append_value("");
} else {
builder.write_str("")?;
builder.append_value("");
}
}
Expand Down

0 comments on commit f1066e9

Please sign in to comment.