Skip to content

Commit

Permalink
PARQUET-2344: Bump to Thrift 0.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Fokko committed Nov 13, 2023
1 parent 0a066d8 commit ccd3f94
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ Parquet-MR uses Maven to build and depends on the thrift compiler (protoc is now
To build and install the thrift compiler, run:

```
wget -nv http://archive.apache.org/dist/thrift/0.16.0/thrift-0.16.0.tar.gz
tar xzf thrift-0.16.0.tar.gz
cd thrift-0.16.0
wget -nv http://archive.apache.org/dist/thrift/0.19.0/thrift-0.19.0.tar.gz
tar xzf thrift-0.19.0.tar.gz
cd thrift-0.19.0
chmod +x ./configure
./configure --disable-libs
sudo make install
```

If you're on OSX and use homebrew, you can instead install Thrift 0.16.0 with `brew` and ensure that it comes first in your `PATH`.
If you're on OSX and use homebrew, you can instead install Thrift 0.19.0 with `brew` and ensure that it comes first in your `PATH`.

```
brew install thrift
Expand Down
2 changes: 1 addition & 1 deletion dev/ci-before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# This script gets invoked by the CI system in a "before install" step
################################################################################

export THRIFT_VERSION=0.16.0
export THRIFT_VERSION=0.19.0

set -e
date
Expand Down
5 changes: 5 additions & 0 deletions parquet-format-structures/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@
<artifactId>libthrift</artifactId>
<version>${format.thrift.version}</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>${javax.annotation.version}</version>
</dependency>
</dependencies>

<profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package org.apache.parquet.format;

import java.nio.ByteBuffer;
import java.util.UUID;

import org.apache.thrift.TException;
import org.apache.thrift.protocol.TField;
Expand Down Expand Up @@ -47,183 +48,238 @@ public TTransport getTransport() {
return delegate.getTransport();
}

@Override
public void writeMessageBegin(TMessage message) throws TException {
delegate.writeMessageBegin(message);
}

@Override
public void writeMessageEnd() throws TException {
delegate.writeMessageEnd();
}

@Override
public int hashCode() {
return delegate.hashCode();
}

@Override
public void writeStructBegin(TStruct struct) throws TException {
delegate.writeStructBegin(struct);
}

@Override
public void writeStructEnd() throws TException {
delegate.writeStructEnd();
}

@Override
public void writeFieldBegin(TField field) throws TException {
delegate.writeFieldBegin(field);
}

@Override
public void writeFieldEnd() throws TException {
delegate.writeFieldEnd();
}

@Override
public void writeFieldStop() throws TException {
delegate.writeFieldStop();
}

@Override
public void writeMapBegin(TMap map) throws TException {
delegate.writeMapBegin(map);
}

@Override
public void writeMapEnd() throws TException {
delegate.writeMapEnd();
}

@Override
public void writeListBegin(TList list) throws TException {
delegate.writeListBegin(list);
}

@Override
public void writeListEnd() throws TException {
delegate.writeListEnd();
}

@Override
public void writeSetBegin(TSet set) throws TException {
delegate.writeSetBegin(set);
}

@Override
public void writeSetEnd() throws TException {
delegate.writeSetEnd();
}

@Override
public void writeBool(boolean b) throws TException {
delegate.writeBool(b);
}

@Override
public void writeByte(byte b) throws TException {
delegate.writeByte(b);
}

@Override
public void writeI16(short i16) throws TException {
delegate.writeI16(i16);
}

@Override
public void writeI32(int i32) throws TException {
delegate.writeI32(i32);
}

@Override
public void writeI64(long i64) throws TException {
delegate.writeI64(i64);
}

@Override
public void writeUuid(UUID uuid) throws TException {
delegate.writeUuid(uuid);
}

@Override
public void writeDouble(double dub) throws TException {
delegate.writeDouble(dub);
}

@Override
public void writeString(String str) throws TException {
delegate.writeString(str);
}

@Override
public void writeBinary(ByteBuffer buf) throws TException {
delegate.writeBinary(buf);
}

@Override
public TMessage readMessageBegin() throws TException {
return delegate.readMessageBegin();
}

@Override
public void readMessageEnd() throws TException {
delegate.readMessageEnd();
}

@Override
public TStruct readStructBegin() throws TException {
return delegate.readStructBegin();
}

@Override
public void readStructEnd() throws TException {
delegate.readStructEnd();
}

@Override
public TField readFieldBegin() throws TException {
return delegate.readFieldBegin();
}

@Override
public void readFieldEnd() throws TException {
delegate.readFieldEnd();
}

@Override
public TMap readMapBegin() throws TException {
return delegate.readMapBegin();
}

@Override
public void readMapEnd() throws TException {
delegate.readMapEnd();
}

@Override
public TList readListBegin() throws TException {
return delegate.readListBegin();
}

@Override
public void readListEnd() throws TException {
delegate.readListEnd();
}

@Override
public TSet readSetBegin() throws TException {
return delegate.readSetBegin();
}

@Override
public void readSetEnd() throws TException {
delegate.readSetEnd();
}

@Override
public boolean equals(Object obj) {
return delegate.equals(obj);
}

@Override
public boolean readBool() throws TException {
return delegate.readBool();
}

@Override
public byte readByte() throws TException {
return delegate.readByte();
}

@Override
public short readI16() throws TException {
return delegate.readI16();
}

@Override
public int readI32() throws TException {
return delegate.readI32();
}

@Override
public long readI64() throws TException {
return delegate.readI64();
}

@Override
public UUID readUuid() throws TException {
return delegate.readUuid();
}

@Override
public double readDouble() throws TException {
return delegate.readDouble();
}

@Override
public String readString() throws TException {
// this is where we intern the strings
return delegate.readString().intern();
}

@Override
public ByteBuffer readBinary() throws TException {
return delegate.readBinary();
}

@Override
public void reset() {
delegate.reset();
}

@Override
public String toString() {
return delegate.toString();
}
Expand Down
5 changes: 5 additions & 0 deletions parquet-thrift/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@
<version>2.12.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>${javax.annotation.version}</version>
</dependency>
<dependency> <!-- for pig runtime in tests -->
<groupId>org.antlr</groupId>
<artifactId>antlr-runtime</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

import org.apache.thrift.TException;
import org.apache.thrift.protocol.TField;
Expand Down Expand Up @@ -623,6 +624,10 @@ public void writeI32(int i) throws TException {
public void writeI64(long l) throws TException {
}

@Override
public void writeUuid(UUID uuid) throws TException {
}

@Override
public void writeDouble(double v) throws TException {
}
Expand Down Expand Up @@ -714,6 +719,11 @@ public long readI64() throws TException {
return 0;
}

@Override
public UUID readUuid() throws TException {
return null;
}

@Override
public double readDouble() throws TException {
return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.lang.reflect.Method;
import java.nio.ByteBuffer;
import java.util.UUID;

import org.apache.thrift.TException;
import org.apache.thrift.protocol.TField;
Expand Down Expand Up @@ -157,6 +158,11 @@ public void writeI64(long i64) throws TException {
throw exception();
}

@Override
public void writeUuid(UUID uuid) throws TException {
throw exception();
}

@Override
public void writeDouble(double dub) throws TException {
throw exception();
Expand Down Expand Up @@ -259,6 +265,11 @@ public long readI64() throws TException {
throw exception();
}

@Override
public UUID readUuid() throws TException {
throw exception();
}

@Override
public double readDouble() throws TException {
throw exception();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@ public enum ThriftTypeID {
LIST (TType.LIST, true, ListType.class),
ENUM (TType.ENUM, TType.I32, EnumType.class);

private static ThriftTypeID[] types = new ThriftTypeID[17];
private static final ThriftTypeID[] types;
static {
types = new ThriftTypeID[18];
for (ThriftTypeID t : ThriftTypeID.values()) {
types[t.thriftType] = t;
if (t.thriftType == -1) {
types[17] = t;
} else {
types[t.thriftType] = t;
}
}
}

Expand Down
Loading

0 comments on commit ccd3f94

Please sign in to comment.