Skip to content
Merged
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 @@ -42,7 +42,6 @@
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.SystemUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.BlockLocation;
import org.apache.hadoop.fs.FileStatus;
Expand Down
8 changes: 8 additions & 0 deletions parquet-thrift/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,14 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<!-- Needed to compile PathGlobPattern on Hadoop 3.
If that deprecated class is removed, so can this dependency -->
<groupId>com.google.re2j</groupId>
<artifactId>re2j</artifactId>
<version>1.1</version>
<scope>provided</scope>
</dependency>
</dependencies>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*
/*
* 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
Expand All @@ -20,8 +20,8 @@

import org.apache.hadoop.fs.GlobPattern;

import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import com.google.re2j.Pattern;
Copy link
Member

@sunchao sunchao Jun 18, 2022

Choose a reason for hiding this comment

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

I think this may not work for projects like Spark who are using Hadoop shaded client, since the GlobPattern.compiled is relocated to org.apache.hadoop.shaded.com.google.re2j.Pattern.

It might be easier to just remove the class as it has been marked as deprecated since Parquet 1.8.0, 2015. It is also not used anywhere in the project.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1 for cutting. i will update the patch

import com.google.re2j.PatternSyntaxException;

/**
* Enhanced version of GlobPattern class that is defined in hadoop with extra capability of matching
Expand Down Expand Up @@ -56,7 +56,7 @@ public static Pattern compile(String globPattern) {
}

private static void error(String message, String pattern, int pos) {
throw new PatternSyntaxException(message, pattern, pos);
throw new PatternSyntaxException(String.format("%1s at %2d", message, pos), pattern);
}

/**
Expand Down
4 changes: 3 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<jackson-databind.version>2.13.2.2</jackson-databind.version>
<japicmp.version>0.14.2</japicmp.version>
<shade.prefix>shaded.parquet</shade.prefix>
<hadoop.version>2.10.1</hadoop.version>
<hadoop.version>3.2.0</hadoop.version>
Copy link
Member

Choose a reason for hiding this comment

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

hmm why 3.2.0, not 3.3.1/3.3.2?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for the question

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was being unambitious. move to this, the oldest 3.x release working on java11 ensures that anything else on a version >= to this should link properly.

if you do want to be more current, well, spark is on 3.3.3, hive is trying to move to 3.3.x and I will be doing a 3.3.4 release in a week's time, which is just some security changes mostly of relevance to servers

<parquet.format.version>2.9.0</parquet.format.version>
<previous.version>1.12.0</previous.version>
<thrift.executable>thrift</thrift.executable>
Expand Down Expand Up @@ -519,6 +519,8 @@
change to fix a integer overflow issue.
TODO: remove this after Parquet 1.13 release -->
<exclude>org.apache.parquet.column.values.dictionary.DictionaryValuesWriter#dictionaryByteSize</exclude>
<!-- In PARQUET-2158 the return type of PathGlobPattern was changed to be compatible with Hadoop 3 -->
<exclude>org.apache.parquet.thrift.projection.deprecated.PathGlobPattern</exclude>
</excludes>
</parameter>
</configuration>
Expand Down