Code review comment: `columnRewriter.rewriteQueryToView(compensationEqualPredicate)` can be null ?

Code before review:
private PredicateSplit getCompensationPredicates(RewriteContext rewriteContext, boolean isQueryAgainstView) {
EquivalenceClasses sourceEquivalenceClasses = isQueryAgainstView ?
rewriteContext.getQueryEquivalenceClasses() : rewriteContext.getQueryBasedViewEquivalenceClasses();
EquivalenceClasses targetEquivalenceClasses = isQueryAgainstView ?
rewriteContext.getQueryBasedViewEquivalenceClasses() : rewriteContext.getQueryEquivalenceClasses();
final ScalarOperator compensationEqualPredicate =
getCompensationEqualPredicate(sourceEquivalenceClasses, targetEquivalenceClasses);
if (compensationEqualPredicate == null) {
return null;
}
ColumnRewriter columnRewriter = new ColumnRewriter(rewriteContext);
ScalarOperator srcPr = isQueryAgainstView ? rewriteContext.getQueryPredicateSplit().getRangePredicates()
: rewriteContext.getMvPredicateSplit().getRangePredicates();
ScalarOperator targetPr = isQueryAgainstView ? rewriteContext.getMvPredicateSplit().getRangePredicates()
: rewriteContext.getQueryPredicateSplit().getRangePredicates();
ScalarOperator compensationPr =
getCompensationRangePredicate(srcPr, targetPr, columnRewriter, isQueryAgainstView);
if (compensationPr == null) {
return null;
}
ScalarOperator srcPu = isQueryAgainstView ? rewriteContext.getQueryPredicateSplit().getResidualPredicates()
: rewriteContext.getMvPredicateSplit().getResidualPredicates();
ScalarOperator targetPu = isQueryAgainstView ? rewriteContext.getMvPredicateSplit().getResidualPredicates()
: rewriteContext.getQueryPredicateSplit().getResidualPredicates();
if (srcPu == null && targetPu != null) {
if (!isQueryAgainstView) {
srcPu = Utils.compoundAnd(columnRewriter.rewriteQueryToView(compensationEqualPredicate),
columnRewriter.rewriteQueryToView(compensationPr));
} else {
srcPu = Utils.compoundAnd(compensationEqualPredicate, compensationPr);
}
}
ScalarOperator compensationPu =
getCompensationResidualPredicate(srcPu, targetPu, columnRewriter, isQueryAgainstView);
if (compensationPu == null) {
return null;
}
return PredicateSplit.of(compensationEqualPredicate, compensationPr, compensationPu);
}

Line under review: srcPu = Utils.compoundAnd(columnRewriter.rewriteQueryToView(compensationEqualPredicate),

Code after addressing the review:
private PredicateSplit getCompensationPredicates(RewriteContext rewriteContext, boolean isQueryAgainstView) {
EquivalenceClasses sourceEquivalenceClasses = isQueryAgainstView ?
rewriteContext.getQueryEquivalenceClasses() : rewriteContext.getQueryBasedViewEquivalenceClasses();
EquivalenceClasses targetEquivalenceClasses = isQueryAgainstView ?
rewriteContext.getQueryBasedViewEquivalenceClasses() : rewriteContext.getQueryEquivalenceClasses();
final ScalarOperator compensationEqualPredicate =
getCompensationEqualPredicate(sourceEquivalenceClasses, targetEquivalenceClasses);
if (compensationEqualPredicate == null) {
return null;
}
ColumnRewriter columnRewriter = new ColumnRewriter(rewriteContext);
ScalarOperator srcPr = isQueryAgainstView ? rewriteContext.getQueryPredicateSplit().getRangePredicates()
: rewriteContext.getMvPredicateSplit().getRangePredicates();
ScalarOperator targetPr = isQueryAgainstView ? rewriteContext.getMvPredicateSplit().getRangePredicates()
: rewriteContext.getQueryPredicateSplit().getRangePredicates();
ScalarOperator compensationPr =
getCompensationRangePredicate(srcPr, targetPr, columnRewriter, isQueryAgainstView);
if (compensationPr == null) {
return null;
}
ScalarOperator srcPu = isQueryAgainstView ? rewriteContext.getQueryPredicateSplit().getResidualPredicates()
: rewriteContext.getMvPredicateSplit().getResidualPredicates();
ScalarOperator targetPu = isQueryAgainstView ? rewriteContext.getMvPredicateSplit().getResidualPredicates()
: rewriteContext.getQueryPredicateSplit().getResidualPredicates();
if (srcPu == null && targetPu != null) {
if (!isQueryAgainstView) {
srcPu = Utils.compoundAnd(columnRewriter.rewriteQueryToView(compensationEqualPredicate),
columnRewriter.rewriteQueryToView(compensationPr));
} else {
srcPu = Utils.compoundAnd(compensationEqualPredicate, compensationPr);
}
}
ScalarOperator compensationPu =
getCompensationResidualPredicate(srcPu, targetPu, columnRewriter, isQueryAgainstView);
if (compensationPu == null) {
return null;
}
return PredicateSplit.of(compensationEqualPredicate, compensationPr, compensationPu);
}