Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse ISO8601 time with Zone. #1

Open
wants to merge 1 commit into
base: 3.1.0.0-78
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import java.time.Instant;
import java.time.LocalDateTime;
import java.time.OffsetDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
Expand Down Expand Up @@ -160,7 +161,11 @@ public static Timestamp valueOf(String s) {
try {
localDateTime = LocalDateTime.parse(s);
} catch (DateTimeParseException e2) {
throw new IllegalArgumentException("Cannot create timestamp, parsing error");
try {
localDateTime = OffsetDateTime.parse(s).toLocalDateTime();
} catch (DateTimeParseException e3) {
throw new IllegalArgumentException("Cannot create timestamp, parsing error");
}
}
}
return new Timestamp(localDateTime);
Expand Down
20 changes: 10 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,18 @@
<maven.build-helper.plugin.version>1.8</maven.build-helper.plugin.version>

<!-- Library Dependency Versions -->
<accumulo.version>1.7.0.3.1.0.0-SNAPSHOT</accumulo.version>
<accumulo.version>1.7.0.3.1.0.0-78</accumulo.version>
<activemq.version>5.5.0</activemq.version>
<ant.version>1.9.1</ant.version>
<antlr.version>3.5.2</antlr.version>
<apache-directory-server.version>1.5.6</apache-directory-server.version>
<apache-directory-clientapi.version>0.1</apache-directory-clientapi.version>
<!-- Include arrow for LlapOutputFormatService -->
<arrow.version>0.8.0</arrow.version>
<avatica.version>1.10.0.3.1.0.0-SNAPSHOT</avatica.version>
<avatica.version>1.10.0.3.1.0.0-78</avatica.version>
<avro.version>1.7.7</avro.version>
<bonecp.version>0.8.0.RELEASE</bonecp.version>
<calcite.version>1.16.0.3.1.0.0-SNAPSHOT</calcite.version>
<calcite.version>1.16.0.3.1.0.0-78</calcite.version>
<datanucleus-api-jdo.version>4.2.4</datanucleus-api-jdo.version>
<datanucleus-core.version>4.1.17</datanucleus-core.version>
<datanucleus-rdbms.version>4.1.19</datanucleus-rdbms.version>
Expand All @@ -145,15 +145,15 @@
<derby.version>10.14.1.0</derby.version>
<dropwizard.version>3.1.0</dropwizard.version>
<dropwizard-metrics-hadoop-metrics2-reporter.version>0.1.2</dropwizard-metrics-hadoop-metrics2-reporter.version>
<druid.version>0.12.1.3.1.0.0-SNAPSHOT</druid.version>
<druid.version>0.12.1.3.1.0.0-78</druid.version>
<flatbuffers.version>1.2.0-3f79e055</flatbuffers.version>
<guava.version>19.0</guava.version>
<groovy.version>2.4.11</groovy.version>
<h2database.version>1.3.166</h2database.version>
<hadoop.version>3.1.1.3.1.0.0-78</hadoop.version>
<hadoop.bin.path>${basedir}/${hive.path.to.root}/testutils/hadoop</hadoop.bin.path>
<hamcrest.version>1.3</hamcrest.version>
<hbase.version>2.0.2.3.1.0.0-SNAPSHOT</hbase.version>
<hbase.version>2.0.2.3.1.0.0-78</hbase.version>
<hppc.version>0.7.2</hppc.version>
<!-- required for logging test to avoid including hbase which pulls disruptor transitively -->
<disruptor.version>3.3.7</disruptor.version>
Expand Down Expand Up @@ -186,21 +186,21 @@
<libthrift.version>0.9.3</libthrift.version>
<log4j2.version>2.10.0</log4j2.version>
<opencsv.version>2.3</opencsv.version>
<orc.version>1.5.1.3.1.0.0-SNAPSHOT</orc.version>
<orc.version>1.5.1.3.1.0.0-78</orc.version>
<mockito-all.version>1.10.19</mockito-all.version>
<powermock.version>1.7.4</powermock.version>
<mina.version>2.0.0-M5</mina.version>
<netty.version>4.1.17.Final</netty.version>
<netty3.version>3.10.5.Final</netty3.version>
<parquet.version>1.10.0</parquet.version>
<pig.version>0.16.0.3.1.0.0-SNAPSHOT</pig.version>
<pig.version>0.16.0.3.1.0.0-78</pig.version>
<plexus.version>1.5.6</plexus.version>
<protobuf.version>2.5.0</protobuf.version>
<stax.version>1.0.1</stax.version>
<slf4j.version>1.7.10</slf4j.version>
<ST4.version>4.0.4</ST4.version>
<storage-api.version>2.6.1-SNAPSHOT</storage-api.version>
<tez.version>0.9.1.3.1.0.0-SNAPSHOT</tez.version>
<storage-api.version>2.3.0.3.1.0.0-78</storage-api.version>
<tez.version>0.9.1.3.1.0.0-78</tez.version>
<super-csv.version>2.2.0</super-csv.version>
<spark.version>2.3.0</spark.version>
<scala.binary.version>2.11</scala.binary.version>
Expand All @@ -210,7 +210,7 @@
<wadl-resourcedoc-doclet.version>1.4</wadl-resourcedoc-doclet.version>
<velocity.version>1.5</velocity.version>
<xerces.version>2.9.1</xerces.version>
<zookeeper.version>3.4.6.3.1.0.0-SNAPSHOT</zookeeper.version>
<zookeeper.version>3.4.6.3.1.0.0-78</zookeeper.version>
<jpam.version>1.1</jpam.version>
<felix.version>2.4.0</felix.version>
<curator.version>2.12.0</curator.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ public void testDateFormatStr() throws HiveException {
runAndVerifyStr("2015-04-09 10:30", fmtText, "Thursday", udf);
runAndVerifyStr("2015-04-10 10:30:45.123", fmtText, "Friday", udf);
runAndVerifyStr("2015-04-11T10:30:45", fmtText, "Saturday", udf);
runAndVerifyStr("2015-04-11T01:30:45Z", fmtText, "Saturday", udf);
runAndVerifyStr("2015-04-11T01:30:45+00:00", fmtText, "Saturday", udf);
runAndVerifyStr("2015-04-11T01:30:45-06:00", fmtText, "Saturday", udf);
runAndVerifyStr("2015-04-12 10", fmtText, "Sunday", udf);
}

Expand Down
2 changes: 1 addition & 1 deletion standalone-metastore/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<orc.version>1.5.1</orc.version>
<protobuf.version>2.5.0</protobuf.version>
<sqlline.version>1.3.0</sqlline.version>
<storage-api.version>2.6.1-SNAPSHOT</storage-api.version>
<storage-api.version>2.3.0.3.1.2.0-4</storage-api.version>

<!-- Thrift properties -->
<thrift.home>you-must-set-this-to-run-thrift</thrift.home>
Expand Down