Skip to content

Commit f04f606

Browse files
Swiddisykmr1224
andauthored
[Backport 2.19-dev] Fix timezone dependent test failures opensearch-project#4367 (opensearch-project#4827)
* Fix doctest Signed-off-by: Simeon Widdis <sawiddis@amazon.com> * Backport test timestamp fixes Signed-off-by: Simeon Widdis <sawiddis@amazon.com> --------- Signed-off-by: Simeon Widdis <sawiddis@amazon.com> Co-authored-by: Tomoyuki MORITA <moritato@amazon.com>
1 parent 7795b4c commit f04f606

8 files changed

Lines changed: 100 additions & 63 deletions

File tree

core/src/test/java/org/opensearch/sql/data/model/ExprValueCompareTest.java

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,26 @@
1212
import static org.opensearch.sql.data.model.ExprValueUtils.LITERAL_MISSING;
1313
import static org.opensearch.sql.data.model.ExprValueUtils.LITERAL_NULL;
1414
import static org.opensearch.sql.utils.DateTimeUtils.extractDateTime;
15+
import static org.opensearch.sql.utils.DateTimeUtils.extractTimestamp;
1516

16-
import java.time.LocalDate;
17+
import java.time.Instant;
1718
import java.time.Period;
19+
import java.time.ZoneOffset;
1820
import java.util.stream.Stream;
1921
import org.junit.jupiter.api.Test;
2022
import org.junit.jupiter.params.ParameterizedTest;
2123
import org.junit.jupiter.params.provider.Arguments;
2224
import org.junit.jupiter.params.provider.MethodSource;
2325
import org.opensearch.sql.exception.ExpressionEvaluationException;
2426
import org.opensearch.sql.expression.ExpressionTestBase;
27+
import org.opensearch.sql.expression.function.FunctionProperties;
2528

2629
public class ExprValueCompareTest extends ExpressionTestBase {
2730

31+
// Use a fixed timestamp for consistent test results across timezones
32+
private static final FunctionProperties FIXED_FUNCTION_PROPERTIES =
33+
new FunctionProperties(Instant.parse("2023-05-15T00:00:00Z"), ZoneOffset.UTC);
34+
2835
@Test
2936
public void timeValueCompare() {
3037
assertEquals(0, new ExprTimeValue("18:00:00").compareTo(new ExprTimeValue("18:00:00")));
@@ -79,22 +86,18 @@ private static Stream<Arguments> getEqualDatetimeValuesOfDifferentTypes() {
7986
Arguments.of(
8087
new ExprTimestampValue("1984-11-22 00:00:00"), new ExprDateValue("1984-11-22")),
8188
Arguments.of(
82-
new ExprTimestampValue(LocalDate.now() + " 00:00:00"),
83-
new ExprDateValue(LocalDate.now())),
84-
Arguments.of(
85-
new ExprDatetimeValue(LocalDate.now() + " 17:42:15"), new ExprTimeValue("17:42:15")),
89+
new ExprTimestampValue("2023-05-15 00:00:00"), new ExprDateValue("2023-05-15")),
90+
Arguments.of(new ExprDateValue("2023-05-15"), new ExprTimeValue("00:00:00")),
91+
Arguments.of(
92+
new ExprTimestampValue("1984-11-22 00:00:00"), new ExprDateValue("1984-11-22")),
93+
Arguments.of(new ExprTimeValue("17:42:15"), new ExprTimestampValue("2023-05-15 17:42:15")),
8694
Arguments.of(
8795
new ExprDatetimeValue("2012-08-07 19:14:38"),
8896
new ExprTimestampValue("2012-08-07 19:14:38")),
8997
Arguments.of(new ExprDateValue("2012-08-07"), new ExprDatetimeValue("2012-08-07 00:00:00")),
9098
Arguments.of(new ExprDateValue("2007-01-27"), new ExprDatetimeValue("2007-01-27 00:00:00")),
91-
Arguments.of(new ExprDateValue(LocalDate.now()), new ExprTimeValue("00:00:00")),
92-
Arguments.of(
93-
new ExprTimestampValue("1984-11-22 00:00:00"), new ExprDateValue("1984-11-22")),
9499
Arguments.of(
95-
new ExprTimeValue("19:14:38"), new ExprDatetimeValue(LocalDate.now() + " 19:14:38")),
96-
Arguments.of(
97-
new ExprTimeValue("17:42:15"), new ExprTimestampValue(LocalDate.now() + " 17:42:15")));
100+
new ExprTimestampValue("1984-11-22 00:00:00"), new ExprDateValue("1984-11-22")));
98101
}
99102

