Closed nitinprakash96 closed 8 months ago
Thanks for the report!
This is intended behavior as part of regular DuckDB and not related to the SQLite scanner. If no alias is provided, the full expression is used as a column name. For example:
CREATE TABLE integers(i INT);
INSERT INTO integers VALUES (42);
SELECT i::BIGINT FROM integers;
┌───────────────────┐
│ CAST(i AS BIGINT) │
│ int64 │
├───────────────────┤
│ 42 │
└───────────────────┘
As you can see, the cast is included as part of the column name, as would any other expression. The solution is to add an explicit alias:
SELECT i::BIGINT AS i FROM integers;
┌───────┐
│ i │
│ int64 │
├───────┤
│ 42 │
└───────┘
What happens?
This is a speacial case when data is imported with casting enbaled. Without casting in
CREATE
statement, the table names are preserved just fine.To Reproduce
Create a dummy sqlite file
data.sqlite3
and create a table as follows:OS:
MacOS
SQLite Version:
3.37.0
DuckDB Version:
0.8.1
DuckDB Client:
CLI
Full Name:
Nitin Prakash
Affiliation:
Holmusk
Have you tried this on the latest
master
branch?Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?