konstantinb commented on code in PR #6359:
URL: https://github.com/apache/hive/pull/6359#discussion_r3030882052


##########
ql/src/java/org/apache/hadoop/hive/ql/stats/estimator/StatEstimator.java:
##########
@@ -39,5 +40,19 @@ public interface StatEstimator {
    * @param argStats the statistics for every argument of the UDF
    * @return {@link ColStatistics} estimate for the actual UDF.
    */
-  public Optional<ColStatistics> estimate(List<ColStatistics> argStats);
+  default Optional<ColStatistics> estimate(List<ColStatistics> argStats) {
+    throw new UnsupportedOperationException("This estimator requires 
parentStats");
+  }

Review Comment:
   This change eliminates the need to implement estimate(args) for impacted 
estimators while allowing other estimators that do not need numRows to keep 
their original estimate(args) implementation, without having to implement 
estimate(args, numRows). I.e., it felt "cleaner" and allowed me to reduce the # 
of Java files that required edits.



-- 
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]

Reply via email to