Skip to content

Commit

Permalink
Merge branch 'main' into issue-10668
Browse files Browse the repository at this point in the history
  • Loading branch information
slessard committed Jul 29, 2024
2 parents f2737c3 + 30e761e commit 5308d39
Show file tree
Hide file tree
Showing 343 changed files with 18,372 additions and 7,251 deletions.
2 changes: 1 addition & 1 deletion .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ github:
- jun-he
- marton-bod
- samarthjain
- findepi
- SreeramGarlapati
- samredai
- gaborkaszab
- bitsondatadev
- ajantha-bhat
- jbonofre
ghp_branch: gh-pages
ghp_path: /

Expand Down
21 changes: 8 additions & 13 deletions .baseline/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@
</module>
<module name="ClassTypeParameterName"> <!-- Java Style Guide: Type variable names -->
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern" value="Class type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="CovariantEquals"/> <!-- Java Coding Guidelines: Override ``Object#equals`` consistently -->
<module name="DefaultComesLast"/> <!-- Java Style Guide: The default case is present -->
Expand Down Expand Up @@ -281,12 +280,13 @@
</module>
<module name="InnerAssignment"/> <!-- Java Coding Guidelines: Inner assignments: Not used -->
<module name="MemberName"> <!-- Java Style Guide: Non-constant field names -->
<property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
<message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
<property name="format" value="^[a-z][a-zA-Z0-9]++$"/>
</module>
<module name="ConstantName">
<property name="format" value="^[A-Z][A-Z0-9]*+(_[A-Z0-9]++)*+$"/>
</module>
<module name="MethodName"> <!-- Java Style Guide: Method names -->
<property name="format" value="^[a-z][a-zA-Z0-9_]+$"/>
<message key="name.invalidPattern" value="Method name ''{0}'' must match pattern ''{1}''."/>
<property name="format" value="^[a-z][a-zA-Z0-9_]++$"/>
</module>
<module name="MethodParamPad"/> <!-- Java Style Guide: Horizontal whitespace -->
<module name="MissingDeprecated"/> <!-- Java Coding Guide: Deprecate per annotation and Javadoc -->
Expand All @@ -304,8 +304,7 @@
<module name="PackageAnnotation"/> <!-- Java Style Guide: Package statement -->
<module name="PackageDeclaration"/> <!-- Java Style Guide: Package statement -->
<module name="PackageName"> <!-- Java Style Guide: Package names -->
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern" value="Package name ''{0}'' must match pattern ''{1}''."/>
<property name="format" value="^[a-z]++(\.[a-z][a-z0-9]*+)*+$"/>
</module>
<module name="ParameterAssignment"/> <!-- Java Coding Guidelines: Final variables and parameters -->
<module name="ParenPad"/> <!-- Java Style Guide: Horizontal whitespace -->
Expand Down Expand Up @@ -444,7 +443,6 @@
<message key="todo.match" value="There must be whitespace at the beginning of all comments."/>
</module>
<module name="TypeName"> <!-- Java Style Guide: Class names -->
<message key="name.invalidPattern" value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="TypecastParenPad"/> <!-- Java Style Guide: Horizontal whitespace -->
<module name="UnusedImports"> <!-- Java Style Guide: No unused imports -->
Expand Down Expand Up @@ -480,23 +478,20 @@
<module name="LocalFinalVariableName"/> <!-- Java Style Guide: Local variable names -->
<module name="LocalVariableName"> <!-- Java Style Guide: Local variable names -->
<property name="tokens" value="VARIABLE_DEF"/>
<property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
<property name="format" value="^[a-z][a-zA-Z0-9]++$"/>
<property name="allowOneCharVarInForLoop" value="true"/>
<message key="name.invalidPattern" value="Local variable name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="MethodLength"/> <!-- Java Coding Guide: Methods and functions: focused, crisp, concise -->
<module name="MethodTypeParameterName"> <!-- Java Style Guide: Type variable names -->
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
<message key="name.invalidPattern" value="Method type name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="NestedForDepth">
<property name="max" value="2"/>
</module>
<module name="NestedTryDepth"/> <!-- Java Coding Guide: Try/catch blocks: never nested -->
<module name="NonEmptyAtclauseDescription"/> <!-- Java Style Guide: At-clauses -->
<module name="ParameterName"> <!-- Java Style Guide: Parameter names -->
<property name="format" value="^[a-z][a-zA-Z0-9]+$"/>
<message key="name.invalidPattern" value="Parameter name ''{0}'' must match pattern ''{1}''."/>
<property name="format" value="^[a-z][a-zA-Z0-9]++$"/>
<property name="ignoreOverridden" value="true"/>
</module>

