okumin commented on code in PR #5191:
URL: https://github.com/apache/hive/pull/5191#discussion_r1565852758


##########
ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUtils.java:
##########
@@ -1736,6 +1749,13 @@ private static boolean 
isWideningCast(ExprNodeGenericFuncDesc engfd) {
             engfd.getTypeInfo());
   }
 
+  private static boolean isColStatsReusableFunc(ExprNodeGenericFuncDesc engfd) 
{
+    GenericUDF udf = engfd.getGenericUDF();
+    Class udfClass =
+        (udf instanceof GenericUDFBridge) ? 
((GenericUDFBridge)udf).getUdfClass() : udf.getClass();
+    return udfClass == GenericUDFLower.class || udfClass == 
GenericUDFUpper.class;

Review Comment:
   I like this PR. I have also observed that an estimation was wrong, and Map 
Join was disabled.
   We implement some estimation APIs on the UDF side. I'll share examples with 
you. This is not a strong suggestion, and the current implementation seems to 
be a good starting point. We may finally need a pluggable I/F to empower custom 
UDFs more.
   - 
https://github.com/apache/hive/blob/rel/release-4.0.0/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/NDV.java
   - 
https://github.com/apache/hive/blob/rel/release-4.0.0/ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFEvaluator.java#L63-L81



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