100103
/**
@@ -106,12 +109,8 @@ private static Stream<Arguments> getEqualDatetimeValuesOfDifferentTypes() {
106109
public void compareEqDifferentDateTimeValueTypes(ExprValue left, ExprValue right) {
107110
assertEquals(
108111
0,
109-
extractDateTime(left, functionProperties)
110-
.compareTo(extractDateTime(right, functionProperties)));
111-
assertEquals(
112-
0,
113-
extractDateTime(right, functionProperties)
114-
.compareTo(extractDateTime(left, functionProperties)));
112+
extractTimestamp(left, FIXED_FUNCTION_PROPERTIES)
113+
.compareTo(extractTimestamp(right, FIXED_FUNCTION_PROPERTIES)));
115114
}
116115

117116
private static Stream<Arguments> getNotEqualDatetimeValuesOfDifferentTypes() {
@@ -120,23 +119,20 @@ private static Stream<Arguments> getNotEqualDatetimeValuesOfDifferentTypes() {
120119
new ExprDatetimeValue("2012-08-07 19:14:38"),
121120
new ExprTimestampValue("1961-04-12 09:07:00")),
122121
Arguments.of(new ExprDatetimeValue("2012-08-07 19:14:38"), new ExprTimeValue("09:07:00")),
123-
Arguments.of(
124-
new ExprDatetimeValue(LocalDate.now() + " 19:14:38"), new ExprTimeValue("09:07:00")),
125122
Arguments.of(new ExprDatetimeValue("2012-08-07 00:00:00"), new ExprDateValue("1961-04-12")),
126123
Arguments.of(new ExprDatetimeValue("1961-04-12 19:14:38"), new ExprDateValue("1961-04-12")),
127124
Arguments.of(new ExprDateValue("1984-11-22"), new ExprDatetimeValue("1961-04-12 19:14:38")),
128125
Arguments.of(
129126
new ExprDateValue("1984-11-22"), new ExprTimestampValue("2020-09-16 17:30:00")),
130127
Arguments.of(new ExprDateValue("1984-11-22"), new ExprTimeValue("19:14:38")),
131-
Arguments.of(new ExprTimeValue("19:14:38"), new ExprDateValue(LocalDate.now())),
132128
Arguments.of(new ExprTimeValue("19:14:38"), new ExprDatetimeValue("2012-08-07 09:07:00")),
129+
Arguments.of(new ExprTimeValue("19:14:38"), new ExprDateValue("2023-05-15")),
133130
Arguments.of(new ExprTimeValue("19:14:38"), new ExprTimestampValue("1984-02-03 04:05:07")),
134131
Arguments.of(
135132
new ExprTimestampValue("2012-08-07 19:14:38"),
136133
new ExprDatetimeValue("1961-04-12 09:07:00")),
137134
Arguments.of(new ExprTimestampValue("2012-08-07 19:14:38"), new ExprTimeValue("09:07:00")),
138-
Arguments.of(
139-
new ExprTimestampValue(LocalDate.now() + " 19:14:38"), new ExprTimeValue("09:07:00")),
135+
Arguments.of(new ExprTimestampValue("2023-05-15 19:14:38"), new ExprTimeValue("09:07:00")),
140136
Arguments.of(
141137
new ExprTimestampValue("2012-08-07 00:00:00"), new ExprDateValue("1961-04-12")),
142138
Arguments.of(

core/src/test/java/org/opensearch/sql/expression/ExpressionTestBase.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
import com.google.common.collect.ImmutableList;
2828
import com.google.common.collect.ImmutableMap;
29+
import java.time.Instant;
30+
import java.time.ZoneOffset;
2931
import java.util.List;
3032
import java.util.function.Function;
3133
import org.opensearch.sql.data.model.ExprValue;
@@ -36,7 +38,9 @@
3638

3739
public class ExpressionTestBase {
3840

39-
protected FunctionProperties functionProperties = new FunctionProperties();
41+
// Use fixed timestamp to ensure timezone-independent tests
42+
protected final FunctionProperties functionProperties =
43+
new FunctionProperties(Instant.parse("2023-05-15T00:00:00Z"), ZoneOffset.UTC);
4044

4145
protected Environment<Expression, ExprType> typeEnv;
4246

core/src/test/java/org/opensearch/sql/expression/datetime/DateDiffTest.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
import java.time.LocalDate;
1313
import java.time.LocalDateTime;
1414
import java.time.LocalTime;
15-
import java.time.ZoneId;
1615
import java.time.temporal.Temporal;
17-
import java.util.TimeZone;
1816
import java.util.stream.Stream;
1917
import org.junit.jupiter.params.ParameterizedTest;
2018
import org.junit.jupiter.params.provider.Arguments;
@@ -28,9 +26,14 @@ public class DateDiffTest extends DateTimeTestBase {
2826
private static final LocalDate dateSample2 = LocalDate.of(1961, 4, 12);
2927
private static final LocalDate dateSample3 = LocalDate.of(1993, 3, 4);
3028
private static final LocalDate epochStart = LocalDate.of(1970, 1, 1);
31-
private static final LocalDate dateNow = LocalDate.now();
29+
// Use fixed date instead of LocalDate.now() to avoid timezone issues
30+
private static final LocalDate dateNow = LocalDate.of(2023, 5, 15);
3231
private static final LocalDateTime dateTimeSample1 = LocalDateTime.of(1961, 4, 12, 9, 7);
3332
private static final LocalDateTime dateTimeSample2 = LocalDateTime.of(1993, 3, 4, 5, 6);
33+
// Use fixed datetime instead of LocalDateTime.now()
34+
private static final LocalDateTime fixedNow = LocalDateTime.of(2023, 5, 15, 12, 0, 0);
35+
// Use fixed instant instead of Instant.now()
36+
private static final Instant fixedInstantNow = Instant.parse("2023-05-15T12:00:00Z");
3437

3538
// Function signature is:
3639
// (DATE/DATETIME/TIMESTAMP/TIME, DATE/DATETIME/TIMESTAMP/TIME) -> LONG
@@ -39,15 +42,14 @@ private static Stream<Arguments> getTestData() {
3942
return Stream.of(
4043
Arguments.of(timeSample1, timeSample2, 0L),
4144
Arguments.of(timeSample1, dateNow, 0L),
42-
Arguments.of(timeSample1, LocalDateTime.now(), 0L),
43-
Arguments.of(
44-
timeSample1, Instant.now().plusMillis(TimeZone.getDefault().getRawOffset()), 0L),
45+
Arguments.of(timeSample1, fixedNow, 0L),
46+
Arguments.of(timeSample1, fixedInstantNow, 0L),
4547
Arguments.of(dateSample1, timeSample1, -DAYS.between(dateSample1, dateNow)),
4648
Arguments.of(dateSample1, dateSample3, -DAYS.between(dateSample1, dateSample3)),
4749
Arguments.of(dateSample1, dateTimeSample1, -DAYS.between(dateSample1, dateSample2)),
4850
Arguments.of(
4951
dateSample1, Instant.ofEpochSecond(42), -DAYS.between(dateSample1, epochStart)),
50-
Arguments.of(dateTimeSample1, LocalTime.now(), -DAYS.between(dateSample2, dateNow)),
52+
Arguments.of(dateTimeSample1, LocalTime.of(12, 0), -DAYS.between(dateSample2, dateNow)),
5153
Arguments.of(dateTimeSample1, dateSample3, -DAYS.between(dateSample2, dateSample3)),
5254
Arguments.of(dateTimeSample1, dateTimeSample2, -DAYS.between(dateSample2, dateSample3)),
5355
Arguments.of(
@@ -58,8 +60,8 @@ private static Stream<Arguments> getTestData() {
5860
Instant.ofEpochSecond(0), dateTimeSample2, -DAYS.between(epochStart, dateSample3)),
5961
Arguments.of(
6062
Instant.ofEpochSecond(0),
61-
Instant.now(),
62-
-DAYS.between(epochStart, LocalDateTime.now(ZoneId.of("UTC")))));
63+
fixedInstantNow,
64+
-DAYS.between(epochStart, fixedNow.toLocalDate())));
6365
}
6466

6567
@ParameterizedTest

core/src/test/java/org/opensearch/sql/expression/datetime/DateTimeTestBase.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import java.time.LocalDate;
1212
import java.time.LocalDateTime;
1313
import java.time.LocalTime;
14+
import java.time.ZoneOffset;
1415
import java.time.temporal.Temporal;
1516
import java.util.List;
1617
import org.opensearch.sql.data.model.ExprDateValue;
@@ -24,12 +25,17 @@
2425
import org.opensearch.sql.expression.FunctionExpression;
2526
import org.opensearch.sql.expression.function.BuiltinFunctionName;
2627
import org.opensearch.sql.expression.function.BuiltinFunctionRepository;
28+
import org.opensearch.sql.expression.function.FunctionProperties;
2729

2830
public class DateTimeTestBase extends ExpressionTestBase {
2931

3032
protected final BuiltinFunctionRepository functionRepository =
3133
BuiltinFunctionRepository.getInstance();
3234

35+
// Override functionProperties with fixed values to ensure timezone-independent tests
36+
protected final FunctionProperties functionProperties =
37+
new FunctionProperties(Instant.parse("2023-05-15T00:00:00Z"), ZoneOffset.UTC);
38+
3339
protected ExprValue eval(Expression expression) {
3440
return expression.valueOf();
3541
}

core/src/test/java/org/opensearch/sql/expression/datetime/StrToDateTest.java

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
import static org.opensearch.sql.data.type.ExprCoreType.DATETIME;
1010
import static org.opensearch.sql.data.type.ExprCoreType.UNDEFINED;
1111

12+
import java.time.Instant;
1213
import java.time.LocalDate;
1314
import java.time.LocalDateTime;
1415
import java.time.LocalTime;
16+
import java.time.ZoneOffset;
1517
import java.util.stream.Stream;
1618
import org.junit.jupiter.api.Test;
1719
import org.junit.jupiter.params.ParameterizedTest;
@@ -27,6 +29,7 @@
2729
import org.opensearch.sql.expression.Expression;
2830
import org.opensearch.sql.expression.ExpressionTestBase;
2931
import org.opensearch.sql.expression.FunctionExpression;
32+
import org.opensearch.sql.expression.function.FunctionProperties;
3033

3134
class StrToDateTest extends ExpressionTestBase {
3235

@@ -87,10 +90,12 @@ public void test_str_to_date(
8790
}
8891

8992
private static LocalDateTime getExpectedTimeResult(int hour, int minute, int seconds) {
93+
// Use a fixed date to avoid timezone-dependent test failures
94+
LocalDate fixedDate = LocalDate.of(2023, 5, 15);
9095
return LocalDateTime.of(
91-
LocalDate.now().getYear(),
92-
LocalDate.now().getMonthValue(),
93-
LocalDate.now().getDayOfMonth(),
96+
fixedDate.getYear(),
97+
fixedDate.getMonthValue(),
98+
fixedDate.getDayOfMonth(),
9499
hour,
95100
minute,
96101
seconds);
@@ -106,10 +111,13 @@ private static Stream<Arguments> getTestDataForStrToDateWithTime() {
106111
@ParameterizedTest(name = "{1}")
107112
@MethodSource("getTestDataForStrToDateWithTime")
108113
public void test_str_to_date_with_time_type(String parsed, String format) {
114+
// Use fixed function properties to ensure consistent test results across timezones
115+
FunctionProperties fixedFunctionProperties =
116+
new FunctionProperties(Instant.parse("2023-05-15T00:00:00Z"), ZoneOffset.UTC);
109117

110118
FunctionExpression expression =
111119
DSL.str_to_date(
112-
functionProperties,
120+
fixedFunctionProperties,
113121
DSL.literal(new ExprStringValue(parsed)),
114122
DSL.literal(new ExprStringValue(format)));
115123

@@ -148,19 +156,23 @@ public void test_str_to_date_with_time_format() {
148156
final int MINUTES = 11;
149157
final int SECONDS = 12;
150158

159+
// Use fixed function properties to ensure consistent test results across timezones
160+
FunctionProperties fixedFunctionProperties =
161+
new FunctionProperties(Instant.parse("2023-05-15T00:00:00Z"), ZoneOffset.UTC);
162+
151163
LocalTime arg = LocalTime.of(HOURS, MINUTES, SECONDS);
152164
String format = "%h,%i,%s";
153165

154166
FunctionExpression dateFormatExpr =
155167
DSL.time_format(
156-
functionProperties,
168+
fixedFunctionProperties,
157169
DSL.literal(new ExprTimeValue(arg)),
158170
DSL.literal(new ExprStringValue(format)));
159171
String timeFormatResult = eval(dateFormatExpr).stringValue();
160172

161173
FunctionExpression strToDateExpr =
162174
DSL.str_to_date(
163-
functionProperties,
175+
fixedFunctionProperties,
164176
DSL.literal(new ExprStringValue(timeFormatResult)),
165177
DSL.literal(new ExprStringValue(format)));
166178
LocalDateTime strToDateResult = eval(strToDateExpr).datetimeValue();

core/src/test/java/org/opensearch/sql/expression/datetime/TimeStampAddTest.java

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -129,27 +129,29 @@ public void testTimestampadd(String unit, int amount, ExprValue datetimeExpr, St
129129
}
130130

131131
private static Stream<Arguments> getTestDataForTestAddingDatePartToTime() {
132+
// Use fixed date to avoid timezone-dependent test failures
133+
LocalDate fixedDate = LocalDate.of(2023, 5, 15);
132134
return Stream.of(
133-
Arguments.of("DAY", 1, "10:11:12", LocalDate.now().plusDays(1)),
134-
Arguments.of("DAY", 5, "10:11:12", LocalDate.now().plusDays(5)),
135-
Arguments.of("DAY", 10, "10:11:12", LocalDate.now().plusDays(10)),
136-
Arguments.of("DAY", -10, "10:11:12", LocalDate.now().plusDays(-10)),
137-
Arguments.of("WEEK", 1, "10:11:12", LocalDate.now().plusWeeks(1)),
138-
Arguments.of("WEEK", 5, "10:11:12", LocalDate.now().plusWeeks(5)),
139-
Arguments.of("WEEK", 10, "10:11:12", LocalDate.now().plusWeeks(10)),
140-
Arguments.of("WEEK", -10, "10:11:12", LocalDate.now().plusWeeks(-10)),
141-
Arguments.of("MONTH", 1, "10:11:12", LocalDate.now().plusMonths(1)),
142-
Arguments.of("MONTH", 5, "10:11:12", LocalDate.now().plusMonths(5)),
143-
Arguments.of("MONTH", 10, "10:11:12", LocalDate.now().plusMonths(10)),
144-
Arguments.of("MONTH", -10, "10:11:12", LocalDate.now().plusMonths(-10)),
145-
Arguments.of("QUARTER", 1, "10:11:12", LocalDate.now().plusMonths(3 * 1)),
146-
Arguments.of("QUARTER", 3, "10:11:12", LocalDate.now().plusMonths(3 * 3)),
147-
Arguments.of("QUARTER", 5, "10:11:12", LocalDate.now().plusMonths(3 * 5)),
148-
Arguments.of("QUARTER", -5, "10:11:12", LocalDate.now().plusMonths(3 * -5)),
149-
Arguments.of("YEAR", 1, "10:11:12", LocalDate.now().plusYears(1)),
150-
Arguments.of("YEAR", 5, "10:11:12", LocalDate.now().plusYears(5)),
151-
Arguments.of("YEAR", 10, "10:11:12", LocalDate.now().plusYears(10)),
152-
Arguments.of("YEAR", -10, "10:11:12", LocalDate.now().plusYears(-10)));
135+
Arguments.of("DAY", 1, "10:11:12", fixedDate.plusDays(1)),
136+
Arguments.of("DAY", 5, "10:11:12", fixedDate.plusDays(5)),
137+
Arguments.of("DAY", 10, "10:11:12", fixedDate.plusDays(10)),
138+
Arguments.of("DAY", -10, "10:11:12", fixedDate.plusDays(-10)),
139+
Arguments.of("WEEK", 1, "10:11:12", fixedDate.plusWeeks(1)),
140+
Arguments.of("WEEK", 5, "10:11:12", fixedDate.plusWeeks(5)),
141+
Arguments.of("WEEK", 10, "10:11:12", fixedDate.plusWeeks(10)),
142+
Arguments.of("WEEK", -10, "10:11:12", fixedDate.plusWeeks(-10)),
143+
Arguments.of("MONTH", 1, "10:11:12", fixedDate.plusMonths(1)),
144+
Arguments.of("MONTH", 5, "10:11:12", fixedDate.plusMonths(5)),
145+
Arguments.of("MONTH", 10, "10:11:12", fixedDate.plusMonths(10)),
146+
Arguments.of("MONTH", -10, "10:11:12", fixedDate.plusMonths(-10)),
147+
Arguments.of("QUARTER", 1, "10:11:12", fixedDate.plusMonths(3 * 1)),
148+
Arguments.of("QUARTER", 3, "10:11:12", fixedDate.plusMonths(3 * 3)),
149+
Arguments.of("QUARTER", 5, "10:11:12", fixedDate.plusMonths(3 * 5)),
150+
Arguments.of("QUARTER", -5, "10:11:12", fixedDate.plusMonths(3 * -5)),
151+
Arguments.of("YEAR", 1, "10:11:12", fixedDate.plusYears(1)),
152+
Arguments.of("YEAR", 5, "10:11:12", fixedDate.plusYears(5)),
153+
Arguments.of("YEAR", 10, "10:11:12", fixedDate.plusYears(10)),
154+
Arguments.of("YEAR", -10, "10:11:12", fixedDate.plusYears(-10)));
153155
}
154156

155157
@ParameterizedTest
@@ -181,8 +183,10 @@ public void testAddingTimePartToTime() {
181183
DSL.literal(new ExprIntegerValue(addedInterval)),
182184
DSL.literal(new ExprTimeValue(timeArg)));
183185

186+
// Use fixed date to avoid timezone-dependent test failures
184187
LocalDateTime expected =
185-
LocalDateTime.of(LocalDate.now(), LocalTime.parse(timeArg).plusMinutes(addedInterval));
188+
LocalDateTime.of(
189+
LocalDate.of(2023, 5, 15), LocalTime.parse(timeArg).plusMinutes(addedInterval));
186190

187191
assertEquals(new ExprDatetimeValue(expected), eval(expr));
188192
}

core/src/test/java/org/opensearch/sql/expression/datetime/TimeStampDiffTest.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import static org.junit.jupiter.api.Assertions.assertEquals;
1010
import static org.junit.jupiter.api.Assertions.assertThrows;
1111

12+
import java.time.Instant;
1213
import java.time.LocalDate;
1314
import java.time.LocalDateTime;
1415
import java.time.LocalTime;
@@ -225,7 +226,12 @@ private static Stream<Arguments> getUnits() {
225226
@ParameterizedTest
226227
@MethodSource("getUnits")
227228
public void testTimestampDiffWithTimeType(String unit) {
228-
LocalDateTime base = LocalDateTime.of(LocalDate.now(), LocalTime.of(10, 11, 12));
229+
// Use fixed date to avoid timezone-dependent test failures
230+
LocalDateTime base = LocalDateTime.of(LocalDate.of(2023, 5, 15), LocalTime.of(10, 11, 12));
231+
232+
// Use fixed function properties to ensure consistent test results across timezones
233+
FunctionProperties fixedFunctionProperties =
234+
new FunctionProperties(Instant.parse("2023-05-15T00:00:00Z"), ZoneOffset.UTC);
229235

230236
ExprValue timeExpr = generateArg(unit, "TIME", base, 0);
231237
ExprValue timestampExpr = generateArg(unit, "TIMESTAMP", base, 0);
@@ -237,7 +243,7 @@ public void testTimestampDiffWithTimeType(String unit) {
237243

238244
for (ExprValue arg1 : expressions) {
239245
for (ExprValue arg2 : expressions) {
240-
FunctionExpression funcExpr = timestampdiffQuery(functionProperties, unit, arg1, arg2);
246+
FunctionExpression funcExpr = timestampdiffQuery(fixedFunctionProperties, unit, arg1, arg2);
241247

242248
assertEquals(0L, eval(funcExpr).longValue());
243249
}

0 commit comments

Comments
 (0)