jonkeane commented on code in PR #48634:
URL: https://github.com/apache/arrow/pull/48634#discussion_r2643282257


##########
r/src/altrep.cpp:
##########
@@ -1094,10 +1101,11 @@ SEXP MakeAltrepVector(const 
std::shared_ptr<ChunkedArray>& chunked_array) {
 
 bool is_arrow_altrep(SEXP x) {
   if (ALTREP(x)) {
-    SEXP info = ALTREP_CLASS_SERIALIZED_CLASS(ALTREP_CLASS(x));
-    SEXP pkg = ALTREP_SERIALIZED_CLASS_PKGSYM(info);
-
-    if (pkg == symbols::arrow) return true;
+    return R_altrep_inherits(x, AltrepVectorPrimitive<REALSXP>::class_t) ||
+           R_altrep_inherits(x, AltrepVectorPrimitive<INTSXP>::class_t) ||
+           R_altrep_inherits(x, AltrepFactor::class_t) ||
+           R_altrep_inherits(x, AltrepVectorString<StringType>::class_t) ||
+           R_altrep_inherits(x, AltrepVectorString<LargeStringType>::class_t);

Review Comment:
   Maybe, but this check is definitely more fragile — do we have to do this 
here? I don't see any of the `ATTRIB` stuff here?



-- 
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]

Reply via email to