Fokko commented on code in PR #349:
URL: https://github.com/apache/iceberg-rust/pull/349#discussion_r1611264064


##########
crates/iceberg/src/spec/datatypes.rs:
##########
@@ -260,6 +279,29 @@ impl<'de> Deserialize<'de> for PrimitiveType {
     }
 }
 
+impl PrimitiveType {
+    /// Check whether literal is compatible with the type.
+    pub fn compatible(&self, literal: &PrimitiveLiteral) -> bool {
+        matches!(
+            (self, literal),
+            (PrimitiveType::Boolean, PrimitiveLiteral::Boolean(_))
+                | (PrimitiveType::Int, PrimitiveLiteral::Int(_))
+                | (PrimitiveType::Long, PrimitiveLiteral::Long(_))
+                | (PrimitiveType::Float, PrimitiveLiteral::Float(_))
+                | (PrimitiveType::Double, PrimitiveLiteral::Double(_))
+                | (PrimitiveType::Decimal { .. }, PrimitiveLiteral::Decimal(_))
+                | (PrimitiveType::Date, PrimitiveLiteral::Date(_))
+                | (PrimitiveType::Time, PrimitiveLiteral::Time(_))
+                | (PrimitiveType::Timestamp, PrimitiveLiteral::Timestamp(_))
+                | (PrimitiveType::Timestamptz, 
PrimitiveLiteral::TimestampTZ(_))

Review Comment:
   Some painful differences in casing 😱 



-- 
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: issues-unsubscr...@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to