Skip to content

Commit bfe3a25

Browse files
authoredMay 19, 2023
Spark-3.4: Fix errorprone warning (apache#7654)
1 parent 24490b0 commit bfe3a25

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed
 

‎baseline.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ subprojects {
9999
'-Xep:MissingOverride:ERROR',
100100
'-Xep:IntLongMath:ERROR',
101101
'-Xep:MissingSummary:ERROR',
102+
'-Xep:AnnotateFormatMethod:ERROR',
102103
)
103104
}
104105
}

‎spark/v3.4/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ project(":iceberg-spark:iceberg-spark-extensions-${sparkMajorVersion}_${scalaVer
152152
exclude group: 'io.netty', module: 'netty-common'
153153
exclude group: 'org.roaringbitmap'
154154
}
155+
compileOnly "com.google.errorprone:error_prone_annotations"
155156

156157
testImplementation project(path: ':iceberg-data')
157158
testImplementation project(path: ':iceberg-parquet')

‎spark/v3.4/spark-extensions/src/jmh/java/org/apache/iceberg/spark/MergeCardinalityCheckBenchmark.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import static org.apache.spark.sql.functions.date_add;
2323
import static org.apache.spark.sql.functions.expr;
2424

25+
import com.google.errorprone.annotations.FormatMethod;
26+
import com.google.errorprone.annotations.FormatString;
2527
import java.util.UUID;
2628
import org.apache.hadoop.conf.Configuration;
2729
import org.apache.iceberg.DistributionMode;
@@ -221,7 +223,8 @@ private String newWarehouseDir() {
221223
return hadoopConf.get("hadoop.tmp.dir") + UUID.randomUUID();
222224
}
223225

224-
private void sql(String query, Object... args) {
226+
@FormatMethod
227+
private void sql(@FormatString String query, Object... args) {
225228
spark.sql(String.format(query, args));
226229
}
227230
}

0 commit comments

Comments
 (0)