Skip to content

Conversation

@toriwei
Copy link
Collaborator

@toriwei toriwei commented Oct 29, 2025

BigQuery's LOWER() can accept and return BYTES. DuckDB's LOWER() works withBYTES but returns VARCHAR. This PR casts result of LOWER() to BLOB for more accurate transpilation.

BigQuery
SELECT LOWER(b'\x41\x42\x43') as example, TYPEOF(LOWER(b'\x41\x42\x43')) as example_type

+---------+--------------+
| example | example_type |
+---------+--------------+
|    YWJj | BYTES        |
+---------+--------------+

DuckDB before changes:

D SELECT LOWER(e'\x41\x42\x43') as example;
┌─────────┐
│ example │
│ varchar │
├─────────┤
│ abc     │
└─────────┘

DuckDB with updated casting:

D SELECT CAST(LOWER(e'\x41\x42\x43') AS BLOB) as example;
┌─────────┐
│ example │
│  blob   │
├─────────┤
│ abc     │
└─────────┘

@toriwei toriwei force-pushed the tori/transpile-lower branch from 46d6ac3 to 03f1dec Compare November 3, 2025 19:11
@toriwei toriwei requested a review from georgesittas November 3, 2025 19:15
@georgesittas georgesittas merged commit b722aa2 into main Nov 4, 2025
7 checks passed
@georgesittas georgesittas deleted the tori/transpile-lower branch November 4, 2025 20:24
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