Skip to content

feat(optimizer)!: Annotate ISINF(expr) for DuckDB#6894

Merged
georgesittas merged 3 commits intotobymao:mainfrom
AbhishekASLK:abhishekaslk/annotate-isinf-duckdb
Jan 30, 2026
Merged

feat(optimizer)!: Annotate ISINF(expr) for DuckDB#6894
georgesittas merged 3 commits intotobymao:mainfrom
AbhishekASLK:abhishekaslk/annotate-isinf-duckdb

Conversation

@AbhishekASLK
Copy link
Copy Markdown
Contributor

This PR annotate isinf(expr) for DuckDB as BOOLEAN

duckdb> select isinf('Infinity'::float);
┌──────────────────────────────────┐
│ isinf(CAST('Infinity' AS FLOAT)) │
╞══════════════════════════════════╡
│                             true │
└──────────────────────────────────┘

Official documentation:
https://duckdb.org/docs/stable/sql/functions/numeric#isinfx

Comment thread sqlglot/typing/duckdb.py Outdated
Comment on lines +21 to +26
**{
expr_type: {"returns": exp.DataType.Type.BOOLEAN}
for expr_type in {
exp.IsInf,
}
},
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be in the base annotator, not here. It applies generally AFAICT.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay!

Copy link
Copy Markdown
Collaborator

@VaggelisD VaggelisD left a comment

Choose a reason for hiding this comment

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

Let's also remove it from BigQuery's type annotator given that we moved this to base

Copy link
Copy Markdown
Collaborator

@georgesittas georgesittas left a comment

Choose a reason for hiding this comment

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

Thanks!

@georgesittas georgesittas merged commit bec45a5 into tobymao:main Jan 30, 2026
9 checks passed
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.

4 participants