Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An sdf make-functions refresher run #72

Merged
merged 3 commits into from
Aug 9, 2024
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
61 changes: 0 additions & 61 deletions src/trino/length_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,29 +69,6 @@ fn length_varbinary_simplify(
Ok(ExprSimplifyResult::Original(args))
}

fn length_array_1_invoke(_args: &[ColumnarValue]) -> Result<ColumnarValue> {
Err(DataFusionError::NotImplemented(format!(
"Not implemented {}:{}",
file!(),
line!()
)))
}

fn length_array_1_return_type(_arg_types: &[DataType]) -> Result<DataType> {
Err(DataFusionError::NotImplemented(format!(
"Not implemented {}:{}",
file!(),
line!()
)))
}

fn length_array_1_simplify(
args: Vec<Expr>,
_info: &dyn SimplifyInfo,
) -> Result<ExprSimplifyResult> {
Ok(ExprSimplifyResult::Original(args))
}

// ========== Generated template below this line ==========
// Do *NOT* edit below this line: all changes will be overwritten
// when template is regenerated!
Expand Down Expand Up @@ -171,41 +148,3 @@ impl ScalarUDFImpl for length_varbinaryFunc {
length_varbinary_simplify(args, info)
}
}

#[derive(Debug)]
pub(super) struct length_array_1Func {
signature: Signature,
}

impl length_array_1Func {
pub fn new() -> Self {
Self {
signature: Signature::any(1, Volatility::Immutable),
}
}
}

impl ScalarUDFImpl for length_array_1Func {
fn as_any(&self) -> &dyn Any {
self
}
fn name(&self) -> &str {
"length"
}

fn signature(&self) -> &Signature {
&self.signature
}

fn return_type(&self, arg_types: &[DataType]) -> Result<DataType> {
length_array_1_return_type(arg_types)
}

fn invoke(&self, args: &[ColumnarValue]) -> Result<ColumnarValue> {
length_array_1_invoke(args)
}

fn simplify(&self, args: Vec<Expr>, info: &dyn SimplifyInfo) -> Result<ExprSimplifyResult> {
length_array_1_simplify(args, info)
}
}
8 changes: 1 addition & 7 deletions src/trino/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1602,11 +1602,6 @@ make_udf_function!(
LENGTH_VARBINARY,
length_varbinary
);
make_udf_function!(
length_impl::length_array_1Func,
LENGTH_ARRAY_1,
length_array_1
);

make_udf_function!(
levenshtein_distance_impl::levenshtein_distance_varchar_varcharFunc,
Expand Down Expand Up @@ -1896,7 +1891,7 @@ make_udf_function!(

make_udf_function!(
parse_presto_data_size_impl::parse_presto_data_size_varcharFunc,
PARSE_PRETO_DATA_SIZE_VARCHAR,
PARSE_PRESTO_DATA_SIZE_VARCHAR,
parse_presto_data_size_varchar
);

Expand Down Expand Up @@ -3586,7 +3581,6 @@ export_functions!(

(trino, length_varchar, arg1, "function doc"),
(trino, length_varbinary, arg1, "function doc"),
(trino, length_array_1, arg1, "function doc"),

(trino, levenshtein_distance_varchar_varchar, arg1 arg2, "function doc"),

Expand Down