duckdb / duckdb/duckdb-sqlite

Error parsing Infinity for `REAL` datatype

Open
#144 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
291
Forks
45
Avg merge
10h 13m
Merged PRs (30d)
18

Description

### 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?

- [x] 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?

- [x] I agree

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.