public static interface SqlValidator.Config
| Modifier and Type | Field and Description |
|---|---|
static SqlValidator.Config |
DEFAULT
Default configuration.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
callRewrite()
Returns whether to enable rewrite of "macro-like" calls such as COALESCE.
|
boolean |
columnReferenceExpansion()
Returns whether column reference expansion is enabled.
|
NullCollation |
defaultNullCollation()
Returns how NULL values should be collated if an ORDER BY item does not
contain NULLS FIRST or NULLS LAST.
|
boolean |
identifierExpansion()
Returns whether to expand identifiers other than column
references.
|
boolean |
lenientOperatorLookup()
Returns whether this validator should be lenient upon encountering an
unknown function, default false.
|
SqlConformance |
sqlConformance()
Returns the dialect of SQL (SQL:2003, etc.) this validator recognizes.
|
boolean |
typeCoercionEnabled()
Returns whether the validator supports implicit type coercion.
|
TypeCoercionFactory |
typeCoercionFactory()
Returns the type coercion factory.
|
SqlTypeCoercionRule |
typeCoercionRules()
Returns the type coercion rules for explicit type coercion.
|
SqlValidator.Config |
withCallRewrite(boolean rewrite)
Sets whether to enable rewrite of "macro-like" calls such as COALESCE.
|
SqlValidator.Config |
withColumnReferenceExpansion(boolean expand)
Sets whether to enable expansion of column references.
|
SqlValidator.Config |
withDefaultNullCollation(NullCollation nullCollation)
Sets how NULL values should be collated if an ORDER BY item does not
contain NULLS FIRST or NULLS LAST.
|
SqlValidator.Config |
withIdentifierExpansion(boolean expand)
Sets whether to enable expansion of identifiers other than column
references.
|
SqlValidator.Config |
withLenientOperatorLookup(boolean lenient)
Sets whether this validator should be lenient upon encountering an unknown
function.
|
SqlValidator.Config |
withSqlConformance(SqlConformance conformance)
Sets up the sql conformance of the validator.
|
SqlValidator.Config |
withTypeCoercionEnabled(boolean enabled)
Sets whether to enable implicit type coercion for validation, default true.
|
SqlValidator.Config |
withTypeCoercionFactory(TypeCoercionFactory factory)
Sets a factory to create type coercion instance that overrides the
default coercion rules defined in
TypeCoercionImpl. |
SqlValidator.Config |
withTypeCoercionRules(SqlTypeCoercionRule rules)
Sets the
SqlTypeCoercionRule instance which defines the type conversion matrix
for the explicit type coercion. |
static final SqlValidator.Config DEFAULT
boolean callRewrite()
SqlValidator.Config withCallRewrite(boolean rewrite)
NullCollation defaultNullCollation()
SqlValidator.Config withDefaultNullCollation(NullCollation nullCollation)
boolean columnReferenceExpansion()
SqlValidator.Config withColumnReferenceExpansion(boolean expand)
boolean identifierExpansion()
REVIEW jvs 30-June-2006: subclasses may override shouldExpandIdentifiers in a way that ignores this; we should probably get rid of the protected method and always use this variable (or better, move preferences like this to a separate "parameter" class).
SqlValidator.Config withIdentifierExpansion(boolean expand)
boolean lenientOperatorLookup()
If true, if a statement contains a call to a function that is not
present in the operator table, or if the call does not have the required
number or types of operands, the validator nevertheless regards the
statement as valid. The type of the function call will be
UNKNOWN.
If false (the default behavior), an unknown function call causes a validation error to be thrown.
SqlValidator.Config withLenientOperatorLookup(boolean lenient)
lenient - Whether to be lenient when encountering an unknown functionboolean typeCoercionEnabled()
SqlValidator.Config withTypeCoercionEnabled(boolean enabled)
TypeCoercionImplTypeCoercionFactory typeCoercionFactory()
SqlValidator.Config withTypeCoercionFactory(TypeCoercionFactory factory)
TypeCoercionImpl.factory - Factory to create TypeCoercion instanceSqlTypeCoercionRule typeCoercionRules()
SqlValidator.Config withTypeCoercionRules(SqlTypeCoercionRule rules)
SqlTypeCoercionRule instance which defines the type conversion matrix
for the explicit type coercion.
The rules setting should be thread safe. In the default implementation,
it is set to a ThreadLocal variable.
rules - The SqlTypeCoercionRule instance,
see its documentation for how to customize the rulesSqlConformance sqlConformance()
SqlConformanceEnum.DEFAULT.SqlValidator.Config withSqlConformance(SqlConformance conformance)
Copyright © 2012-2020 Apache Software Foundation. All Rights Reserved.