Expand Down
11 changes: 10 additions & 1 deletion .github/ISSUE_TEMPLATE/iceberg_bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ body:
description: What Apache Iceberg version are you using?
multiple: false
options:
- "1.5.2 (latest release)"
- "1.6.0 (latest release)"
- "1.5.2"
- "1.5.1"
- "1.5.0"
- "1.4.3"
Expand Down Expand Up @@ -76,3 +77,11 @@ body:
You can include files by dragging and dropping them here.
validations:
required: true
- type: checkboxes
attributes:
label: Willingness to contribute
description: The Apache Iceberg community encourages bug fix contributions. Would you or another member of your organization be willing to contribute a fix for this bug to the Apache Iceberg codebase?
options:
- label: I can contribute a fix for this bug independently
- label: I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- label: I cannot contribute a fix for this bug at this time
4 changes: 2 additions & 2 deletions .github/workflows/delta-conversion-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [8, 11, 17]
jvm: [8, 11, 17, 21]
env:
SPARK_LOCAL_IP: localhost
steps:
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [8, 11, 17]
jvm: [8, 11, 17, 21]
env:
SPARK_LOCAL_IP: localhost
steps:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/flink-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,15 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [8, 11, 17]
jvm: [8, 11, 17, 21]
flink: ['1.17', '1.18', '1.19']
exclude:
# Flink 1.17 does not support Java 17.
- jvm: 17
flink: '1.17'
# Flink 1.17 does not support Java 21.
- jvm: 21
flink: '1.17'
env:
SPARK_LOCAL_IP: localhost
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/hive-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [8, 11, 17]
jvm: [8, 11, 17, 21]
env:
SPARK_LOCAL_IP: localhost
steps:
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [8, 11, 17]
jvm: [8, 11, 17, 21]
env:
SPARK_LOCAL_IP: localhost
steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/java-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [8, 11, 17]
jvm: [8, 11, 17, 21]
env:
SPARK_LOCAL_IP: localhost
steps:
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [8, 11, 17]
jvm: [8, 11, 17, 21]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand All @@ -107,7 +107,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [8, 11, 17]
jvm: [8, 11, 17, 21]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/spark-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,16 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [8, 11, 17]
jvm: [8, 11, 17, 21]
spark: ['3.3', '3.4', '3.5']
scala: ['2.12', '2.13']
exclude:
# Spark 3.5 is the first version not failing on Java 21 (https://issues.apache.org/jira/browse/SPARK-42369)
# Full Java 21 support is coming in Spark 4 (https://issues.apache.org/jira/browse/SPARK-43831)
- jvm: 21
spark: '3.3'
- jvm: 21
spark: '3.4'
env:
SPARK_LOCAL_IP: localhost
steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ on:
permissions:
# All other permissions are set to none
issues: write
pull-requests: write

jobs:
stale:
Expand Down Expand Up @@ -54,4 +55,4 @@ jobs:
days-before-pr-stale: 30
days-before-pr-close: 7
ascending: true
operations-per-run: 100
operations-per-run: 200
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Community discussions happen primarily on the [dev mailing list][dev-list] or on

