Skip to content

Construct source plan schema with correct nullability during INSERT planning. #14550

@rkrishn7

Description

@rkrishn7

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions