use of org.jooq.WindowIgnoreNullsStep in project jOOQ by jOOQ.
the class DefaultParseContext method parseFieldLeadLagIf.
private final Field<?> parseFieldLeadLagIf() {
boolean lead = parseFunctionNameIf("LEAD");
boolean lag = !lead && parseFunctionNameIf("LAG");
if (lead || lag) {
parse('(');
Field<Void> f1 = (Field) parseField();
Integer f2 = null;
Field<Void> f3 = null;
if (parseIf(',')) {
f2 = asInt(parseUnsignedIntegerLiteral());
if (parseIf(','))
f3 = (Field) parseField();
}
WindowIgnoreNullsStep s1 = lead ? f2 == null ? lead(f1) : f3 == null ? lead(f1, f2) : lead(f1, f2, f3) : f2 == null ? lag(f1) : f3 == null ? lag(f1, f2) : lag(f1, f2, f3);
WindowOverStep<?> s2 = parseWindowRespectIgnoreNulls(s1, s1);
parse(')');
return parseWindowFunction(null, s1, s2);
}
return null;
}
use of org.jooq.WindowIgnoreNullsStep in project jOOQ by jOOQ.
the class DefaultParseContext method parseFieldNthValueIf.
private final Field<?> parseFieldNthValueIf() {
if (parseFunctionNameIf("NTH_VALUE")) {
parse('(');
Field<?> f1 = parseField();
parse(',');
Field<?> f2 = parseField();
WindowFromFirstLastStep<?> s1 = nthValue(f1, (Field) f2);
WindowIgnoreNullsStep s2 = parseWindowFromFirstLast(s1, s1);
WindowOverStep<?> s3 = parseWindowRespectIgnoreNulls(s2, s2);
parse(')');
return parseWindowFunction(s1, s2, s3);
}
return null;
}
Aggregations