rustyconover opened a new issue, #44689:
URL: https://github.com/apache/arrow/issues/44689
### Describe the bug, including details regarding any error messages,
version, and platform.
In the server-side implementation of an Apache Arrow Flight DoExchange call,
the `MetadataRecordBatchWriter` does not enforce schema validation for tables
written to the stream. Specifically, after calling `stream.begin(schema)` to
set an initial schema, there is no check to ensure that subsequent tables
written with `stream.write_table()` conform to this schema.
**Steps to Reproduce:**
1. Start a Flight DoExchange stream on the server side.
2. Call `stream.begin(schema)` to define the schema for the stream.
```python
stream.begin(schema)
```
3. Use `stream.write_table()` to send data to the stream.
**Expected Behavior:**
Once a schema is set with `stream.begin(schema)`, only tables matching this
schema should be allowed in `stream.write_table()`. The system should raise an
error or otherwise validate that the written table conforms to the defined
schema.
**Actual Behavior:**
There is no validation to ensure the written table matches the schema passed
to `stream.begin(schema)`. This could lead to unintended behavior or data
inconsistency if tables with different schemas are written to the stream.
**Impact:**
Without schema validation, downstream consumers may receive data that does
not conform to the expected structure, potentially causing errors or
misinterpretations of the data.
**Suggested Solution:**
Implement schema validation in `stream.write_table()` to check that any
table written to the stream matches the schema set by `stream.begin(schema)`.
If there is a mismatch, the system should raise an appropriate error.
**Environment:**
- Apache Arrow version: 17.0.0
### Component(s)
FlightRPC, Python
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]