Databricks Dialect Follow-up Clean-up#533
Merged
Merged
Conversation
…o-ai/PyDough into Hadia/db_followup
knassre-bodo
approved these changes
Jun 23, 2026
knassre-bodo
left a comment
Contributor
There was a problem hiding this comment.
One minor comment, otherwise LGTM :)
Comment on lines
+792
to
+798
| pytest.param( | ||
| "databricks", | ||
| id="databricks", | ||
| marks=[pytest.mark.databricks], | ||
| ), | ||
| ], | ||
| ) |
Contributor
There was a problem hiding this comment.
Let's make this a common parameterized fixture that is shared as an input between all_dialects_params_tpch_db_context and all_dialects_tpch_db_context.
john-sanchez31
approved these changes
Jun 23, 2026
…][run trino][run postgres][run snowflake]
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.
Linked ticket
Addressing comments here
Type of change
What changed and why?
1. Drop Python 3.10
It's EOL is October 2026. Removes 3.10 from the CI matrix and pyproject.toml classifiers.
2. Update
convert_sumFour dialects (Databricks, Snowflake, Postgres, Trino) had identical
convert_sumoverrides that emitCOUNT_IFfor boolean arguments.Moved the logic to
BaseTransformBindingsso all current and future dialects get it automatically.Dialects without native
COUNT_IFave SQLGlot transpile theCountIfexpression to the correct equivalent:SUM(IIF ..., 1, 0)SUM(CASE WHEN … THEN 1 ELSE 0 END)conver_sumfor MySQL and Oracle because SqlGlot didn't transpile them correctly. They generateSUM(expr)Reference SQL files regenerated accordingly.
3. Simplify tpch q16 params test
Consolidate params tests 6 per-dialect params fixtures/tests replaced by single
all_dialects_params_tpch_db_contextfixture and onetest_pipeline_e2e_tpch_paramsin test_pipeline_tpch.py4. SQLGlot Transpile Snowfalke to Databricks Investigation for
databricks_task.pyInvestigated whether SQLGlot's Snowflake -> Databricks transpile could replace the regex-based adaptations in
databricks_task.py(adapt_for_databricksand_adapt_create_table).Short answer: no. See table below for details
TEXT→STRINGNUMERIC(p,s)→DECIMAL(p,s)UNIQUEstrippedDEFAULT CURRENT_TIMESTAMP→DEFAULT CURRENT_TIMESTAMP()'x'::timestamp→CAST('x' AS TIMESTAMP)TIMESTAMP 'x'but both work)INTERVAL 'N unit'→INTERVAL 'N' UNITPRIMARY KEYstrippedNULLS LASTAUTOINCREMENTremovedAUTO_INCREMENT(not supported in Databricks)REFERENCESstrippedIF NOT EXISTSaddeddefog.<schema>.tableprefix addedUSING DELTA TBLPROPERTIES(...)appendedEXTRACT(EPOCH FROM …)→UNIX_TIMESTAMP(…)TO_CHAR(…)→DATE_FORMAT(…)DEFOG.SCHEMA.TABLE→defog.schema.tablelowercasingHow I tested this?
Notes for reviewers