GitHub user holicc closed a discussion: What if create table schema not match 
CSV file schema?

I want to create an external table from a CSV file using SQL like this:

```sql
CREATE EXTERNAL TABLE IF NOT EXISTS region (
        r_regionkey BIGINT,
        r_name VARCHAR,
        r_comment VARCHAR,
        r_rev VARCHAR,
        customer_filed VARCHAR,
) STORED AS CSV LOCATION '../region.tbl' OPTIONS ('format.delimiter' '|', 
'format.has_header' 'false');
```
When I select data from this table, I get an error: 
`ArrowError(CsvError("incorrect number of fields for line 1, expected 5 got 
4"), None)`

I know the `customer_filed` field does not exist in the CSV file, but I need 
this field in the table. How can I achieve this?

GitHub link: https://github.com/apache/datafusion/discussions/13997

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to