package com.kylinolap.query.sqlfunc;

import net.hydromatic.optiq.runtime.SqlFunctions;
import net.hydromatic.optiq.runtime.SqlFunctions.TimeUnitRange;

public abstract class QuarterBase {
    
    public static long eval(int date) {
        long month = SqlFunctions.unixDateExtract(TimeUnitRange.MONTH, date);
        return month / 4 + 1;
    }
}

@@ -146,16 +146,46 @@
 Range;%0A%0A
+/**%0A * @author xjiang%0A * %0A */%0A
 public a
@@ -217,16 +217,150 @@
  %7B%0A    %0A
+    /**%0A     * According to jvm spec, it return self method before parent.%0A     * So, we keep Date in parent and int in child%0A     */%0A
     publ

update QuarterFunc to return eval(Date firstly)