Skip to content

Commit

Permalink
HIVE-27447: Iceberg: Queries failing due to FileSystem close errors d…
Browse files Browse the repository at this point in the history
…ue to column statistics. (apache#4429). (Ayush Saxena, reviewed by Denys Kuzmenko,)
  • Loading branch information
ayushtkn authored and yeahyung committed Jul 20, 2023
1 parent a7edbdf commit 3735c3f
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,8 @@ public boolean canProvideColStatistics(org.apache.hadoop.hive.ql.metadata.Table
Table table = IcebergTableUtil.getTable(conf, hmsTable.getTTable());
if (canSetColStatistics(hmsTable)) {
Path statsPath = getStatsPath(table);
try (FileSystem fs = statsPath.getFileSystem(conf)) {
try {
FileSystem fs = statsPath.getFileSystem(conf);
if (fs.exists(statsPath)) {
return true;
}
Expand Down Expand Up @@ -496,12 +497,13 @@ private Path getStatsPath(Table table) {
}

private void invalidateStats(Path statsPath) {
try (FileSystem fs = statsPath.getFileSystem(conf)) {
try {
FileSystem fs = statsPath.getFileSystem(conf);
if (fs.exists(statsPath)) {
fs.delete(statsPath, true);
}
} catch (IOException e) {
LOG.error("Failed to invalidate stale column stats: {}", e);
LOG.error("Failed to invalidate stale column stats: {}", e.getMessage());
}
}

Expand Down

0 comments on commit 3735c3f

Please sign in to comment.