Maria has a median() function
This commit is contained in:
parent
bf7a51cb84
commit
2a9f6dafee
|
@ -33,6 +33,7 @@ import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeRegistry;
|
|||
import org.hibernate.type.descriptor.sql.internal.DdlTypeImpl;
|
||||
import org.hibernate.type.descriptor.sql.spi.DdlTypeRegistry;
|
||||
|
||||
import static org.hibernate.query.sqm.produce.function.FunctionParameterType.NUMERIC;
|
||||
import static org.hibernate.type.SqlTypes.OTHER;
|
||||
import static org.hibernate.type.SqlTypes.UUID;
|
||||
|
||||
|
@ -87,6 +88,11 @@ public class MariaDBDialect extends MySQLDialect {
|
|||
.resolve( StandardBasicTypes.BOOLEAN )
|
||||
);
|
||||
commonFunctionFactory.inverseDistributionOrderedSetAggregates_windowEmulation();
|
||||
queryEngine.getSqmFunctionRegistry().patternDescriptorBuilder( "median", "median(?1) over ()" )
|
||||
.setInvariantType( queryEngine.getTypeConfiguration().getBasicTypeRegistry().resolve( StandardBasicTypes.DOUBLE ) )
|
||||
.setExactArgumentCount( 1 )
|
||||
.setParameterTypes(NUMERIC)
|
||||
.register();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -470,7 +470,8 @@ abstract public class DialectFeatureChecks {
|
|||
public boolean apply(Dialect dialect) {
|
||||
return !( dialect instanceof MySQLDialect
|
||||
|| dialect instanceof SybaseDialect
|
||||
|| dialect instanceof DerbyDialect );
|
||||
|| dialect instanceof DerbyDialect )
|
||||
|| dialect instanceof MariaDBDialect;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue