Open singularsyntax opened 2 months ago
Additional information:
If I replace the call to write_table()
with write_csv()
:
let _result = query_df.write_csv("foo", DataFrameWriteOptions::default(), None).await.unwrap();
I get the following error:
thread 'main' panicked at ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/datafusion-physical-plan-37.1.0/src/insert.rs:127:9:
assertion `left == right` failed
left: 2
right: 1
This looks like a bug. I wonder if this is a regression from #9595?
I think it's a latent bug which doesn't relate to #9595 , I tested using version 36 code. I can try to help it to see what's wrong with it. :)
Describe the bug
Hello,
When I try to insert data with the
INSERT INTO
SQL syntax (see reproduction code below), I get the error:Inserting query must have the same schema with the table.
As logged above, the problem seems to be in the discrepancy between the table schema, which is qualified with the table name, and the query schema, which is not.
The code I'm using is about as simple as I can imagine. Am I missing something? Is there some example code that demonstrates how to use
INSERT INTO
SQL correctly? Or is this a bug?To Reproduce
Expected behavior
Insertion of the row
('foo', 'bar')
is successful. DataFusion creates a CSV file in the filesystem corresponding to the inserted data.Additional context