deniskuzZ commented on code in PR #5215:
URL: https://github.com/apache/hive/pull/5215#discussion_r1815403104
##########
ql/src/java/org/apache/hadoop/hive/ql/optimizer/StatsOptimizer.java:
##########
@@ -943,9 +944,16 @@ private Long getRowCnt(
}
} else { // unpartitioned table
if (!StatsUtils.areBasicStatsUptoDateForQueryAnswering(tbl,
tbl.getParameters())) {
+ if (MetaStoreUtils.isNonNativeTable(tbl.getTTable())
+ && tbl.getStorageHandler().canComputeQueryUsingStats(tbl)) {
+ return Long.valueOf(tbl.getStorageHandler().getBasicStatistics(tbl)
Review Comment:
why not extract the non-native handling
````
if (MetaStoreUtils.isNonNativeTable(tbl.getTTable())
&& tbl.getStorageHandler().canComputeQueryUsingStats(tbl)) {
basicStats = tbl.getStorageHandler().getBasicStatistics(tbl) :
tbl.getParameters();
} else if (StatsUtils.areBasicStatsUptoDateForQueryAnswering(tbl,
tbl.getParameters())) {
basicStats = tbl.getParameters();
} else {
return null;
}
rowCnt = Long.valueOf(basicStats.get(StatsSetupConst.ROW_COUNT));
````
--
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]