zeroshade commented on code in PR #14255:
URL: https://github.com/apache/arrow/pull/14255#discussion_r982528106
##########
go/arrow/compute/internal/exec/utils.go:
##########
@@ -172,6 +179,11 @@ func GetDataType[T NumericTypes | bool | string]()
arrow.DataType {
return typMap[reflect.TypeOf(z)]
}
+func GetType[T NumericTypes | bool | string]() arrow.Type {
+ var z T
+ return typMap[reflect.TypeOf(z)].ID()
Review Comment:
unfortunately I'm pretty sure there is an actual map lookup at runtime,
making this not something you'd want to do in a tight loop. I primarily use it
during function registration with generics and then use a closure around the
result when creating the kernels
--
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]