j-a-m-l commented on issue #957:
URL:
https://github.com/apache/arrow-datafusion/issues/957#issuecomment-944962026
I think that there are 2 different problems here:
1. The value is cast as float by default.
```echo "1.2" > foo.csv``` writes a file with `1.2`, not `"1.2"`.
I've tried this script:
```rust
use datafusion::{error::Result, prelude::*};
#[tokio::main]
async fn main() -> Result<()> {
let filename = "foo.csv";
let options = CsvReadOptions::new().has_header(false);
let mut ctx = ExecutionContext::new();
let csv_df = ctx.read_csv(filename, options).await?;
println!("{:?}", csv_df.schema());
Ok(())
}
```
The result is:
```DFSchema { fields: [DFField { qualifier: Some("foo.csv"), field: Field {
name: "column_1", data_type: Float64, nullable: false, dict_id: 0,
dict_is_ordered: false, metadata: None } }] }```
2. I'm not completely familiar with this codebase, but I haven't seen yet
anything to convert from Utf8 to numeric types.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]