Copilot commented on code in PR #3863:
URL: https://github.com/apache/avro/pull/3863#discussion_r3565207302


##########
lang/php/lib/Datum/AvroIODatumReader.php:
##########
@@ -538,4 +541,80 @@ private function readDecimal(string $bytes, int $scale): 
string
 
         return (string) ($scale > 0 ? ($int / (10 ** $scale)) : $int);
     }
+
+    /**
+     * Minimum number of bytes a single value of the given schema can occupy on
+     * the wire. Used to reject an array/map block count that could not be 
backed
+     * by the bytes remaining. A type that can encode to zero bytes (null)
+     * returns 0, which disables the collection check for it (so an array of
+     * nulls is not falsely rejected). Types that cannot be resolved cheaply

Review Comment:
   The doc comment for minBytesPerElement() says only `null` can encode to zero 
bytes, but the implementation can also return 0 for other schemas (e.g. an 
empty record, or a record whose fields all encode to 0 bytes). Updating the 
comment to reflect this would avoid misleading future changes (especially since 
a 0 return value disables the collection-availability guard).



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