mapleFU commented on code in PR #13901:
URL: https://github.com/apache/arrow/pull/13901#discussion_r1733312779
##########
cpp/src/parquet/arrow/schema_internal.cc:
##########
@@ -107,17 +110,22 @@ Result<std::shared_ptr<ArrowType>>
MakeArrowTimestamp(const LogicalType& logical
}
}
-Result<std::shared_ptr<ArrowType>> FromByteArray(const LogicalType&
logical_type) {
+Result<std::shared_ptr<ArrowType>> FromByteArray(
+ const LogicalType& logical_type, const ArrowReaderProperties&
reader_properties) {
switch (logical_type.type()) {
case LogicalType::Type::STRING:
return ::arrow::utf8();
case LogicalType::Type::DECIMAL:
return MakeArrowDecimal(logical_type);
case LogicalType::Type::NONE:
case LogicalType::Type::ENUM:
- case LogicalType::Type::JSON:
case LogicalType::Type::BSON:
return ::arrow::binary();
+ case LogicalType::Type::JSON:
+ if (reader_properties.known_arrow_extensions_enabled()) {
+ return ::arrow::extension::json(::arrow::utf8());
+ }
+ return ::arrow::binary();
Review Comment:
I'm a bit curious here, would this a binary or a string?
##########
cpp/src/parquet/arrow/schema_internal.h:
##########
@@ -28,18 +29,19 @@ namespace parquet::arrow {
using ::arrow::Result;
-Result<std::shared_ptr<::arrow::DataType>> FromByteArray(const LogicalType&
logical_type);
+Result<std::shared_ptr<::arrow::DataType>> FromByteArray(const LogicalType&
logical_type,
+ bool
use_known_arrow_extensions);
Result<std::shared_ptr<::arrow::DataType>> FromFLBA(const LogicalType&
logical_type,
int32_t physical_length);
Result<std::shared_ptr<::arrow::DataType>> FromInt32(const LogicalType&
logical_type);
Result<std::shared_ptr<::arrow::DataType>> FromInt64(const LogicalType&
logical_type);
Result<std::shared_ptr<::arrow::DataType>> GetArrowType(
Type::type physical_type, const LogicalType& logical_type, int type_length,
- ::arrow::TimeUnit::type int96_arrow_time_unit = ::arrow::TimeUnit::NANO);
+ const ArrowReaderProperties& reader_properties);
Review Comment:
👍
Separate issue: @pitrou should we also introduce a subpart like `struct
type_coerce`? I'm currently considering read large binary / binary view /
dict[xx], currently the configurations would be a lot
--
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]