rkrishn7 opened a new issue, #14550: URL: https://github.com/apache/datafusion/issues/14550
### Describe the bug In, #14394, it was reported that while attempting to implement a `DataSink` different schemas for the record batches were being given than per the `RecordBatchStream`. A fix for the given example, an `INSERT INTO ... VALUES` query, was merged (#14472). However, this issue likely arises when the schema of the source of an `INSERT` statement contain fields that differ from the table schema in terms of nullability. That is, the problem is not just limited to `INSERT INTO ... VALUES` statements. ### To Reproduce _No response_ ### Expected behavior _No response_ ### Additional context A better approach may be to map the schema of the source plan to a new schema that demonstrates parity in field nullability (if possible) with the table schema. We could do this directly when planning the insert, after constructing the source `LogicalPlan`. In `insert_to_plan`. -- 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: github-unsubscr...@datafusion.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org