Jefffrey commented on issue #18101:
URL: https://github.com/apache/datafusion/issues/18101#issuecomment-3414231498
Could you provide a reproduction? I tried following the steps you described
but I can't reproduce the issue.
CSV file:
```csv
name_1,num,"Column Name"
andrew,100,1
jorge,200,2
andy,150,3
paul,300,4
```
Test case, running on latest main:
```rust
use datafusion::dataframe::DataFrameWriteOptions;
use datafusion::error::Result;
use datafusion::prelude::*;
#[tokio::main]
async fn main() -> Result<()> {
let ctx = SessionContext::new();
let df = ctx
.read_csv(
"/Users/jeffrey/Downloads/test.csv",
CsvReadOptions::default(),
)
.await?;
df.clone().show().await?;
df.select(vec![col("Column Name").alias("column_name"), col("num")])?
.write_parquet("test.parquet", DataFrameWriteOptions::default(),
None)
.await?;
ctx.read_parquet("test.parquet", ParquetReadOptions::default())
.await?
.show()
.await?;
Ok(())
}
```
Output:
```sh
datafusion (main)$ cargo run --example dataframe
Compiling datafusion-examples v50.2.0
(/Users/jeffrey/Code/datafusion/datafusion-examples)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.10s
Running `/Users/jeffrey/.cargo_target_cache/debug/examples/dataframe`
+--------+-----+-------------+
| name_1 | num | Column Name |
+--------+-----+-------------+
| andrew | 100 | 1 |
| jorge | 200 | 2 |
| andy | 150 | 3 |
| paul | 300 | 4 |
+--------+-----+-------------+
+-------------+-----+
| column_name | num |
+-------------+-----+
| 1 | 100 |
| 2 | 200 |
| 3 | 150 |
| 4 | 300 |
+-------------+-----+
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]