nathaniel-d-ef commented on code in PR #8242:
URL: https://github.com/apache/arrow-rs/pull/8242#discussion_r2311404655


##########
arrow-avro/src/schema.rs:
##########
@@ -416,9 +469,28 @@ pub(crate) fn generate_fingerprint(
         FingerprintAlgorithm::Rabin => {
             Ok(Fingerprint::Rabin(compute_fingerprint_rabin(&canonical)))
         }
+        FingerprintAlgorithm::None => Err(ArrowError::SchemaError(
+            "FingerprintAlgorithm of None cannot be used to generate a 
fingerprint; \
+                if using Fingerprint::Id, pass the registry ID in instead 
using the set method."
+                .to_string(),
+        )),
+        #[cfg(feature = "md5")]
+        FingerprintAlgorithm::MD5 => 
Ok(Fingerprint::MD5(compute_fingerprint_md5(&canonical))),
+        #[cfg(feature = "sha256")]
+        FingerprintAlgorithm::SHA256 => {
+            Ok(Fingerprint::SHA256(compute_fingerprint_sha256(&canonical)))
+        }
     }
 }
 
+/// Loads the 32-bit Schema Registry fingerprint for the given `Schema`.
+///
+/// # Returns
+/// A `Fingerprint::Id` variant containing the 32-bit fingerprint.
+pub fn load_fingerprint_id(id: u32) -> Fingerprint {

Review Comment:
   Yes, that's a good callout



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to