Skip to content

feat(optimizer)!: type annotation for databricks NANVL, SIGN, SHIFTLEFT, SIGNUM, SHUFFLE#7896

Merged
fivetran-amrutabhimsenayachit merged 4 commits into
mainfrom
type-inference-batch-7
Jul 21, 2026
Merged

feat(optimizer)!: type annotation for databricks NANVL, SIGN, SHIFTLEFT, SIGNUM, SHUFFLE#7896
fivetran-amrutabhimsenayachit merged 4 commits into
mainfrom
type-inference-batch-7

Conversation

@fivetran-amrutabhimsenayachit

Copy link
Copy Markdown
Collaborator

Summary

  • Add class Nanvl(Func) to expressions/math.py and class Shuffle(Func) to expressions/array.py
  • Add exp.Nanvl and exp.Sign to the DOUBLE group in sqlglot/typing/spark.py (overrides base INT annotation)
  • Add pass-through array annotator for exp.Shuffle in sqlglot/typing/databricks.py
  • Add 6 fixture entries in annotate_functions.sql (2× SHIFTLEFT, 3× SIGNUM, 1× SHUFFLE)
  • Add integration test test_shuffle_type_annotation in sqlglot-integration-tests

Closes RD-1229681, RD-1229682, RD-1229683, RD-1229690, RD-1229691

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

SQLGlot Integration Test Results

✅ All tests passed

Comparing:

  • this branch (sqlglot:type-inference-batch-7 @ sqlglot 761d971)
  • baseline (main @ sqlglot 91f6606)

Overall

main: 192414 total, 153544 passed (pass rate: 79.8%)

sqlglot:type-inference-batch-7: 180220 total, 142397 passed (pass rate: 79.0%)

Transitions:
No change

Dialect pair changes: 0 previous results not found, 3 current results not found

✅ All tests passed

@fivetran-amrutabhimsenayachit
fivetran-amrutabhimsenayachit force-pushed the type-inference-batch-7 branch 4 times, most recently from c52a53d to 3a94107 Compare July 17, 2026 19:02
@geooo109 geooo109 self-assigned this Jul 20, 2026
Comment thread sqlglot/expressions/array.py
Comment thread sqlglot/expressions/math.py
Comment thread sqlglot/typing/hive.py Outdated
Comment thread sqlglot/typing/hive.py Outdated
Comment thread tests/fixtures/optimizer/annotate_functions.sql Outdated
Comment thread sqlglot/typing/spark.py Outdated
Comment thread tests/fixtures/optimizer/annotate_functions.sql Outdated
@georgesittas

Copy link
Copy Markdown
Collaborator

@fivetran-amrutabhimsenayachit let's please not couple >1 function annotations in one PR. It makes reviewing and decoupling patching more difficult than it needs to be.

@fivetran-amrutabhimsenayachit
fivetran-amrutabhimsenayachit force-pushed the type-inference-batch-7 branch 2 times, most recently from f406cea to b1c66cc Compare July 20, 2026 17:22
Comment thread sqlglot/typing/databricks.py Outdated
@fivetran-amrutabhimsenayachit
fivetran-amrutabhimsenayachit force-pushed the type-inference-batch-7 branch 4 times, most recently from fdc0e17 to ad0cce6 Compare July 21, 2026 15:05
@fivetran-amrutabhimsenayachit
fivetran-amrutabhimsenayachit merged commit a715f9f into main Jul 21, 2026
8 checks passed
@fivetran-amrutabhimsenayachit
fivetran-amrutabhimsenayachit deleted the type-inference-batch-7 branch July 21, 2026 15:59
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.

3 participants