Skip to content

Commit

Permalink
ARROW-3671: [Go] implement MonthInterval and DayTimeInterval
Browse files Browse the repository at this point in the history
Author: Sebastien Binet <[email protected]>

Closes apache#4562 from sbinet/issue-3671 and squashes the following commits:

9a7d04d <Sebastien Binet> ARROW-3671:  implement MonthInterval and DayTimeInterval
  • Loading branch information
sbinet committed Jun 14, 2019
1 parent 72b5531 commit 634c8d2
Show file tree
Hide file tree
Showing 6 changed files with 901 additions and 19 deletions.
2 changes: 1 addition & 1 deletion go/arrow/array/array.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func init() {
arrow.TIMESTAMP: func(data *Data) Interface { return NewTimestampData(data) },
arrow.TIME32: func(data *Data) Interface { return NewTime32Data(data) },
arrow.TIME64: func(data *Data) Interface { return NewTime64Data(data) },
arrow.INTERVAL: unsupportedArrayType,
arrow.INTERVAL: func(data *Data) Interface { return NewIntervalData(data) },
arrow.DECIMAL: unsupportedArrayType,
arrow.LIST: func(data *Data) Interface { return NewListData(data) },
arrow.STRUCT: func(data *Data) Interface { return NewStructData(data) },
Expand Down
12 changes: 12 additions & 0 deletions go/arrow/array/compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ func ArrayEqual(left, right Interface) bool {
case *Struct:
r := right.(*Struct)
return arrayEqualStruct(l, r)
case *MonthInterval:
r := right.(*MonthInterval)
return arrayEqualMonthInterval(l, r)
case *DayTimeInterval:
r := right.(*DayTimeInterval)
return arrayEqualDayTimeInterval(l, r)

default:
panic(errors.Errorf("arrow/array: unknown array type %T", l))
Expand Down Expand Up @@ -329,6 +335,12 @@ func arrayApproxEqual(left, right Interface, opt equalOption) bool {
case *Struct:
r := right.(*Struct)
return arrayApproxEqualStruct(l, r, opt)
case *MonthInterval:
r := right.(*MonthInterval)
return arrayEqualMonthInterval(l, r)
case *DayTimeInterval:
r := right.(*DayTimeInterval)
return arrayEqualDayTimeInterval(l, r)

default:
panic(errors.Errorf("arrow/array: unknown array type %T", l))
Expand Down
Loading

0 comments on commit 634c8d2

Please sign in to comment.