Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ydb-trino-adapter/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ unsupported behavior, record:
2. an authoritative documentation link or tracked upstream issue;
3. a focused negative test that proves the connector fails clearly.

The existing negative-date overrides need this treatment.
The remaining negative-date overrides need this treatment. Date predicates with
BCE bounds stay in Trino as residual filters so they do not bind an unsupported
value to YDB.
YDB `Date` starts at the Unix epoch; see
[primitive types](https://ydb.tech/docs/en/yql/reference/types/primitive).
CHAR is rejected with the focused inherited contract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,13 @@ private static ColumnMapping dateColumnMapping() {
return ColumnMapping.longMapping(
DATE,
dateReadFunctionUsingLocalDate(),
dateWriteFunctionUsingLocalDate());
dateWriteFunctionUsingLocalDate(),
(session, domain) -> domain.getValues().getRanges().getOrderedRanges().stream()
.anyMatch(range ->
(!range.isLowUnbounded() && (long) range.getLowBoundedValue() < 0) ||
(!range.isHighUnbounded() && (long) range.getHighBoundedValue() < 0))
? DISABLE_PUSHDOWN.apply(session, domain)
: FULL_PUSHDOWN.apply(session, domain));
}

private static ColumnMapping timestampColumnMapping() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ public void testInsertNegativeDate() {
// YDB не поддерживает, negative daysSinceEpoch
}

@Test
@Override
public void testDateYearOfEraPredicate() {
// YDB не поддерживает, negative daysSinceEpoch
}

@Test
@Override
public void testCreateTableAsSelectNegativeDate() {
Expand Down