elixir-explorer / adbc

Apache Arrow ADBC bindings for Elixir
https://arrow.apache.org/adbc/
Apache License 2.0
50 stars 16 forks source link

added support for duration types #76

Closed cocoa-xu closed 5 months ago

josevalim commented 5 months ago

Elixir v1.17 will have a duration type. Do you think it should affect the design here in any way?

cocoa-xu commented 5 months ago

Elixir v1.17 will have a duration type. Do you think it should affect the design here in any way?

This actually looks perfect for this function. Though it appears that the duration type won't support nanoseconds... (it should be ok as long as we convert nanoseconds to microseconds and make a note in the docs, but will you be interested in having nanosecond support for Duration...?)

josevalim commented 5 months ago

Hrm, it is best to leave it separate as well then. Because Elixir calendar types do not support nanosecond. I think this is good to go as is then!

cocoa-xu commented 5 months ago

Hrm, it is best to leave it separate as well then.

No problem!

Because Elixir calendar types do not support nanosecond. I think this is good to go as is then!

Perhaps we can add nanoseconds for Calendar types as well? We can discuss this later ;)

josevalim commented 5 months ago

It is hard to do so keeping backwards compatibility. Maybe we should support both duration and integers and drop precision for duration, but given we support integers already, this is good enough. In the future we can have options to keep the calendar types as integers instead of upcasting when reading from C.