@Value.Immutable(singleton=false)
public static interface SqlValidator.Config
| Modifier and Type | Field and Description |
|---|---|
static SqlValidator.Config |
DEFAULT
Default configuration.
|
| Modifier and Type | Method and Description |
|---|---|
default boolean |
callRewrite()
Returns whether to enable rewrite of "macro-like" calls such as COALESCE.
|
default boolean |
columnReferenceExpansion()
Returns whether column reference expansion is enabled.
|
default SqlConformance |
conformance()
Returns the dialect of SQL (SQL:2003, etc.) this validator recognizes.
|
default NullCollation |
defaultNullCollation()
Returns how NULL values should be collated if an ORDER BY item does not
contain NULLS FIRST or NULLS LAST.
|
default boolean |
identifierExpansion()
Returns whether to expand identifiers other than column
references.
|
default boolean |
lenientOperatorLookup()
Returns whether this validator should be lenient upon encountering an
unknown function, default false.
|
default SqlConformance |
sqlConformance()
Deprecated.
Use
conformance() |
default boolean |
typeCoercionEnabled()
Returns whether the validator supports implicit type coercion.
|
TypeCoercionFactory |
typeCoercionFactory()
Returns the type coercion factory.
|
@Nullable 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 |
withConformance(SqlConformance conformance)
Sets the SQL conformance of the validator.
|
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.
|
default SqlValidator.Config |
withSqlConformance(SqlConformance conformance)
Deprecated.
Use
conformance() |
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(@Nullable SqlTypeCoercionRule rules)
Sets the
SqlTypeCoercionRule instance which defines the type conversion matrix
for the explicit type coercion. |
static final SqlValidator.Config DEFAULT
@Value.Default default boolean callRewrite()
SqlValidator.Config withCallRewrite(boolean rewrite)
@Value.Default default NullCollation defaultNullCollation()
SqlValidator.Config withDefaultNullCollation(NullCollation nullCollation)
@Value.Default default boolean columnReferenceExpansion()
SqlValidator.Config withColumnReferenceExpansion(boolean expand)
@Value.Default default 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)
@Value.Default default 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 function@Value.Default default boolean typeCoercionEnabled()
SqlValidator.Config withTypeCoercionEnabled(boolean enabled)
TypeCoercionImplTypeCoercionFactory typeCoercionFactory()
SqlValidator.Config withTypeCoercionFactory(TypeCoercionFactory factory)
TypeCoercionImpl.factory - Factory to create TypeCoercion instance@Nullable SqlTypeCoercionRule typeCoercionRules()
SqlValidator.Config withTypeCoercionRules(@Nullable 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 rules@Value.Default default SqlConformance conformance()
SqlConformanceEnum.DEFAULT.@Deprecated default SqlConformance sqlConformance()
conformance()SqlValidator.Config withConformance(SqlConformance conformance)
@Deprecated default SqlValidator.Config withSqlConformance(SqlConformance conformance)
conformance()Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.