Skip to content

Commit 0e8749e

Browse files
HIVE-29239: Upgrade checkstyle to 11.1.0 (#6111)
1 parent 744a0d6 commit 0e8749e

File tree

9 files changed

+49
-29
lines changed

9 files changed

+49
-29
lines changed

iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,12 +1414,11 @@ public List<FieldSchema> acidSelectColumns(org.apache.hadoop.hive.ql.metadata.Ta
14141414
case DELETE ->
14151415
// TODO: make it configurable whether we want to include the table columns in the select query.
14161416
// It might make delete writes faster if we don't have to write out the row object
1417-
ListUtils.union(ACID_VIRTUAL_COLS_AS_FIELD_SCHEMA, table.getCols());
1417+
ListUtils.union(ACID_VIRTUAL_COLS_AS_FIELD_SCHEMA, table.getCols());
14181418
case UPDATE -> shouldOverwrite(table, operation) ?
1419-
ACID_VIRTUAL_COLS_AS_FIELD_SCHEMA :
1420-
ListUtils.union(ACID_VIRTUAL_COLS_AS_FIELD_SCHEMA, table.getCols());
1421-
case MERGE ->
1422-
ACID_VIRTUAL_COLS_AS_FIELD_SCHEMA;
1419+
ACID_VIRTUAL_COLS_AS_FIELD_SCHEMA :
1420+
ListUtils.union(ACID_VIRTUAL_COLS_AS_FIELD_SCHEMA, table.getCols());
1421+
case MERGE -> ACID_VIRTUAL_COLS_AS_FIELD_SCHEMA;
14231422
default -> ImmutableList.of();
14241423
};
14251424
}
@@ -1435,12 +1434,10 @@ public List<FieldSchema> acidSortColumns(org.apache.hadoop.hive.ql.metadata.Tabl
14351434
return switch (operation) {
14361435
case DELETE -> IcebergTableUtil.isFanoutEnabled(table.getParameters()) ?
14371436
EMPTY_ORDERING : POSITION_DELETE_ORDERING;
1438-
case MERGE ->
1439-
POSITION_DELETE_ORDERING;
1440-
default ->
1441-
// For update operations we use the same sort order defined by
1442-
// {@link #createDPContext(HiveConf, org.apache.hadoop.hive.ql.metadata.Table)}
1443-
EMPTY_ORDERING;
1437+
case MERGE -> POSITION_DELETE_ORDERING;
1438+
// For update operations we use the same sort order defined by
1439+
// {@link #createDPContext(HiveConf, org.apache.hadoop.hive.ql.metadata.Table)}
1440+
default -> EMPTY_ORDERING;
14441441
};
14451442
}
14461443

iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/IcebergTableUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ public static List<String> getPartitionNames(Table table, Map<String, String> pa
544544
expression, false);
545545
return e.getValue().isPartitioned() &&
546546
resEval.residualFor(e.getKey()).isEquivalentTo(Expressions.alwaysTrue()) &&
547-
(e.getValue().specId() == table.spec().specId() || !latestSpecOnly);
547+
(e.getValue().specId() == table.spec().specId() || !latestSpecOnly);
548548

549549
}).transform(e -> e.getValue().partitionToPath(e.getKey())).toSortedList(
550550
Comparator.naturalOrder());

iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/compaction/evaluator/amoro/TableIdentifier.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,15 +353,15 @@ public boolean equals(TableIdentifier that) {
353353
public int hashCode() {
354354
int hashCode = 1;
355355

356-
hashCode = hashCode * 8191 + ((isSetCatalog()) ? 131071 : 524287);
356+
hashCode = hashCode * 8191 + (isSetCatalog() ? 131071 : 524287);
357357
if (isSetCatalog())
358358
hashCode = hashCode * 8191 + catalog.hashCode();
359359

360-
hashCode = hashCode * 8191 + ((isSetDatabase()) ? 131071 : 524287);
360+
hashCode = hashCode * 8191 + (isSetDatabase() ? 131071 : 524287);
361361
if (isSetDatabase())
362362
hashCode = hashCode * 8191 + database.hashCode();
363363

364-
hashCode = hashCode * 8191 + ((isSetTableName()) ? 131071 : 524287);
364+
hashCode = hashCode * 8191 + (isSetTableName() ? 131071 : 524287);
365365
if (isSetTableName())
366366
hashCode = hashCode * 8191 + tableName.hashCode();
367367

iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/writer/HiveFileWriterFactory.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,15 @@ Builder positionDeleteRowSchema(Schema newPositionDeleteRowSchema) {
138138

139139
HiveFileWriterFactory build() {
140140
return new HiveFileWriterFactory(
141-
table,
142-
dataFileFormat,
143-
dataSchema,
144-
null,
145-
deleteFileFormat,
146-
null,
147-
null,
148-
null,
149-
positionDeleteRowSchema);
141+
table,
142+
dataFileFormat,
143+
dataSchema,
144+
null,
145+
deleteFileFormat,
146+
null,
147+
null,
148+
null,
149+
positionDeleteRowSchema);
150150
}
151151
}
152152
}

iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/writer/HiveIcebergWriterBase.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,10 @@ static PartitioningWriter<PositionDelete<Record>, DeleteWriteResult> newDeleteWr
129129
if (context.useDVs()) {
130130
return new PartitioningDVWriter<>(files, previousDeleteLoader);
131131
} else if (inputOrdered && rewritableDeletes == null) {
132-
return new ClusteredPositionDeleteWriter<>(
133-
writers, files, io, targetFileSize, deleteGranularity);
132+
return new ClusteredPositionDeleteWriter<>(writers, files, io, targetFileSize, deleteGranularity);
134133
} else {
135134
return new FanoutPositionOnlyDeleteWriter<>(
136-
writers, files, io, targetFileSize, deleteGranularity, previousDeleteLoader);
135+
writers, files, io, targetFileSize, deleteGranularity, previousDeleteLoader);
137136
}
138137
}
139138

iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/mapreduce/AbstractIcebergRecordReader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ private static Schema readSchema(Configuration conf, Table table, boolean caseSe
7474
readSchema = table.schema();
7575

7676
if (selectedColumns != null) {
77-
readSchema =
78-
caseSensitive ? readSchema.select(selectedColumns) : readSchema.caseInsensitiveSelect(selectedColumns);
77+
readSchema = caseSensitive ?
78+
readSchema.select(selectedColumns) : readSchema.caseInsensitiveSelect(selectedColumns);
7979
}
8080

8181
if (InputFormatConfig.fetchVirtualColumns(conf)) {

pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
<datanucleus-core.version>6.0.10</datanucleus-core.version>
119119
<datanucleus-jdo.version>3.2.0-release</datanucleus-jdo.version>
120120
<datanucleus-rdbms.version>6.0.10</datanucleus-rdbms.version>
121+
<checkstyle.version>11.1.0</checkstyle.version>
121122
<commons-cli.version>1.5.0</commons-cli.version>
122123
<commons-codec.version>1.15</commons-codec.version>
123124
<commons-collections.version>3.2.2</commons-collections.version>
@@ -1551,6 +1552,13 @@
15511552
<groupId>org.apache.maven.plugins</groupId>
15521553
<artifactId>maven-checkstyle-plugin</artifactId>
15531554
<version>${maven.checkstyle.plugin.version}</version>
1555+
<dependencies>
1556+
<dependency>
1557+
<groupId>com.puppycrawl.tools</groupId>
1558+
<artifactId>checkstyle</artifactId>
1559+
<version>${checkstyle.version}</version>
1560+
</dependency>
1561+
</dependencies>
15541562
</plugin>
15551563
<plugin>
15561564
<groupId>org.apache.rat</groupId>

standalone-metastore/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
<!-- Dependency versions -->
6666
<antlr.version>4.9.3</antlr.version>
6767
<apache-directory-server.version>2.0.0-M24</apache-directory-server.version>
68+
<checkstyle.version>11.1.0</checkstyle.version>
6869
<commons-lang3.version>3.14.0</commons-lang3.version>
6970
<commons-dbcp2.version>2.12.0</commons-dbcp2.version>
7071
<datasketches.version>2.0.0</datasketches.version>
@@ -587,6 +588,13 @@
587588
<groupId>org.apache.maven.plugins</groupId>
588589
<artifactId>maven-checkstyle-plugin</artifactId>
589590
<version>${maven.checkstyle.plugin.version}</version>
591+
<dependencies>
592+
<dependency>
593+
<groupId>com.puppycrawl.tools</groupId>
594+
<artifactId>checkstyle</artifactId>
595+
<version>${checkstyle.version}</version>
596+
</dependency>
597+
</dependencies>
590598
</plugin>
591599
<plugin>
592600
<groupId>org.apache.maven.plugins</groupId>

storage-api/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<name>Hive Storage API</name>
2727
<inceptionYear>2008</inceptionYear>
2828
<properties>
29+
<checkstyle.version>11.1.0</checkstyle.version>
2930
<maven.compiler.source>21</maven.compiler.source>
3031
<maven.compiler.target>21</maven.compiler.target>
3132
<guava.version>22.0</guava.version>
@@ -171,6 +172,13 @@
171172
<groupId>org.apache.maven.plugins</groupId>
172173
<artifactId>maven-checkstyle-plugin</artifactId>
173174
<version>${maven.checkstyle.plugin.version}</version>
175+
<dependencies>
176+
<dependency>
177+
<groupId>com.puppycrawl.tools</groupId>
178+
<artifactId>checkstyle</artifactId>
179+
<version>${checkstyle.version}</version>
180+
</dependency>
181+
</dependencies>
174182
</plugin>
175183
<plugin>
176184
<groupId>org.codehaus.mojo</groupId>

0 commit comments

Comments
 (0)