rdblue commented on a change in pull request #3256:
URL: https://github.com/apache/iceberg/pull/3256#discussion_r730068789



##########
File path: spark/build.gradle
##########
@@ -0,0 +1,97 @@
+/*
+ * 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.
+ */
+
+project(':iceberg-spark') {
+  configurations.all {
+    resolutionStrategy {
+      // Spark 2.4.4 can only use the below datanucleus version, the versions 
introduced
+      // by Hive 2.3.6 will meet lots of unexpected issues, so here force to 
use the versions
+      // introduced by Hive 1.2.1.
+      force 'org.datanucleus:datanucleus-api-jdo:3.2.6'
+      force 'org.datanucleus:datanucleus-core:3.2.10'
+      force 'org.datanucleus:datanucleus-rdbms:3.2.9'
+    }
+  }
+
+  dependencies {
+    implementation project(path: ':iceberg-bundled-guava', configuration: 
'shadow')
+    api project(':iceberg-api')
+    implementation project(':iceberg-common')
+    implementation project(':iceberg-core')
+    api project(':iceberg-data')
+    implementation project(':iceberg-orc')
+    implementation project(':iceberg-parquet')
+    implementation project(':iceberg-arrow')
+    implementation project(':iceberg-hive-metastore')
+
+    compileOnly "com.google.errorprone:error_prone_annotations"
+    compileOnly "org.apache.avro:avro"
+    compileOnly("org.apache.spark:spark-hive_2.11") {
+      exclude group: 'org.apache.avro', module: 'avro'
+    }
+
+    implementation("org.apache.orc:orc-core::nohive") {
+      exclude group: 'org.apache.hadoop'
+      exclude group: 'commons-lang'
+      // These artifacts are shaded and included in the orc-core fat jar
+      exclude group: 'com.google.protobuf', module: 'protobuf-java'
+      exclude group: 'org.apache.hive', module: 'hive-storage-api'
+    }
+
+    implementation("org.apache.arrow:arrow-vector") {
+      exclude group: 'io.netty', module: 'netty-buffer'
+      exclude group: 'io.netty', module: 'netty-common'
+      exclude group: 'com.google.code.findbugs', module: 'jsr305'
+    }
+
+    testImplementation("org.apache.hadoop:hadoop-minicluster") {
+      exclude group: 'org.apache.avro', module: 'avro'
+    }
+    testImplementation project(path: ':iceberg-hive-metastore', configuration: 
'testArtifacts')
+    testImplementation project(path: ':iceberg-api', configuration: 
'testArtifacts')
+    testImplementation project(path: ':iceberg-core', configuration: 
'testArtifacts')
+    testImplementation project(path: ':iceberg-data', configuration: 
'testArtifacts')
+  }
+
+  test {
+    // For vectorized reads
+    // Allow unsafe memory access to avoid the costly check arrow does to 
check if index is within bounds
+    systemProperty("arrow.enable_unsafe_memory_access", "true")
+    // Disable expensive null check for every get(index) call.
+    // Iceberg manages nullability checks itself instead of relying on arrow.
+    systemProperty("arrow.enable_null_check_for_get", "false")
+
+    // Vectorized reads need more memory
+    maxHeapSize '2500m'
+  }
+}
+
+// add enabled Spark version modules to the build
+project.ext.defaultSparkVersions = "2.4,3.0"

Review comment:
       I moved the known and default Spark version lists into 
`gradle.properties` so that they are shared.
   
   As for getting rid of the common module, I'm all for that. I just want to 
make this as small as possible.

##########
File path: jmh.gradle
##########
@@ -17,15 +17,22 @@
  * under the License.
  */
 
-def jmhProjects = []
-if (JavaVersion.current() == JavaVersion.VERSION_1_8) {
-  jmhProjects = [ project("iceberg-spark2"), project("iceberg-spark3") ]
-} else if (JavaVersion.current() == JavaVersion.VERSION_11) {
-  jmhProjects = [ project("iceberg-spark3") ]
-} else {
+if (jdkVersion != '8' && jdkVersion != '11') {
   throw new GradleException("The JMH benchamrks must be run with JDK 8 or JDK 
11")
 }
 
+def knownSparkVersions = System.getProperty("knownSparkVersions").split(",")

Review comment:
       Fixed. I also removed it from spark/build.gradle.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to