GitHub user colbyn closed a discussion: Issue selecting the second column via
SQL
I hope this isn’t a dumb question but I’m having issuing selecting the second
column.
Given the following CSV file,
```css
id, value
0, "Red"
1, "Blue"
2, "Green"
3, "White"
4, "Black"
```
When I try to select the second column as shown
```rust
let data_frame = ctx
// .sql("SELECT id FROM my_table") // works
// .sql("SELECT * FROM my_table") // works
.sql("SELECT value FROM my_table") // error
.await
.unwrap();
```
I get this
```shell
thread 'main' panicked at src/main.rs:21:10:
called `Result::unwrap()` on an `Err` value: SchemaError(FieldNotFound { field:
Column { relation: None, name: "value" }, valid_fields: [Column { relation:
Some(Bare { table: "my_table" }), name: "id" }, Column { relation: Some(Bare {
table: "my_table" }), name: " value" }] })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
There is a value entry in valid_fields, this makes no sense?
# Here is [the repo](https://github.com/colbyn/datafusion-select-bug)
GitHub link: https://github.com/apache/datafusion/discussions/9095
----
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]