jorisvandenbossche commented on code in PR #42098:
URL: https://github.com/apache/arrow/pull/42098#discussion_r1636860424
##########
python/pyarrow/src/arrow/python/ipc.cc:
##########
@@ -79,7 +79,8 @@ Status
CastingRecordBatchReader::Init(std::shared_ptr<RecordBatchReader> parent,
// Ensure all columns can be cast before succeeding
for (int i = 0; i < num_fields; i++) {
- if (!compute::CanCast(*src->field(i)->type(), *schema->field(i)->type())) {
+ if ((!((src->field(i)->type()->Equals(schema->field(i)->type())))) &&
+ (!compute::CanCast(*src->field(i)->type(),
*schema->field(i)->type()))) {
Review Comment:
See my explanation at
https://github.com/apache/arrow/pull/42098#issuecomment-2160328098:
> The core issue is that `GetDate32Cast()` does not explicitly create a
zero-copy cast kernel for "date32" to "date32".
While for various reasons, for most other types such a zero-copy kernel is
added. Not for "date64" though, that one has exactly the same problem as
"date32". See my comment at
https://github.com/apache/arrow/pull/42098#issuecomment-2160503543 for the list
of types that don't have a cast kernel from/to itself.
--
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]