fallintoplace commented on code in PR #845:
URL: https://github.com/apache/iceberg-cpp/pull/845#discussion_r3651166782


##########
src/iceberg/schema_internal.cc:
##########
@@ -227,7 +227,7 @@ Status ToArrowSchema(const Schema& schema, ArrowSchema* 
out) {
 
 namespace {
 
-int32_t GetFieldId(const ArrowSchema& schema) {
+Result<int32_t> GetFieldId(const ArrowSchema& schema) {
   if (schema.metadata == nullptr) {
     return kUnknownFieldId;

Review Comment:
   They are intentionally different. If the `PARQUET:field_id` metadata is 
missing, we keep the existing behavior and use the unknown field ID sentinel. 
If the key is present but the value is malformed or outside `int32_t`, we 
return an invalid schema error instead.



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