Skip to content

Support custom scalar functions in MySQL unparser dialect#356

Closed
phillipleblanc wants to merge 4 commits into
spiceaifrom
phillip/250524-mysql-override-scalar-fns
Closed

Support custom scalar functions in MySQL unparser dialect#356
phillipleblanc wants to merge 4 commits into
spiceaifrom
phillip/250524-mysql-override-scalar-fns

Conversation

@phillipleblanc
Copy link
Copy Markdown
Collaborator

Allows the MySQLTableFactory to have an optional customized MySQL dialect.

Adds a new MySQLDialect that implements with_custom_scalar_overrides to allow consumers to specify their own MySQL scalar function overrides.

@phillipleblanc phillipleblanc self-assigned this May 24, 2025
Comment thread src/mysql/dialect.rs
},
};

pub struct MySqlDialect {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator Author

@phillipleblanc phillipleblanc May 24, 2025

Choose a reason for hiding this comment

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

It feels a bit weird that this would require a core datafusion change. I'm actually thinking we should try to remove the trait parameter with_custom_scalar_overrides from unparser::Dialect, since it will panic on all dialects currently except DuckDB - so you already need to know which specific dialect instance you have to know if it supportswith_custom_scalar_overrides. And at that point you might as well just only add that function to the specific structs that support it instead of fake supporting it via the trait.

@phillipleblanc
Copy link
Copy Markdown
Collaborator Author

Turns out I don't need this change

@phillipleblanc phillipleblanc deleted the phillip/250524-mysql-override-scalar-fns branch May 27, 2025 07:45
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