Enable CI and fix enforce rules (#3)

* fix enforce rules

* add build and check

* fix error prone

* disable error prone check
This commit is contained in:
Jia-Xuan Liu
2022-05-16 17:11:13 +08:00
committed by GitHub
parent 9f5a544627
commit 1ad3156e15
7 changed files with 40 additions and 62 deletions
-5
View File
@@ -64,11 +64,6 @@
<artifactId>google-cloud-bigquery</artifactId>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-core</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
@@ -19,13 +19,6 @@ import io.netty.buffer.ByteBuf;
import javax.annotation.Nonnull;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.time.format.ResolverStyle;
import java.util.Locale;
import static java.time.format.DateTimeFormatter.ISO_LOCAL_DATE;
public class DateType
extends PGType
{
@@ -36,16 +29,6 @@ public class DateType
private static final int TYPE_LEN = 4;
private static final int TYPE_MOD = -1;
private static final DateTimeFormatter ISO_FORMATTER = new DateTimeFormatterBuilder()
.parseCaseInsensitive()
.append(ISO_LOCAL_DATE)
.toFormatter(Locale.ENGLISH).withResolverStyle(ResolverStyle.STRICT);
private static final DateTimeFormatter ISO_FORMATTER_AD = new DateTimeFormatterBuilder()
.parseCaseInsensitive()
.appendPattern("yyyy-MM-dd")
.toFormatter(Locale.ENGLISH).withResolverStyle(ResolverStyle.STRICT);
private DateType()
{
super(OID, TYPE_LEN, TYPE_MOD, NAME);
@@ -52,7 +52,6 @@ public final class PGTypes
private PGTypes() {}
private static final Map<Integer, PGType<?>> TYPE_TABLE = new HashMap<>();
private static final Map<Integer, PGArray> INNER_OID_TO_PGARRAY;
private static final Set<PGType<?>> TYPES;
static {
@@ -89,7 +88,6 @@ public final class PGTypes
TYPE_TABLE.put(array.oid(), array);
innerToPgTypeBuilder.put(innerType.oid(), array);
});
INNER_OID_TO_PGARRAY = innerToPgTypeBuilder.build();
TYPES = new HashSet<>(TYPE_TABLE.values());
// the following polymorphic types are added manually,
@@ -19,15 +19,6 @@ import io.netty.buffer.ByteBuf;
import javax.annotation.Nonnull;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.time.format.ResolverStyle;
import java.util.Locale;
import static java.time.format.DateTimeFormatter.ISO_LOCAL_DATE;
import static java.time.format.DateTimeFormatter.ISO_LOCAL_TIME;
import static java.util.Locale.ENGLISH;
public class TimestampType
extends BaseTimestampType
{
@@ -36,24 +27,6 @@ public class TimestampType
private static final int OID = 1114;
private static final String NAME = "timestamp";
private static final DateTimeFormatter PG_TIMESTAMP = new DateTimeFormatterBuilder()
.parseCaseInsensitive()
.appendPattern("yyyy-MM-dd HH:mm:ss.SSS")
.toFormatter(ENGLISH).withResolverStyle(ResolverStyle.STRICT);
private static final DateTimeFormatter PARSER_WITH_OPTIONAL_ERA = new DateTimeFormatterBuilder()
.parseCaseInsensitive()
.append(ISO_LOCAL_DATE)
.optionalStart()
.appendLiteral(' ')
.append(ISO_LOCAL_TIME)
.optionalStart()
.appendPattern("[VV][x][xx][xxx]")
.optionalStart()
.appendLiteral(' ')
.appendPattern("G")
.toFormatter(Locale.ENGLISH).withResolverStyle(ResolverStyle.STRICT);
private TimestampType()
{
super(OID, TYPE_LEN, TYPE_MOD, NAME);
@@ -16,14 +16,9 @@ package io.cml.type;
import io.cml.spi.type.PGType;
import io.netty.buffer.ByteBuf;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import javax.annotation.Nonnull;
import java.time.format.DateTimeFormatterBuilder;
import java.util.Locale;
public class TimestampWithTimeZoneType
extends BaseTimestampType
{
@@ -31,12 +26,6 @@ public class TimestampWithTimeZoneType
private static final int OID = 1184;
private static final String NAME = "timestamptz";
private static final java.time.format.DateTimeFormatter ISO_OFFSET_DATE_TIME = new DateTimeFormatterBuilder()
.appendPattern("yyyy-MM-dd HH:mm:ss.SSSx").toFormatter();
// For Golang if date is AD (after Christ), era abbreviation is not parsed.
private static final DateTimeFormatter ISO_FORMATTER =
DateTimeFormat.forPattern("YYYY-MM-dd HH:mm:ss.SSS+00").withZoneUTC().withLocale(Locale.ENGLISH);
private TimestampWithTimeZoneType()
{
+34
View File
@@ -17,6 +17,32 @@
</properties>
<dependencies>
<dependency>
<groupId>io.airlift</groupId>
<artifactId>configuration</artifactId>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>gax</artifactId>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-credentials</artifactId>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-oauth2-http</artifactId>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-bigquery</artifactId>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-core</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
@@ -33,5 +59,13 @@
<groupId>io.cml</groupId>
<artifactId>cml-postgres-wire-protocol</artifactId>
</dependency>
<dependency>
<groupId>io.cml</groupId>
<artifactId>cml-spi</artifactId>
</dependency>
<dependency>
<groupId>io.cml</groupId>
<artifactId>trino-parser</artifactId>
</dependency>
</dependencies>
</project>
+6
View File
@@ -1201,6 +1201,12 @@
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.threeten</groupId>
<artifactId>threetenbp</artifactId>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>org.xerial.snappy</groupId>
<artifactId>snappy-java</artifactId>