zeroshade commented on code in PR #431:
URL: https://github.com/apache/iceberg-go/pull/431#discussion_r2255029218
##########
literals.go:
##########
@@ -206,6 +206,37 @@ func LiteralFromBytes(typ Type, data []byte) (Literal,
error) {
return nil, ErrType
}
+func LiteralFromAny(v any) (Literal, error) {
+ switch x := v.(type) {
+ case bool:
+ return NewLiteral(x), nil
+ case int32:
+ return NewLiteral(x), nil
+ case int64, int:
+ return NewLiteral(int64(reflect.ValueOf(x).Int())), nil
Review Comment:
make these two separate cases, reflect is costly and expensive
--
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]