Skip to content

Commit

Permalink
feat: enable "substring" as a UDF in addition to "substr"
Browse files Browse the repository at this point in the history
Substrait uses the name "substring", and it already exists in DF SQL

The setup here is a bit weird; I'd have added substring as an alias for substr, but then we have here this "substring" version being created as udf already and exported through the export_functions, with slightly different args than substr
(even though in reality the underlying function for both is the same substr impl).

I think this PR should work, but if you have suggestions on how to make the situation here cleaner, I'd be happy to!
  • Loading branch information
Blizzara committed Jul 5, 2024
1 parent 3421b52 commit eebfabf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions datafusion/functions/src/unicode/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ pub fn functions() -> Vec<Arc<ScalarUDF>> {
strpos(),
substr(),
substr_index(),
substring(),
translate(),
]
}

0 comments on commit eebfabf

Please sign in to comment.