Feat(optimizer): UDF annotation#6843
Merged
Merged
Conversation
b921f72 to
35466c4
Compare
35466c4 to
38d6ae1
Compare
georgesittas
commented
Jan 23, 2026
| Returns: | ||
| The return type as a DataType, or UNKNOWN if not found. | ||
| """ | ||
| return exp.DataType.build("unknown") |
Collaborator
Author
There was a problem hiding this comment.
This is mostly done to preserve backwards-compatibility. We could also make it abstract and label this as breaking.
cc @barakalon
65aa116 to
464d349
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
0555006 to
3423b27
Compare
VaggelisD
reviewed
Jan 23, 2026
403144d to
dc0e462
Compare
Contributor
SQLGlot Integration Test ResultsComparing:
By Dialect
Overallmain: 5247 total, 4439 passed (pass rate: 84.6%), sqlglot version: sqlglot:jo/udf_annotation: 5247 total, 4438 passed (pass rate: 84.6%), sqlglot version: Difference: No change |
geooo109
approved these changes
Jan 26, 2026
VaggelisD
approved these changes
Jan 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR extends the schema module so that it can hold typing information about User-Defined Functions (UDFs).
It achieves this by introudcing a new mapping,
udf_mapping, which maps UDFs to their return type. This is separate from the existingmappingdict, because UDF and tables live in separate namespaces (e.g., for BigQuery), so we needed to respect that in order to avoid name clobbering.