Change the behavior to return the correct format for day and year intervals.#40
Conversation
| stringGetter = (index) -> { | ||
| final NullableIntervalDayHolder holder = new NullableIntervalDayHolder(); | ||
| vector.get(index, holder); | ||
| final int days = holder.days; |
There was a problem hiding this comment.
If holder indicates the value is null, we can return null directly
| return object; | ||
| stringGetter = (index) -> { | ||
| final NullableIntervalYearHolder holder = new NullableIntervalYearHolder(); | ||
| vector.get(index, holder); |
There was a problem hiding this comment.
If holder indicates the value is null, we can return null directly
| this.wasNull = object == null; | ||
| this.wasNullConsumer.setWasNull(this.wasNull); | ||
| if (object == null) { | ||
| if (vector.isNull(getCurrentRow())) { |
There was a problem hiding this comment.
If we make the previous change I suggested, we can call stringGetter and compare it to null instead of calling vector.isNull
| } | ||
|
|
||
| @Override | ||
| public Object getObject() { |
There was a problem hiding this comment.
Lets roll back getObject. It was more performant before
| if (object == null) { | ||
| if (vector.isNull(getCurrentRow())) { | ||
| wasNull = true; | ||
| wasNullConsumer.setWasNull(true); |
There was a problem hiding this comment.
We should set wasNull and call setWasNull always, otherwise it never goes back to false
| Assert.assertEquals("-001 00:00:00.000", formatIntervalDay(parse("PT-24H"))); | ||
| Assert.assertEquals("+001 00:00:00.000", formatIntervalDay(parse("PT+24H"))); |
There was a problem hiding this comment.
Let's create an org.joda.time.Period object here and use plusDays/plusMillis instead of parsing a String. And we should simulate larger differences like +/-1567 00:00:00.000.
There was a problem hiding this comment.
Also, where are the IntervalYear tests?
|
Just ensure it builds. |
Changes were made to return the correct values for the intervals.