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.