zhjwpku commented on code in PR #653:
URL: https://github.com/apache/iceberg-cpp/pull/653#discussion_r3292682818
##########
src/iceberg/expression/literal.cc:
##########
@@ -388,18 +451,19 @@ std::strong_ordering CompareFloat(T lhs, T rhs) {
namespace {
bool Comparable(TypeId lhs, TypeId rhs) {
- switch (lhs) {
- case TypeId::kInt:
- case TypeId::kDate:
- return rhs == TypeId::kInt || rhs == TypeId::kDate;
- case TypeId::kLong:
- case TypeId::kTimestamp:
- case TypeId::kTimestampTz:
- return rhs == TypeId::kLong || rhs == TypeId::kTimestamp ||
- rhs == TypeId::kTimestampTz;
- default:
- return lhs == rhs;
+ if (lhs == rhs) {
+ return true;
+ }
+ if ((lhs == TypeId::kInt || lhs == TypeId::kDate) &&
+ (rhs == TypeId::kInt || rhs == TypeId::kDate)) {
+ return true;
}
+ if ((lhs == TypeId::kTimestamp || lhs == TypeId::kTimestampTz) &&
Review Comment:
I create https://github.com/apache/iceberg-cpp/pull/676 to make it stricter
--
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]