Skip to content

feat(optimizer): Annotate type for snowflake CBRT function#6050

Merged
fivetran-amrutabhimsenayachit merged 2 commits intomainfrom
RD-1043252-annotate-type-for-cbrt-function
Oct 8, 2025
Merged

feat(optimizer): Annotate type for snowflake CBRT function#6050
fivetran-amrutabhimsenayachit merged 2 commits intomainfrom
RD-1043252-annotate-type-for-cbrt-function

Conversation

@fivetran-amrutabhimsenayachit
Copy link
Collaborator

@fivetran-amrutabhimsenayachit fivetran-amrutabhimsenayachit commented Oct 8, 2025

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds type annotation support for the CBRT (cube root) function in the Snowflake dialect, enabling the optimizer to correctly infer that CBRT returns a DOUBLE type.

  • Adds CBRT function to Snowflake's DOUBLE type mapping in the type annotation system
  • Includes test coverage for the CBRT function type annotation
  • Adds validation test for CBRT function parsing

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
sqlglot/dialects/snowflake.py Maps CBRT function to DOUBLE type in Snowflake dialect
tests/fixtures/optimizer/annotate_functions.sql Adds test case verifying CBRT returns DOUBLE type
tests/dialects/test_snowflake.py Adds validation test for CBRT function parsing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@fivetran-amrutabhimsenayachit fivetran-amrutabhimsenayachit force-pushed the RD-1043252-annotate-type-for-cbrt-function branch from 361db23 to 73e4c02 Compare October 8, 2025 22:12
@fivetran-amrutabhimsenayachit fivetran-amrutabhimsenayachit merged commit fe959a5 into main Oct 8, 2025
6 checks passed
@fivetran-amrutabhimsenayachit fivetran-amrutabhimsenayachit deleted the RD-1043252-annotate-type-for-cbrt-function branch October 8, 2025 22:17
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