You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "wjones127 (via GitHub)" <gi...@apache.org> on 2023/04/13 19:42:40 UTC

[GitHub] [arrow] wjones127 commented on a diff in pull request #33634: GH-20385: [C++] reject partial loads of an extension type in the parquet reader

wjones127 commented on code in PR #33634:
URL: https://github.com/apache/arrow/pull/33634#discussion_r1165957392


##########
cpp/src/parquet/arrow/reader.cc:
##########
@@ -842,7 +842,16 @@ Status GetReader(const SchemaField& field, const std::shared_ptr<Field>& arrow_f
     auto storage_field = arrow_field->WithType(
         checked_cast<const ExtensionType&>(*arrow_field->type()).storage_type());
     RETURN_NOT_OK(GetReader(field, storage_field, ctx, out));
-    *out = std::make_unique<ExtensionReader>(arrow_field, std::move(*out));
+    if (*out) {
+      auto storage_type = (*out)->field()->type();
+      if (!storage_type->Equals(
+              checked_cast<const ExtensionType&>(*arrow_field->type()).storage_type())) {

Review Comment:
   I think Antoine is correct. This can be simplified.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org