deniskuzZ commented on code in PR #4761:
URL: https://github.com/apache/hive/pull/4761#discussion_r1502617418
##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergInputFormat.java:
##########
@@ -102,12 +102,25 @@ static Expression
icebergDataFilterFromHiveConf(Configuration conf) {
if (hiveFilter != null) {
ExprNodeGenericFuncDesc exprNodeDesc = SerializationUtilities
.deserializeObject(hiveFilter, ExprNodeGenericFuncDesc.class);
- SearchArgument sarg = ConvertAstToSearchArg.create(conf, exprNodeDesc);
- try {
+ return getFilterExpr(conf, exprNodeDesc);
+ }
+ return null;
+ }
+
+ /**
+ * getFilterExpr extracts search argument from ExprNodeGenericFuncDesc and
returns Iceberg Filter Expression
+ * @param conf - job conf
+ * @param exprNodeDesc - Describes a GenericFunc node
+ * @return Iceberg Filter Expression
+ */
+ public static Expression getFilterExpr(Configuration conf,
ExprNodeGenericFuncDesc exprNodeDesc) {
+ try {
Review Comment:
keep in try only what is needed, just wrap the return. also package-private
seems enough
````
static Expression getFilterExpr(Configuration conf,
ExprNodeGenericFuncDesc exprNodeDesc){
if (exprNodeDesc != null) {
SearchArgument sarg = ConvertAstToSearchArg.create(conf, exprNodeDesc);
try {
return HiveIcebergFilterFactory.generateFilterExpression(sarg);
} catch (UnsupportedOperationException e) {
LOG.warn("Unable to create Iceberg filter, continuing without filter
(will be applied by Hive later): ", e);
}
}
return null;
}
````
--
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]