public void onMatch(RelOptRuleCall call)
    {
        gLogger.fine(description);

        int relLength = call.rels.length;
        SplunkUdxRel udxRel = (SplunkUdxRel) call.rels[relLength - 1];
        if (!isSplunkSearchUdx(udxRel))
            return;
        
        FilterRel  filter     = null;
        ProjectRel topProj    = null;
        ProjectRel bottomProj = null;

        
        RelDataType topRow = udxRel.getRowType();
        
        int filterIdx = 2;
        if(call.rels[relLength - 2] instanceof ProjectRel){
            bottomProj = (ProjectRel)call.rels[relLength - 2];
            filterIdx  = 3;
            
            // bottom projection will change the field count/order 
            topRow =  bottomProj.getRowType();
        }

        String filterString = "";
        
        if(filterIdx <= relLength  && call.rels[relLength - filterIdx] instanceof FilterRel){
            filter = (FilterRel) call.rels[relLength - filterIdx];

            int topProjIdx = filterIdx + 1;
            if(topProjIdx <= relLength  && call.rels[relLength - topProjIdx] instanceof ProjectRel){
                topProj = (ProjectRel)call.rels[relLength - topProjIdx];
            }
            
            RexCall filterCall = (RexCall) filter.getCondition();
            SqlOperator     op = filterCall.getOperator();
            RexNode[] operands = filterCall.getOperands();
    
            gLogger.fine("fieldNames: " + getFieldsString(topRow));
            
            filterString = getFilter(op, operands, "", RelOptUtil.getFieldNames(topRow));
    
            if (filterString == null) {
                // can't handle - exit and stop optimizer from calling any SplunkUdxRel related optimizations
                transformToFarragoUdxRel(
                    call,
                    udxRel,
                    filter,
                    topProj,
                    bottomProj);
                return;
            }
        }
        
        // top projection will change the field count/order 
        if(topProj != null)
            topRow =  topProj.getRowType();

        gLogger.fine("pre transformTo fieldNames: " + getFieldsString(topRow));

        call.transformTo(appendSearchString(filterString, udxRel, topProj, bottomProj, topRow, null, false));
    }