From a679e4ef3b9f9ea450672e68d864c6f4e133ce6d Mon Sep 17 00:00:00 2001 From: bzg1107 Date: Mon, 2 Aug 2021 17:59:28 +0800 Subject: [PATCH] use antrun plugin and update thrift to 0.14.0 --- .github/workflows/test.yml | 4 +-- .gitignore | 1 + pom.xml | 35 +++++++++++-------- .../parquet/format/InterningProtocol.java | 5 +++ .../java/org/apache/parquet/format/Util.java | 5 +-- 5 files changed, 31 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a93eee5..deddca4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,8 +40,8 @@ jobs: sudo apt-get update -qq sudo apt-get install -qq protobuf-compiler sudo apt-get install -qq libboost-dev libboost-test-dev libboost-program-options-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev - wget -qO- https://archive.apache.org/dist/thrift/0.13.0/thrift-0.13.0.tar.gz | tar zxf - - cd thrift-0.13.0/ + wget -qO- https://archive.apache.org/dist/thrift/0.14.0/thrift-0.14.0.tar.gz | tar zxf - + cd thrift-0.14.0/ chmod +x ./configure ./configure --disable-libs sudo make install diff --git a/.gitignore b/.gitignore index 944e4a2..6eed724 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ dependency-reduced-pom.xml # IDE stuff .idea/ +*.iml diff --git a/pom.xml b/pom.xml index aeec130..ed80eaf 100644 --- a/pom.xml +++ b/pom.xml @@ -86,7 +86,7 @@ 1.8 shaded.parquet thrift - 0.13.0 + 0.14.0 0.10.0 @@ -94,19 +94,29 @@ - org.apache.thrift - thrift-maven-plugin - ${thrift-maven-plugin.version} - - src/main/thrift - ${thrift.executable} - + org.apache.maven.plugins + maven-antrun-plugin + 1.7 - thrift-sources generate-sources + + + + + + + + + + + + + + + - compile + run @@ -187,11 +197,6 @@ libthrift ${thrift.version} - - javax.annotation - javax.annotation-api - 1.3.2 - junit junit diff --git a/src/main/java/org/apache/parquet/format/InterningProtocol.java b/src/main/java/org/apache/parquet/format/InterningProtocol.java index 843a02c..90a1170 100644 --- a/src/main/java/org/apache/parquet/format/InterningProtocol.java +++ b/src/main/java/org/apache/parquet/format/InterningProtocol.java @@ -224,6 +224,11 @@ public class InterningProtocol extends TProtocol { return delegate.readBinary(); } + @Override + public int getMinSerializedSize(byte b) throws TException { + return delegate.getMinSerializedSize(b); + } + public void reset() { delegate.reset(); } diff --git a/src/main/java/org/apache/parquet/format/Util.java b/src/main/java/org/apache/parquet/format/Util.java index 0532bce..0c831b6 100644 --- a/src/main/java/org/apache/parquet/format/Util.java +++ b/src/main/java/org/apache/parquet/format/Util.java @@ -47,6 +47,7 @@ import org.apache.parquet.format.event.EventBasedThriftReader; import org.apache.parquet.format.event.TypedConsumer.I32Consumer; import org.apache.parquet.format.event.TypedConsumer.I64Consumer; import org.apache.parquet.format.event.TypedConsumer.StringConsumer; +import org.apache.thrift.transport.TTransportException; /** * Utility to read/write metadata @@ -207,11 +208,11 @@ public class Util { } } - private static TProtocol protocol(OutputStream to) { + private static TProtocol protocol(OutputStream to) throws TTransportException { return protocol(new TIOStreamTransport(to)); } - private static TProtocol protocol(InputStream from) { + private static TProtocol protocol(InputStream from) throws TTransportException { return protocol(new TIOStreamTransport(from)); } -- 2.30.0