Hi,

By looking into the code of arrow compute, I found there it uses
`TypeHolder` [1], and expression might call `GetTypes` to get the input or
output types. The document for `TypeHolder` says that it's a container for
dynamically created `shared_ptr<DataType>`. However, my view is:

1. It's widely used, and might store non-owned types(e.g [2])
2. There are some type factory for lots of data type, like [3], so
non-nested types tent to be used with singleton

I wonder that when would `TypeHolder` has owned types, when would them have
non-owned types, and would some primitive types like int8, int16 or types
like string shares the same underlying pointer?

Thanks,
Xuwei Fu


[1] https://github.com/apache/arrow/blob/main/cpp/src/arrow/type.h#L215
[2]
https://github.com/apache/arrow/blob/main/cpp/src/arrow/compute/expression_internal.h#L47
[3] https://github.com/apache/arrow/blob/main/cpp/src/arrow/type.cc#L2510

Reply via email to