class ELFunction implements PartitionFunction {

    public Integer execute(String columnValue, Map<String, Object> extension) {
        Map<String, Object> vrs = new HashMap<String, Object>();
        //, Map<String, ElFunction<?,?>> functionMap
        //vrs.putAll(functionMap);// 拓展函数
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("value", columnValue);
        vrs.put("$ROOT", params);
        VariableResolverFactory vrfactory = new MapVariableResolverFactory(vrs);
        return MVEL.eval(expression, params, vrfactory, Integer.class);
    }

}

class ELFunctionTest {

    @Test
    public void testExecute() throws Exception {

        ELFunction rule = new ELFunction();
        rule.setExpression("user_id % 4");

        Object result = rule.execute("1", null);

        System.out.println(result);
    }

}