You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "betodealmeida (via GitHub)" <gi...@apache.org> on 2025/06/20 18:02:08 UTC
[PR] feat: initial Dremio sqlglot dialect [superset]
betodealmeida opened a new pull request, #33847:
URL: https://github.com/apache/superset/pull/33847
<!---
Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
Minimal Dremio dialect to support its `REGEXP_SPLIT` function, see https://docs.dremio.com/current/reference/sql/sql-functions/functions/REGEXP_SPLIT/.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: initial Dremio sqlglot dialect [superset]
Posted by "korbit-ai[bot] (via GitHub)" <gi...@apache.org>.
korbit-ai[bot] commented on code in PR #33847:
URL: https://github.com/apache/superset/pull/33847#discussion_r2159464806
##########
superset/sql/dialects/dremio.py:
##########
@@ -0,0 +1,49 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from sqlglot import exp, generator, parser
+from sqlglot.dialects.dialect import Dialect, rename_func
+
+
+class DremioRegexpSplit(exp.Func):
+ """
+ Custom REGEXP_SPLIT function for Dremio that supports 4 arguments.
+ """
+
+ arg_types = {
+ "this": True, # string to split
+ "expression": True, # delimiter pattern
+ "mode": True, # mode (like 'ALL') - required in Dremio
+ "limit": True, # limit - required in Dremio
+ }
Review Comment:
### Missing mode parameter validation in REGEXP_SPLIT <sub></sub>
<details>
<summary>Tell me more</summary>
###### What is the issue?
The DremioRegexpSplit function lacks validation for the 'mode' parameter which must be 'ALL' in Dremio.
###### Why this matters
Without validation, incorrect mode values could be passed through, causing runtime errors in Dremio SQL execution.
###### Suggested change ∙ *Feature Preview*
Add a validate method to enforce the 'ALL' mode requirement:
```python
def validate(self) -> None:
super().validate()
mode = self.args.get("mode")
if not isinstance(mode, exp.Literal) or mode.this != "ALL":
raise ValueError("REGEXP_SPLIT mode must be 'ALL' in Dremio")
```
###### Provide feedback to improve future suggestions
[](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/c1c94aaf-7ea4-45a5-98e3-e5bbf2faf6ca/upvote) [](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/c1c94aaf-7ea4-45a5-98e3-e5bbf2faf6ca?what_not_true=true) [](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/c1c94aaf-7ea4-45a5-98e3-e5bbf2faf6ca?what_out_of_scope=true) [](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/c1c94aaf-7ea4-45a5-98e3-e5bbf2faf6ca?what_not_in_standard=true) [](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/c1c94aaf-7ea4-45a5-98e3-e5bbf2faf6ca)
</details>
<sub>
💬 Looking for more details? Reply to this comment to chat with Korbit.
</sub>
<!--- korbi internal id:ee324907-63f9-49c2-b8a1-dbdf8be4d975 -->
[](ee324907-63f9-49c2-b8a1-dbdf8be4d975)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] feat: initial Dremio sqlglot dialect [superset]
Posted by "betodealmeida (via GitHub)" <gi...@apache.org>.
betodealmeida merged PR #33847:
URL: https://github.com/apache/superset/pull/33847
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org