Skip to content
Draft
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
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,23 @@ Parquet-Java uses Maven to build and depends on the thrift compiler (protoc is n
To build and install the thrift compiler, run:

```
wget -nv https://archive.apache.org/dist/thrift/0.22.0/thrift-0.22.0.tar.gz
tar xzf thrift-0.22.0.tar.gz
cd thrift-0.22.0
wget -nv https://archive.apache.org/dist/thrift/0.23.0/thrift-0.23.0.tar.gz
tar xzf thrift-0.23.0.tar.gz
cd thrift-0.23.0
chmod +x ./configure
./configure --disable-libs
sudo make install -j
```

If you're on OSX and use homebrew, you can instead install Thrift 0.22.0 with `brew` and ensure that it comes first in your `PATH`.
Note: if you wish to verify the signature and checksum of a release:
1. The GPG and sha checksums can be found under https://archive.apache.org/dist/thrift/0.23.0/
2. Validate the signature of the artifact against the [Thrift committer KEYS](https://downloads.apache.org/thrift/KEYS).

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

```
brew install thrift
export PATH="/usr/local/opt/thrift@0.22.0/bin:$PATH"
export PATH="/usr/local/opt/thrift@0.23.0/bin:$PATH"
```

### Build Parquet with Maven
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.22.0
export THRIFT_VERSION=0.23.0

set -e
set -o pipefail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ private void checkEnum(ThriftType expectedType, int i) {
class NullProtocol extends TProtocol {

public NullProtocol() {
super(null);
super(StubTTransport.INSTANCE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public abstract class ParquetProtocol extends TProtocol {
private String name;

ParquetProtocol() {
super(null);
super(StubTTransport.INSTANCE);
}

private String getClassInfo() {
Expand All @@ -54,7 +54,7 @@ private String getClassInfo() {
* @param name a meaningful debugging name for anonymous inner classes
*/
public ParquetProtocol(String name) {
super(null);
super(StubTTransport.INSTANCE);
this.name = name;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.parquet.thrift;

import org.apache.thrift.TConfiguration;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;

/**
* A stub transport which implements the minimum amount needed for range/depth
* validation within the thrift library to succeed.
*/
public final class StubTTransport extends TTransport {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this package private?


public static final StubTTransport INSTANCE = new StubTTransport();

/**
* There's no limits on recursion depth.
*/
private final TConfiguration conf = new TConfiguration(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can make this one static

TConfiguration.DEFAULT_MAX_FRAME_SIZE, TConfiguration.DEFAULT_MAX_MESSAGE_SIZE, Integer.MAX_VALUE);

private StubTTransport() {}

@Override
public void checkReadBytesAvailable(long l) {}

@Override
public boolean isOpen() {
return true;
}

@Override
public void open() throws TTransportException {
throw new TTransportException("unsupported");
}

@Override
public void close() {}

@Override
public int read(byte[] bytes, int i, int i1) throws TTransportException {
throw new TTransportException("unsupported");
}

@Override
public void write(byte[] bytes, int i, int i1) throws TTransportException {
throw new TTransportException("unsupported");
}

@Override
public TConfiguration getConfiguration() {
return conf;
}

@Override
public void updateKnownMessageSize(long l) {}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<thrift.executable>thrift</thrift.executable>
<format.thrift.executable>${thrift.executable}</format.thrift.executable>
<thrift-maven-plugin.version>0.10.0</thrift-maven-plugin.version>
<thrift.version>0.22.0</thrift.version>
<thrift.version>0.23.0</thrift.version>
<format.thrift.version>${thrift.version}</format.thrift.version>
<fastutil.version>8.5.18</fastutil.version>
<semver.api.version>0.9.33</semver.api.version>
Expand Down