Skip to content

Commit

Permalink
ODP-1700: Fix failing date tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stevesamson committed Jul 15, 2024
1 parent 783a4c4 commit e25fca2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package org.apache.hadoop.hive.ql.udf.generic;

import java.text.SimpleDateFormat;
import java.time.ZoneId;
import org.apache.hadoop.hive.common.type.Date;
import org.apache.hadoop.hive.common.type.Timestamp;
Expand Down Expand Up @@ -167,7 +168,8 @@ public void testStringArg2() throws HiveException {
runAndVerify(udf2,
new Text("1400-02-01 00:00:00 ICT"),
new Text("yyyy-MM-dd HH:mm:ss z"),
new LongWritable(TimestampTZUtil.parse("1400-01-31 09:00:22", ZoneId.systemDefault()).getEpochSecond()));
new LongWritable(-17984788924L));

runAndVerify(udf2,
new Text("1400-02-01 00:00:00 UTC"),
new Text("yyyy-MM-dd HH:mm:ss z"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Input datetime;Input pattern;Local timezone;Formatter type;Expected output
1800-01-01 00:00:00;yyyy-MM-dd HH:mm:ss;Asia/Kolkata;SIMPLE;1799-12-31 23:36:32
Jul 9 2023;MMM dd yyyy;Etc/GMT;DATETIME;null
Jul 9 2023;MMM dd yyyy;Etc/GMT;SIMPLE;null
2023-07-21;DD;Etc/GMT;DATETIME;null
2023-07-21;DD;Etc/GMT;DATETIME;202
2023-07-21;DD;Etc/GMT;SIMPLE;202
2023-07-21;DDD;Etc/GMT;DATETIME;202
2023-07-21;DDD;Etc/GMT;SIMPLE;202
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Jul 09 2023;MMM dd yyyy;Etc/GMT;DATETIME;1688860800
Jul 09 2023;MMM dd yyyy;Etc/GMT;SIMPLE;1688860800
Jul 21 2023;MMM dd yyyy;Etc/GMT;DATETIME;1689897600
Jul 21 2023;MMM dd yyyy;Etc/GMT;SIMPLE;1689897600
Field DayOfYear cannot be printed as the value 202 exceeds the maximum print width of 2;YYYY-MM-DD;Etc/GMT;DATETIME;1689897600
2023-07-21;YYYY-MM-dd;Etc/GMT;DATETIME;1689897600
2023-07-202;YYYY-MM-DD;Etc/GMT;SIMPLE;1689897600
Jul 21 2023 09:13;MMM dd yyyy HH:mm;Etc/GMT;DATETIME;1689930780
Jul 21 2023 09:13;MMM dd yyyy HH:mm;Etc/GMT;SIMPLE;1689930780
Expand All @@ -32,7 +32,7 @@ Jul 21 2023 9:13;MMM dd yyyy H:mm;Etc/GMT;SIMPLE;1689930780
2023-07-21 09:13;yyyy-MM-dd HH:mm;Etc/GMT;SIMPLE;1689930780
2023-07-21 9:13;yyyy-MM-dd H:mm;Etc/GMT;DATETIME;1689930780
2023-07-21 9:13;yyyy-MM-dd H:mm;Etc/GMT;SIMPLE;1689930780
Field MilliOfDay cannot be printed as the value 33180000 exceeds the maximum print width of 2;yyyy-MM-dd HH:mmAA;Etc/GMT;DATETIME;1689930780
2023-07-21 09:1333180000;yyyy-MM-dd HH:mmAA;Etc/GMT;DATETIME;1689930780
Illegal pattern character 'A';yyyy-MM-dd HH:mmAA;Etc/GMT;SIMPLE;1689930780
Too many pattern letters: a;yyyy-MM-dd HH:mmaa;Etc/GMT;DATETIME;1689930780
2023-07-21 09:13AM;yyyy-MM-dd HH:mmaa;Etc/GMT;SIMPLE;1689930780
Expand Down

0 comments on commit e25fca2

Please sign in to comment.