Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
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
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ Release 0.9.0 - unreleased

BUG FIXES

TAJO-905: When to_date() parses some date without day, the result will be
wrong. (hyunsik)

TAJO-891: Complex join conditions with UNION or inline should be supported.
(hyunsik)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,11 @@ public static TimeMeta parseDateTime(String dateText, String formatText) {
//TODO consider TimeZone
doToTimestamp(dateText, formatText, tm);

// when we parse some date without day like '2014-04', we should set day to 1.
if (tm.dayOfMonth == 0) {
tm.dayOfMonth = 1;
}

if (tm.dayOfYear > 0 && tm.dayOfMonth > 0) {
tm.dayOfYear = 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ public void testToDate() throws IOException {
testSimpleEval("select to_date('2014-01-04', 'YYYY-MM-DD')", new String[]{"2014-01-04"});
testSimpleEval("select to_date('2014-01-04', 'YYYY-MM-DD') + interval '1 day'",
new String[]{"2014-01-05 00:00:00" + getUserTimeZoneDisplay()});

testSimpleEval("SELECT to_date('201404', 'yyyymm');", new String[]{"2014-04-01"});
}

@Test
Expand Down