Skip to content

three isuues about duckdb #16

@l1t1

Description

@l1t1

when using duckdb-polyglot,

It automatically removes line breaks.

It cannot recognize differences in the same operator across different dialects. For example, / in PostgreSQL represents integer division, while / in DuckDB represents regular division.

D SELECT * FROM polyglot_query('SELECT 1/2', 'postgresql');
┌─────────┐
│ (1 / 2) │
│ double  │
├─────────┤
│   0.5   │
└─────────┘

It cannot distinguish between variables and literal constants. Literal constants like 1 and 2 are obviously not NULL, yet it performs unnecessary checks.

SELECT polyglot_transpile('SELECT decode(1,2,3,4)', 'oracle');
┌───────────────────────────────────────────────────────────────────────┐
│        polyglot_transpile('SELECT decode(1,2,3,4)', 'oracle')         │
│                                varchar                                │
├───────────────────────────────────────────────────────────────────────┤
│ SELECT CASE WHEN 1 = 2 OR (1 IS NULL AND 2 IS NULL) THEN 3 ELSE 4 END │
└───────────────────────────────────────────────────────────────────────┘

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions