Skip to content

Error parsing Infinity for REAL datatype #144

@akshay-ctxl

Description

@akshay-ctxl

What happens?

For a REAL column with Infinity say inf or -inf, when reading from DuckDB the scan fails to parse these values - even though Inf is valid value for double in DuckDB. The table creation commands work fine when using duckdb storage (instead of SQLite).

To Reproduce

Commands to create float table.

❯ sqlite3 /tmp/float.db
CREATE TABLE f(val REAL);
INSERT INTO f VALUES('inf');
INSERT INTO f VALUES('-inf');
INSERT INTO f VALUES(1);

Open the above SQLite database in DuckDB.

❯ duckdb /tmp/float.db
v1.2.1 8e52ec4395
Enter ".help" for usage hints.
D select * from f;
Mismatch Type Error:
Invalid type in column "val": expected float or integer, found "inf" of type "text" instead.
* SET sqlite_all_varchar=true to load all columns as VARCHAR and skip type conversions

OS:

macOS

SQLite Version:

3.43.2 2023-10-10 13:08:14

DuckDB Version:

v1.2.1 8e52ec4395

DuckDB Client:

CLI

Full Name:

Akshay Aurora

Affiliation:

Contextual AI

Have you tried this on the latest main branch?

  • I agree

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • I agree

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions