zhuqi-lucas opened a new pull request, #14572: URL: https://github.com/apache/datafusion/pull/14572
## Which issue does this PR close? Describe the bug In, https://github.com/apache/datafusion/issues/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 (https://github.com/apache/datafusion/pull/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. - Closes [#14550](https://github.com/apache/datafusion/issues/14550) ## What changes are included in this PR? Add a separate nullable checking besides the original checking which only include the name and datatype. Improve the error message to including more info about the error. We will improve the checking for the 3 cases, also improve the error message. There are three cases we need to check 1. The len of the schema of the plan and the schema of the table should be the same 2. The nullable flag of the schema of the plan and the schema of the table should be the same 3. The datatype of the schema of the plan and the schema of the table should be the same ## Are these changes tested? Yes ## Are there any user-facing changes? No -- 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 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