cashmand commented on code in PR #48064: URL: https://github.com/apache/spark/pull/48064#discussion_r1754460425
########## common/variant/README.md: ########## @@ -362,6 +362,8 @@ The Decimal type contains a scale, but no precision. The implied precision of a | 18 <= precision <= 38 | int128 | | > 38 | Not supported | +The *Logical Type* column indicates logical equivalence of physically encoded types. For example, a user expression operating on a string value containing "hello" should behave the same, whether it is encoded with the short string optimization, or long string encoding. Similarly, user expressions operating on an *int8* value of 1 should behave the same as a decimal16 with scale 2 and unscaled value 100. Review Comment: I'm not sure I understand the question, but they're both numbers with a well-defined value. If a number can be represented with either physical representation (e.g. 1), then the value should be considered the same, whether it's encoded as an `int8` or `decimal(16, 2)`. If It can only be represented by one of them (e.g. 1.23), then there's no way to encoded it using `int8`. If an engine wants to support e.g. comparison of variant values, than `1.23 > 1` should be true regardless of the underlying representation of the two values. -- 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]
