feat(dremio): support 4-argument REGEXP_SPLIT - #8148
Open
rusackas wants to merge 1 commit into
Open
Conversation
Dremio's REGEXP_SPLIT(string, pattern, mode, limit) takes a required "mode" argument (e.g. 'ALL') ahead of "limit", which the shared exp.RegexpSplit didn't have a slot for. Add "mode" to arg_types (appended after "limit" so existing 2/3-arg positional callers via from_arg_list keep mapping unchanged) and wire Dremio's parser/ generator to build/render it in the dialect's real argument order.
rusackas
commented
Aug 13, 2026
| arg_types = {"this": True, "expression": True, "limit": False} | ||
| # "mode" is Dremio-specific (e.g. 'ALL'), appended after "limit" so existing | ||
| # 2/3-arg positional callers (from_arg_list) keep mapping "limit" unchanged | ||
| arg_types = {"this": True, "expression": True, "limit": False, "mode": False} |
Contributor
Author
There was a problem hiding this comment.
Not sure if it's too weird to put a Dremio-specific thing here... open to advice from the real experts around here :D
Can't say I see/know a better way around this, but I'm happy to nix the explanatory comment if that's too vendor specific/noisy.
9 tasks
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.
Found another goofy thing we've been working around in Superset, trying to fix upstream where it belongs.
Dremio's
REGEXP_SPLIT(string, pattern, mode, limit)takes a requiredmodeargument (e.g.'ALL') positioned ahead oflimit, which is a shape the sharedexp.RegexpSplitdidn't have a slot for.This adds
modetoRegexpSplit.arg_types, appended afterlimitso existing 2/3-arg positional callers viafrom_arg_list(DorisSPLIT_BY_STRING, ClickHouseSPLITBYREGEXP, DuckDBSTR_SPLIT_REGEX/STRING_SPLIT_REGEX, HiveSPLIT) keep mapping their existing args unchanged.Dremio's own parser/generator build and render the args in the dialect's real order (
this,expression,mode,limit) via an explicit builder rather than relying on the shared positionalfrom_arg_list.Found this while rebasing Superset's local Dremio dialect (which previously shadowed sqlglot's native one, see apache/superset#43099) onto sqlglot's
DremioParser/DremioGenerator. Superset had a local-onlyREGEXP_SPLIToverride to fill this gap.Tests:
tests/dialects/test_dremio.py::test_regexp_split(new)tests/dialects/test_dremio.pysuite: 23 passedRegexpSplitconsumers for regressions:test_doris.py,test_clickhouse.py,test_duckdb.py,test_hive.py— 104 passed