deniskuzZ commented on code in PR #4431:
URL: https://github.com/apache/hive/pull/4431#discussion_r1238420621
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -437,17 +439,20 @@ public boolean
setColStatistics(org.apache.hadoop.hive.ql.metadata.Table hmsTabl
@Override
public boolean
canProvideColStatistics(org.apache.hadoop.hive.ql.metadata.Table hmsTable) {
Table table = IcebergTableUtil.getTable(conf, hmsTable.getTTable());
- if (canSetColStatistics(hmsTable)) {
- Path statsPath = getStatsPath(table);
- try {
- FileSystem fs = statsPath.getFileSystem(conf);
- if (fs.exists(statsPath)) {
- return true;
- }
- } catch (IOException e) {
- LOG.warn("Exception when trying to find Iceberg column stats for
table:{} , snapshot:{} , " +
- "statsPath: {} , stack trace: {}", table.name(),
table.currentSnapshot(), statsPath, e);
+ return canSetColStatistics(hmsTable) && canProvideColStatistics(hmsTable,
table.currentSnapshot().snapshotId());
+ }
+
+ private boolean
canProvideColStatistics(org.apache.hadoop.hive.ql.metadata.Table hmsTable, long
snapshotId) {
+ Table table = IcebergTableUtil.getTable(conf, hmsTable.getTTable());
Review Comment:
you are loading the table twice ignoring with skipCache, see
https://github.com/apache/hive/pull/4431/files#diff-93864ecf035fe51b92185015da842a56837cea89064813de39c278c6f8fed03cR441
--
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]