Skip to content

feat: add example on Dynamic fns#746

Open
mbwhite wants to merge 2 commits intosubstrait-io:mainfrom
mbwhite:dyanmic-fn-example
Open

feat: add example on Dynamic fns#746
mbwhite wants to merge 2 commits intosubstrait-io:mainfrom
mbwhite:dyanmic-fn-example

Conversation

@mbwhite
Copy link
Contributor

@mbwhite mbwhite commented Mar 13, 2026

Adding a new example here to demonstrate how to use the Dynamic Function support; this was inspired by a real life usecase trying to work out how to do this!

@mbwhite mbwhite force-pushed the dyanmic-fn-example branch 3 times, most recently from 5dcec2d to 54d707c Compare March 13, 2026 16:56
/** Create a Custom dialect. Converts the function 'regexp_matches' to 'SIMILAR TO' */
public static final SqlDialect customSqlDialect() {

return new SparkSqlDialect(SparkSqlDialect.DEFAULT_CONTEXT) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

above you are writing it would be using a custom DuckDB dialect but here it's a SparkSqlDialect. which is it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do'h I've mixed up two different examples here.
correcting

Comment on lines +24 to +25
* <p>DuckDB used here supports the function `regexp_matches' as well as the SQL standard "SIMILAR
* TO"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should be consistent with the quote characters here ` or "

Signed-off-by: MBWhite <whitemat@uk.ibm.com>
@mbwhite mbwhite force-pushed the dyanmic-fn-example branch from 54d707c to 5798502 Compare March 16, 2026 11:23
Signed-off-by: MBWhite <whitemat@uk.ibm.com>
@mbwhite mbwhite force-pushed the dyanmic-fn-example branch from 5798502 to 406a02c Compare March 16, 2026 11:30
@mbwhite mbwhite requested a review from nielspardon March 16, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants