Skip to content

Commit

Permalink
fix(sql): FILL(LINEAR) regression in 7.4.1 (#4433)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwoolmer committed Apr 22, 2024
1 parent 22bec3f commit 9ca20dc
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public SampleByInterpolateRecordCursorFactory(
entityColumnFilter.of(keyTypes.getColumnCount());
this.mapSink2 = RecordSinkFactory.getInstance(asm, keyTypes, entityColumnFilter, false);

this.cursor = new SampleByInterpolateRecordCursor(configuration, recordFunctions, groupByFunctions, keyTypes, valueTypes, sampler, timezoneNameFunc, timezoneNameFuncPos, offsetFunc, offsetFuncPos);
this.cursor = new SampleByInterpolateRecordCursor(configuration, recordFunctions, groupByFunctions, keyTypes, valueTypes, timezoneNameFunc, timezoneNameFuncPos, offsetFunc, offsetFuncPos);
}

@Override
Expand Down Expand Up @@ -243,7 +243,6 @@ private class SampleByInterpolateRecordCursor extends VirtualFunctionSkewedSymbo

private final Function offsetFunc;
private final int offsetFuncPos;
private final TimestampSampler timestampSampler;
private final Function timezoneNameFunc;
private final int timezoneNameFuncPos;
private long fixedOffset;
Expand All @@ -256,7 +255,6 @@ public SampleByInterpolateRecordCursor(
ObjList<GroupByFunction> groupByFunctions,
@Transient @NotNull ArrayColumnTypes keyTypes,
@Transient @NotNull ArrayColumnTypes valueTypes,
TimestampSampler timestampSampler,
Function timezoneNameFunc,
int timezoneNameFuncPos,
Function offsetFunc,
Expand All @@ -272,7 +270,6 @@ public SampleByInterpolateRecordCursor(
GroupByUtils.setAllocator(groupByFunctions, allocator);
isOpen = true;

this.timestampSampler = timestampSampler;
this.timezoneNameFunc = timezoneNameFunc;
this.timezoneNameFuncPos = timezoneNameFuncPos;
this.offsetFunc = offsetFunc;
Expand Down Expand Up @@ -717,7 +714,8 @@ protected void initTimestamps() {
return;
}

assert managedCursor.hasNext();
final boolean good = managedCursor.hasNext();
assert good;

final long timestamp = managedRecord.getTimestamp(timestampIndex);
if (rules != null) {
Expand All @@ -726,9 +724,9 @@ protected void initTimestamps() {

if (tzOffset == 0 && fixedOffset == Long.MIN_VALUE) {
// this is the default path, we align time intervals to the first observation
timestampSampler.setStart(timestamp);
sampler.setStart(timestamp);
} else {
timestampSampler.setStart(fixedOffset != Long.MIN_VALUE ? fixedOffset : 0L);
sampler.setStart(fixedOffset != Long.MIN_VALUE ? fixedOffset : 0L);
}
prevSample = sampler.round(timestamp);
loSample = prevSample; // the lowest timestamp value
Expand Down

0 comments on commit 9ca20dc

Please sign in to comment.