A + B != B + A when it comes to adding duration to timestamp, for example.
Should add(timestamp, duration) == add(duration, timestamp)? Or, in other words, should the order matter?
This has surfaced in R when creating some of the lubridate bindings - see non-lubridate example below
a<- ymd("2009-08-03", tz="America/Chicago")
a_array<-Array$create(rep(a, 12))
b_array<-Array$create((1:12)*86400L)$cast(time32(unit="s")) -Array$create(rep(0L, 12))$cast(time32(unit="s"))
a_arraya_arrayArray<timestamp[us, tz=America/Chicago]>
[
2009-08-0305:00:00.000000,
2009-08-0305:00:00.000000,
2009-08-0305:00:00.000000,
2009-08-0305:00:00.000000,
2009-08-0305:00:00.000000,
2009-08-0305:00:00.000000,
2009-08-0305:00:00.000000,
2009-08-0305:00:00.000000,
2009-08-0305:00:00.000000,
2009-08-0305:00:00.000000,
2009-08-0305:00:00.000000,
2009-08-0305:00:00.000000
]
b_arrayArray<duration[s]>
[
86400,
172800,
259200,
345600,
432000,
518400,
604800,
691200,
777600,
864000,
950400,
1036800
]
a_array+b_arrayArray<timestamp[us, tz=America/Chicago]>
[
2009-08-0405:00:00.000000,
2009-08-0505:00:00.000000,
2009-08-0605:00:00.000000,
2009-08-0705:00:00.000000,
2009-08-0805:00:00.000000,
2009-08-0905:00:00.000000,
2009-08-1005:00:00.000000,
2009-08-1105:00:00.000000,
2009-08-1205:00:00.000000,
2009-08-1305:00:00.000000,
2009-08-1405:00:00.000000,
2009-08-1505:00:00.000000
]
b_array+a_arrayError:NotImplemented:Function'add_checked'hasnokernelmatchinginput types (array[duration[us]], array[timestamp[us, tz=America/Chicago]])
/Users/dragos/Documents/arrow/cpp/src/arrow/compute/function.cc:231 DispatchBest(&inputs)Reporter: Dragoș Moldovan-Grünfeld / @dragosmg
Assignee: Rok Mihevc / @rok
Watchers: Rok Mihevc / @rok
Related issues:
PRs and other links:
Note: This issue was originally created as ARROW-15919. Please see the migration documentation for further details.
A + B != B + A when it comes to adding duration to timestamp, for example.
Should
add(timestamp, duration) == add(duration, timestamp)? Or, in other words, should the order matter?This has surfaced in R when creating some of the lubridate bindings - see non-lubridate example below
Reporter: Dragoș Moldovan-Grünfeld / @dragosmg
Assignee: Rok Mihevc / @rok
Watchers: Rok Mihevc / @rok
Related issues:
PRs and other links:
Note: This issue was originally created as ARROW-15919. Please see the migration documentation for further details.