github.com/apache/beam/sdks/v2@v2.48.2/java/io/parquet/build.gradle (about) 1 import java.util.stream.Collectors 2 3 /* 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * License); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, software 15 * distributed under the License is distributed on an AS IS BASIS, 16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 * See the License for the specific language governing permissions and 18 * limitations under the License. 19 */ 20 21 plugins { id 'org.apache.beam.module' } 22 applyJavaNature( 23 automaticModuleName: 'org.apache.beam.sdk.io.parquet', 24 ) 25 26 description = "Apache Beam :: SDKs :: Java :: IO :: Parquet" 27 ext.summary = "IO to read and write on Parquet storage format." 28 29 def hadoopVersions = [ 30 "285": "2.8.5", 31 "292": "2.9.2", 32 "2102": "2.10.2", 33 "324": "3.2.4", 34 ] 35 36 hadoopVersions.each {kv -> configurations.create("hadoopVersion$kv.key")} 37 38 def parquet_version = "1.12.0" 39 40 dependencies { 41 implementation library.java.vendored_guava_26_0_jre 42 implementation project(path: ":sdks:java:core", configuration: "shadow") 43 implementation project(":sdks:java:extensions:avro") 44 implementation project(":sdks:java:io:hadoop-common") 45 implementation library.java.slf4j_api 46 implementation "org.apache.parquet:parquet-avro:$parquet_version" 47 implementation "org.apache.parquet:parquet-column:$parquet_version" 48 implementation "org.apache.parquet:parquet-common:$parquet_version" 49 implementation "org.apache.parquet:parquet-hadoop:$parquet_version" 50 implementation library.java.avro 51 provided library.java.hadoop_client 52 permitUnusedDeclared library.java.hadoop_client 53 provided library.java.hadoop_common 54 testImplementation library.java.hadoop_client 55 testImplementation project(path: ":sdks:java:core", configuration: "shadowTest") 56 testImplementation project(path: ":sdks:java:extensions:avro") 57 testImplementation library.java.junit 58 testRuntimeOnly library.java.slf4j_jdk14 59 testRuntimeOnly project(path: ":runners:direct-java", configuration: "shadow") 60 hadoopVersions.each {kv -> 61 "hadoopVersion$kv.key" "org.apache.hadoop:hadoop-client:$kv.value" 62 } 63 } 64 65 hadoopVersions.each {kv -> 66 configurations."hadoopVersion$kv.key" { 67 resolutionStrategy { 68 force "org.apache.hadoop:hadoop-client:$kv.value" 69 } 70 } 71 } 72 73 task hadoopVersionsTest(group: "Verification") { 74 description = "Runs Parquet tests with different Hadoop versions" 75 def taskNames = hadoopVersions.keySet().stream() 76 .map{num -> "hadoopVersion${num}Test"} 77 .collect(Collectors.toList()) 78 dependsOn taskNames 79 } 80 81 hadoopVersions.each { kv -> 82 task "hadoopVersion${kv.key}Test"(type: Test, group: "Verification") { 83 description = "Runs Parquet tests with Hadoop version $kv.value" 84 classpath = configurations."hadoopVersion$kv.key" + sourceSets.test.runtimeClasspath 85 include '**/*Test.class' 86 } 87 }