ZENOTME commented on code in PR #82:
URL: https://github.com/apache/iceberg-rust/pull/82#discussion_r1390968160


##########
crates/iceberg/src/spec/values.rs:
##########
@@ -893,9 +925,9 @@ impl Literal {
                 PrimitiveLiteral::Binary(_) => 
Type::Primitive(PrimitiveType::Binary),
                 PrimitiveLiteral::String(_) => 
Type::Primitive(PrimitiveType::String),
                 PrimitiveLiteral::UUID(_) => 
Type::Primitive(PrimitiveType::Uuid),
-                PrimitiveLiteral::Decimal(dec) => 
Type::Primitive(PrimitiveType::Decimal {
-                    precision: 38,
-                    scale: dec.scale(),
+                PrimitiveLiteral::Decimal(_) => 
Type::Primitive(PrimitiveType::Decimal {
+                    precision: MAX_DECIMAL_PRECISION,
+                    scale: 0,

Review Comment:
   > I think inferring type from literal is not feasible?
   Sounds reasonable. In most of case we can get the type from the according 
schema. cc @JanKaul 



##########
crates/iceberg/src/spec/values.rs:
##########
@@ -893,9 +925,9 @@ impl Literal {
                 PrimitiveLiteral::Binary(_) => 
Type::Primitive(PrimitiveType::Binary),
                 PrimitiveLiteral::String(_) => 
Type::Primitive(PrimitiveType::String),
                 PrimitiveLiteral::UUID(_) => 
Type::Primitive(PrimitiveType::Uuid),
-                PrimitiveLiteral::Decimal(dec) => 
Type::Primitive(PrimitiveType::Decimal {
-                    precision: 38,
-                    scale: dec.scale(),
+                PrimitiveLiteral::Decimal(_) => 
Type::Primitive(PrimitiveType::Decimal {
+                    precision: MAX_DECIMAL_PRECISION,
+                    scale: 0,

Review Comment:
   > I think inferring type from literal is not feasible?
   
   Sounds reasonable. In most of case we can get the type from the according 
schema. cc @JanKaul 



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