wgtmac commented on code in PR #880:
URL: https://github.com/apache/iceberg-cpp/pull/880#discussion_r3794109230


##########
src/iceberg/parquet/parquet_schema_util.cc:
##########
@@ -105,16 +292,39 @@ void SelectAnchorColumnIfEmpty(
   }
 }
 
+Status ValidateGeospatialParquetType(const Type& expected_type,
+                                     const ::parquet::arrow::SchemaField& 
parquet_field,
+                                     const ::parquet::ColumnDescriptor& descr) 
{
+  if (parquet_field.field->type()->id() != ::arrow::Type::BINARY) {
+    return InvalidSchema("Cannot read Iceberg type {} from non-binary Parquet 
field",
+                         expected_type);
+  }
+  if (descr.logical_type() == nullptr) {
+    return InvalidSchema("Missing Parquet leaf column metadata for Iceberg 
type {}",
+                         expected_type);
+  }
+  if (descr.physical_type() != ::parquet::Type::BYTE_ARRAY) {
+    return InvalidSchema("Iceberg type {} requires Parquet BYTE_ARRAY", 
expected_type);
+  }
+  if (expected_type.type_id() == TypeId::kGeometry) {

Review Comment:
   We can create a separate PR here to address this.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to