[jOOQ/jOOQ#13986] Add support for Db2 11.1 LISTAGG(DISTINCT)
This commit is contained in:
parent
9da211c606
commit
20ed73a9b3
@ -28974,18 +28974,6 @@ public class DSL {
|
||||
|
||||
/**
|
||||
* Get the aggregated concatenation for a field.
|
||||
* <p>
|
||||
* This is natively supported by {@link SQLDialect#ORACLE11G} upwards. It is
|
||||
* emulated by the following dialects:
|
||||
* <ul>
|
||||
* <li> {@link SQLDialect#AURORA_MYSQL}: Using <code>GROUP_CONCAT</code></li>
|
||||
* <li> {@link SQLDialect#DB2}: Using <code>XMLAGG()</code></li>
|
||||
* <li> {@link SQLDialect#H2}: Using <code>GROUP_CONCAT()</code></li>
|
||||
* <li> {@link SQLDialect#HSQLDB}: Using <code>GROUP_CONCAT()</code></li>
|
||||
* <li> {@link SQLDialect#MYSQL}: Using <code>GROUP_CONCAT()</code></li>
|
||||
* <li> {@link SQLDialect#POSTGRES}: Using <code>STRING_AGG()</code></li>
|
||||
* <li> {@link SQLDialect#SYBASE}: Using <code>LIST()</code></li>
|
||||
* </ul>
|
||||
*
|
||||
* @see #groupConcat(Field)
|
||||
*/
|
||||
@ -28997,18 +28985,6 @@ public class DSL {
|
||||
|
||||
/**
|
||||
* Get the aggregated concatenation for a field.
|
||||
* <p>
|
||||
* This is natively supported by {@link SQLDialect#ORACLE11G} upwards. It is
|
||||
* emulated by the following dialects:
|
||||
* <ul>
|
||||
* <li> {@link SQLDialect#AURORA_MYSQL}: Using <code>GROUP_CONCAT</code></li>
|
||||
* <li> {@link SQLDialect#DB2}: Using <code>XMLAGG()</code></li>
|
||||
* <li> {@link SQLDialect#H2}: Using <code>GROUP_CONCAT</code></li>
|
||||
* <li> {@link SQLDialect#HSQLDB}: Using <code>GROUP_CONCAT</code></li>
|
||||
* <li> {@link SQLDialect#MYSQL}: Using <code>GROUP_CONCAT</code></li>
|
||||
* <li> {@link SQLDialect#POSTGRES}: Using <code>STRING_AGG()</code></li>
|
||||
* <li> {@link SQLDialect#SYBASE}: Using <code>LIST()</code></li>
|
||||
* </ul>
|
||||
*
|
||||
* @see #groupConcat(Field)
|
||||
*/
|
||||
@ -29018,6 +28994,28 @@ public class DSL {
|
||||
return new ListAgg(false, Tools.nullSafe(field), inline(separator));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the aggregated concatenation for a field.
|
||||
*
|
||||
* @see #groupConcatDistinct(Field)
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
|
||||
public static OrderedAggregateFunction<String> listAggDistinct(Field<?> field) {
|
||||
return new ListAgg(true, Tools.nullSafe(field));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the aggregated concatenation for a field.
|
||||
*
|
||||
* @see #groupConcatDistinct(Field)
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ CUBRID, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
|
||||
public static OrderedAggregateFunction<String> listAggDistinct(Field<?> field, String separator) {
|
||||
return new ListAgg(true, Tools.nullSafe(field), inline(separator));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the aggregated concatenation for a field.
|
||||
* <p>
|
||||
|
||||
@ -231,6 +231,7 @@ import static org.jooq.impl.DSL.length;
|
||||
// ...
|
||||
import static org.jooq.impl.DSL.list;
|
||||
import static org.jooq.impl.DSL.listAgg;
|
||||
import static org.jooq.impl.DSL.listAggDistinct;
|
||||
import static org.jooq.impl.DSL.ln;
|
||||
import static org.jooq.impl.DSL.log;
|
||||
import static org.jooq.impl.DSL.log10;
|
||||
@ -11885,13 +11886,13 @@ final class DefaultParseContext extends AbstractScope implements ParseContext {
|
||||
|
||||
if (parseFunctionNameIf("LISTAGG")) {
|
||||
parse('(');
|
||||
parseKeywordIf("ALL");
|
||||
boolean distinct = parseSetQuantifier();
|
||||
Field<?> field = parseField();
|
||||
|
||||
if (parseIf(','))
|
||||
ordered = listAgg(field, parseStringLiteral());
|
||||
ordered = distinct ? listAggDistinct(field, parseStringLiteral()) : listAgg(field, parseStringLiteral());
|
||||
else
|
||||
ordered = listAgg(field);
|
||||
ordered = distinct ? listAggDistinct(field) : listAgg(field);
|
||||
|
||||
parse(')');
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user