jorisvandenbossche commented on code in PR #44215:
URL: https://github.com/apache/arrow/pull/44215#discussion_r1775319895


##########
cpp/src/parquet/arrow/schema.cc:
##########
@@ -1017,7 +1017,9 @@ Result<bool> ApplyOriginalMetadata(const Field& 
origin_field, SchemaField* infer
 
       // Restore extension type, if the storage type is the same as inferred
       // from the Parquet type
-      if (ex_type.storage_type()->Equals(*inferred->field->type())) {
+      if (ex_type.storage_type()->Equals(*inferred->field->type()) ||
+          (ex_type.extension_name() == "arrow.json" &&
+           !ex_type.storage_type()->Equals(*inferred->field->type()))) {

Review Comment:
   This "types are not equal" check is superfluous? Because if they were equal, 
the first part of the if check would have passed and we wouldn't get here?
   
   I assume that in case of JSON extension type, we either just have to assume 
that the data will correctly use string, or we check explicitly that the 
inferred type is string type?



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