-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different primitive types in different languages #35052
Comments
It might be nice to agree on other type categories too (temporal, numeric, etc.) |
I think, it's also a great idea to define all types of tensors, because they are also different.
|
For Rust we don't define booleans as primitives because it is a separate array type, This arises because there is a non-trivial behaviour and API difference between arrays of aligned scalars, and bit packed bools, with the former having native language support, e.g. I suspect there may be differing definitions of what constitutes a primitive type, is it being a native scalar value (which is what Rust uses), or does it reflect the buffer layout Edit: although the lack of Decimal in python and the presence of null in Go is confusing... 🤔 |
My initial reading of this ticket is that I would expect the native type mappings of Arrow --> languages to differ somewhat given different languages have different notions of what "primitive types" are. Most languages have native integer and float support, but from there the differences get substantial as highlighted above So in other words maybe this is "not a bug, working as expected" @izveigor I wonder if you could provide some background about why you are raising this issue (like what problem does varying native types in different language bindings cause)? |
I didn't accurately describe the problem, I will try to ask some questions that I did not understand.
I think the answers to these questions will be of interest to users who do not quite understand the definition. |
"Not nested" is one definition of primitive (and it matches the one I have in my head) but it seems like not all implementations have chosen this definition. For example, if I interpret @tustvold 's comment correctly I believe it says that Rust has chosen "primitive" to mean "maps directly to a rust primitive array". Since "primitive" is not defined by the spec it is probably valid (as @alamb mentions) for each implementation to have a different definition.
The rust tensor implementation is older and predates recent discussion on a formalized definition for tensors added in #33925 Given the definition in #33925 I don't see any use of the word "primitive" or, in fact, any limitation to the possible types. So I think it would be legal (if not altogether sensible) to have tensors of nested types. For example, a tensor of strings should be legal. |
Thanks for the answer, @westonpace. I think after that I have no questions left about primitive types. |
Describe the bug, including details regarding any error messages, version, and platform.
Primitive types differ depending on the programming language.
I think, there must be some rule that determines whether a type belongs to primitive types.
Component(s)
Go, Python
The text was updated successfully, but these errors were encountered: