chenzl25 opened a new pull request, #1483:
URL: https://github.com/apache/iceberg-rust/pull/1483
## Which issue does this PR close?
- Previously, we used `record_batch.with_schema(target_schema.clone())` to
change the schema name of a record batch, but unfortunately, `with_schema`
would check the schema name and throw an error. So I think we should convert
the RecordBatch like how `BatchTransform::Modify` does, but keep the same
columns.
```
pub fn with_schema(self, schema: SchemaRef) -> Result<Self, ArrowError> {
if !schema.contains(self.schema.as_ref()) {
return Err(ArrowError::SchemaError(format!(
"target schema is not superset of current schema
target={schema} current={}",
self.schema
)));
}
Ok(Self {
schema,
columns: self.columns,
row_count: self.row_count,
})
}
```
- Closes #.
## What changes are included in this PR?
<!--
Provide a summary of the modifications in this PR. List the main changes
such as new features, bug fixes, refactoring, or any other updates.
-->
## Are these changes tested?
<!--
Specify what test covers (unit test, integration test, etc.).
If tests are not included in your PR, please explain why (for example, are
they covered by existing tests)?
-->
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]