### Building

Iceberg is built using Gradle with Java 8, 11, or 17.
Iceberg is built using Gradle with Java 8, 11, 17, or 21.

* To invoke a build and run tests: `./gradlew build`
* To skip tests: `./gradlew build -x test -x integrationTest`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class TestOSSOutputStream extends AliyunOSSTestBase {
private final OSS ossMock = mock(OSS.class, delegatesTo(ossClient));

private final Path tmpDir = Files.createTempDirectory("oss-file-io-test-");
private static final Random random = ThreadLocalRandom.current();
private static final Random RANDOM = ThreadLocalRandom.current();

private final AliyunProperties props =
new AliyunProperties(
Expand Down Expand Up @@ -127,7 +127,7 @@ private byte[] data256() {

private byte[] randomData(int size) {
byte[] data = new byte[size];
random.nextBytes(data);
RANDOM.nextBytes(data);
return data;
}

Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/org/apache/iceberg/RewriteManifests.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public interface RewriteManifests extends SnapshotUpdate<RewriteManifests> {
* then all manifests will be rewritten.
*
* @param predicate Predicate used to determine which manifests to rewrite. If true then the
* manifest file will be included for rewrite. If false then then manifest is kept as-is.
* manifest file will be included for rewrite. If false then the manifest is kept as-is.
* @return this for method chaining
*/
RewriteManifests rewriteIf(Predicate<ManifestFile> predicate);
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/org/apache/iceberg/StatisticsFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* support is not required to read the table correctly.
*/
public interface StatisticsFile {
/** ID of the Iceberg table's snapshot the statistics were computed from. */
/** ID of the Iceberg table's snapshot the statistics file is associated with. */
long snapshotId();

/**
Expand Down
4 changes: 2 additions & 2 deletions api/src/main/java/org/apache/iceberg/Table.java
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ default AppendFiles newFastAppend() {
ReplacePartitions newReplacePartitions();

/**
* Create a new {@link DeleteFiles delete API} to replace files in this table and commit.
* Create a new {@link DeleteFiles delete API} to delete files in this table and commit.
*
* @return a new {@link DeleteFiles}
*/
Expand Down Expand Up @@ -299,7 +299,7 @@ default UpdatePartitionStatistics updatePartitionStatistics() {
}

/**
* Create a new {@link ExpireSnapshots expire API} to manage snapshots in this table and commit.
* Create a new {@link ExpireSnapshots expire API} to expire snapshots in this table and commit.
*
* @return a new {@link ExpireSnapshots}
*/
Expand Down
6 changes: 3 additions & 3 deletions api/src/main/java/org/apache/iceberg/events/Listeners.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@
public class Listeners {
private Listeners() {}

private static final Map<Class<?>, Queue<Listener<?>>> listeners = Maps.newConcurrentMap();
private static final Map<Class<?>, Queue<Listener<?>>> LISTENERS = Maps.newConcurrentMap();

public static <E> void register(Listener<E> listener, Class<E> eventType) {
Queue<Listener<?>> list =
listeners.computeIfAbsent(eventType, k -> new ConcurrentLinkedQueue<>());
LISTENERS.computeIfAbsent(eventType, k -> new ConcurrentLinkedQueue<>());
list.add(listener);
}

@SuppressWarnings("unchecked")
public static <E> void notifyAll(E event) {
Preconditions.checkNotNull(event, "Cannot notify listeners for a null event.");

Queue<Listener<?>> list = listeners.get(event.getClass());
Queue<Listener<?>> list = LISTENERS.get(event.getClass());
if (list != null) {
for (Listener<?> value : list) {
Listener<E> listener = (Listener<E>) value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.apache.iceberg.relocated.com.google.common.collect.Streams;

public class CharSequenceSet implements Set<CharSequence>, Serializable {
private static final ThreadLocal<CharSequenceWrapper> wrappers =
private static final ThreadLocal<CharSequenceWrapper> WRAPPERS =
ThreadLocal.withInitial(() -> CharSequenceWrapper.wrap(null));

public static CharSequenceSet of(Iterable<CharSequence> charSequences) {
Expand Down Expand Up @@ -61,7 +61,7 @@ public boolean isEmpty() {
@Override
public boolean contains(Object obj) {
if (obj instanceof CharSequence) {
CharSequenceWrapper wrapper = wrappers.get();
CharSequenceWrapper wrapper = WRAPPERS.get();
boolean result = wrapperSet.contains(wrapper.set((CharSequence) obj));
wrapper.set(null); // don't hold a reference to the value
return result;
Expand Down Expand Up @@ -109,7 +109,7 @@ public boolean add(CharSequence charSequence) {
@Override
public boolean remove(Object obj) {
if (obj instanceof CharSequence) {
CharSequenceWrapper wrapper = wrappers.get();
CharSequenceWrapper wrapper = WRAPPERS.get();
boolean result = wrapperSet.remove(wrapper.set((CharSequence) obj));
wrapper.set(null); // don't hold a reference to the value
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
import org.junit.jupiter.api.Test;

public class TestAggregateBinding {
private static final List<UnboundAggregate<Integer>> list =
private static final List<UnboundAggregate<Integer>> LIST =
ImmutableList.of(Expressions.count("x"), Expressions.max("x"), Expressions.min("x"));
private static final StructType struct =
private static final StructType STRUCT =
StructType.of(Types.NestedField.required(10, "x", Types.IntegerType.get()));

@Test
public void testAggregateBinding() {
for (UnboundAggregate<Integer> unbound : list) {
Expression expr = unbound.bind(struct, true);
for (UnboundAggregate<Integer> unbound : LIST) {
Expression expr = unbound.bind(STRUCT, true);
BoundAggregate<Integer, ?> bound = assertAndUnwrapAggregate(expr);
assertThat(bound.ref().fieldId()).as("Should reference correct field ID").isEqualTo(10);
assertThat(bound.op())
Expand All @@ -60,15 +60,15 @@ public void testCountStarBinding() {
@Test
public void testBoundAggregateFails() {
Expression unbound = Expressions.count("x");
assertThatThrownBy(() -> Binder.bind(struct, Binder.bind(struct, unbound)))
assertThatThrownBy(() -> Binder.bind(STRUCT, Binder.bind(STRUCT, unbound)))
.isInstanceOf(IllegalStateException.class)
.hasMessageContaining("Found already bound aggregate");
}

@Test
public void testCaseInsensitiveReference() {
Expression expr = Expressions.max("X");
Expression boundExpr = Binder.bind(struct, expr, false);
Expression boundExpr = Binder.bind(STRUCT, expr, false);
BoundAggregate<Integer, Integer> bound = assertAndUnwrapAggregate(boundExpr);
assertThat(bound.ref().fieldId()).as("Should reference correct field ID").isEqualTo(10);
assertThat(bound.op())
Expand All @@ -79,15 +79,15 @@ public void testCaseInsensitiveReference() {
@Test
public void testCaseSensitiveReference() {
Expression expr = Expressions.max("X");
assertThatThrownBy(() -> Binder.bind(struct, expr, true))
assertThatThrownBy(() -> Binder.bind(STRUCT, expr, true))
.isInstanceOf(ValidationException.class)
.hasMessageContaining("Cannot find field 'X' in struct");
}

@Test
public void testMissingField() {
UnboundAggregate<?> unbound = Expressions.count("missing");
assertThatThrownBy(() -> unbound.bind(struct, false))
assertThatThrownBy(() -> unbound.bind(STRUCT, false))
.isInstanceOf(ValidationException.class)
.hasMessageContaining("Cannot find field 'missing' in struct:");
}
Expand Down
Loading

0 comments on commit 5308d39

Please sign in to comment.