Skip to content

Commit

Permalink
Make project compilable against jdk8
Browse files Browse the repository at this point in the history
  • Loading branch information
daragu committed Jul 5, 2024
1 parent c1e97aa commit 2eff5d4
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 30 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/mvn-ci-jdk1.8-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#
# 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.
#
name: Maven CI Build

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !contains(github.ref, 'main') }}

on:
push:
branches:
- "main"

pull_request:
branches:
- "main"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: maven

- name: Build all module with Maven
run: mvn clean install -ntp -B
File renamed without changes.
18 changes: 3 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
</modules>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<java.version>8</java.version>
<avro.version>1.11.3</avro.version>
<log4j.version>2.22.0</log4j.version>
Expand All @@ -56,7 +58,7 @@
<iceberg.version>1.4.2</iceberg.version>
<delta.version>2.4.0</delta.version>
<jackson.version>2.17.1</jackson.version>
<spotless.version>2.43.0</spotless.version>
<spotless.version>2.27.2</spotless.version>
<apache.rat.version>0.16.1</apache.rat.version>
<google.java.format.version>1.8</google.java.format.version>
<delta.standalone.version>0.5.0</delta.standalone.version>
Expand Down Expand Up @@ -564,9 +566,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>${java.version}</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -662,11 +661,6 @@
<version>${spotless.version}</version>
<configuration>
<java>
<googleJavaFormat>
<version>${google.java.format.version}</version>
<style>GOOGLE</style>
<groupArtifact>com.google.googlejavaformat:google-java-format</groupArtifact>
</googleJavaFormat>
<importOrder>
<order>java,javax,lombok,org,org.apache.hudi,org.apache.iceberg,org.apache.spark.sql.delta,scala,com,io.delta,org.apache.xtable</order>
</importOrder>
Expand Down Expand Up @@ -719,7 +713,6 @@
<licenseHeader>
<file>style/text-license-header</file>
<delimiter>(^[a-zA-Z0-9_-]|^#[a-zA-Z0-9_-]|^##.+?$)</delimiter>
<skipLinesMatching>^#!.+?$</skipLinesMatching>
</licenseHeader>
</shell>
<pom>
Expand All @@ -733,11 +726,6 @@
<exclude>website/build/**</exclude>
<exclude>website/.docusaurus/**</exclude>
</excludes>
<licenseHeader>
<file>style/xml-license-header</file>
<delimiter>^&lt;project|^&lt;configuration|^&lt;Configuration|^&lt;extensions|^&lt;component</delimiter>
<skipLinesMatching>^&lt;.*xml.+?$</skipLinesMatching>
</licenseHeader>
</pom>
<formats>
<format>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.function.Function;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import lombok.AllArgsConstructor;
import lombok.NonNull;
Expand Down Expand Up @@ -236,21 +237,24 @@ private WriteStatus toWriteStatus(

private Map<String, HoodieColumnRangeMetadata<Comparable>> convertColStats(
String fileName, List<ColumnStat> columnStatMap) {
return columnStatMap.stream()
.filter(
entry ->
!InternalType.NON_SCALAR_TYPES.contains(entry.getField().getSchema().getDataType()))
.map(
columnStat ->
HoodieColumnRangeMetadata.<Comparable>create(
fileName,
convertFromXTablePath(columnStat.getField().getPath()),
(Comparable) columnStat.getRange().getMinValue(),
(Comparable) columnStat.getRange().getMaxValue(),
columnStat.getNumNulls(),
columnStat.getNumValues(),
columnStat.getTotalSize(),
-1L))

Stream<HoodieColumnRangeMetadata<Comparable>> metadataStream = columnStatMap.stream()
.filter(
entry ->
!InternalType.NON_SCALAR_TYPES.contains(entry.getField().getSchema().getDataType()))
.map(
columnStat ->
HoodieColumnRangeMetadata.<Comparable>create(
fileName,
convertFromXTablePath(columnStat.getField().getPath()),
(Comparable) columnStat.getRange().getMinValue(),
(Comparable) columnStat.getRange().getMaxValue(),
columnStat.getNumNulls(),
columnStat.getNumValues(),
columnStat.getTotalSize(),
-1L));

return metadataStream
.collect(Collectors.toMap(HoodieColumnRangeMetadata::getColumnName, Function.identity()));
}

Expand Down

0 comments on commit 2eff5d4

Please # to comment.