Interface SqlValidator.Config
- Enclosing interface:
SqlValidator
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
Returns whether to enable rewrite of "macro-like" calls such as COALESCE.default boolean
Returns whether column reference expansion is enabled.default SqlConformance
Returns the dialect of SQL (SQL:2003, etc.) this validator recognizes.default NullCollation
Returns how NULL values should be collated if an ORDER BY item does not contain NULLS FIRST or NULLS LAST.default boolean
Returns whether to treat the query being validated as embedded (as opposed to top-level).default boolean
Returns whether to expand identifiers other than column references.default boolean
Returns whether this validator should be lenient upon encountering an unknown function, default false.default boolean
Returns whether the validator allows measures to be used without AGGREGATE function in an aggregate query.default boolean
Returns whether the validator allows measures to be used without AGGREGATE function in a non-aggregate query.default SqlConformance
Deprecated.default boolean
Returns whether the validator supports implicit type coercion.Returns the type coercion factory.@Nullable SqlTypeCoercionRule
Returns the type coercion rules for explicit type coercion.withCallRewrite
(boolean rewrite) Sets whether to enable rewrite of "macro-like" calls such as COALESCE.withColumnReferenceExpansion
(boolean expand) Sets whether to enable expansion of column references.withConformance
(SqlConformance conformance) Sets the SQL conformance of the validator.withDefaultNullCollation
(NullCollation nullCollation) Sets how NULL values should be collated if an ORDER BY item does not contain NULLS FIRST or NULLS LAST.withEmbeddedQuery
(boolean embedded) Sets whether to treat the query being validated as embedded (as opposed to top-level).withIdentifierExpansion
(boolean expand) Sets whether to enable expansion of identifiers other than column references.withLenientOperatorLookup
(boolean lenient) Sets whether this validator should be lenient upon encountering an unknown function.default SqlValidator.Config
withNakedMeasures
(boolean nakedMeasures) Deprecated.withNakedMeasuresInAggregateQuery
(boolean value) Sets whether the validator allows measures to be used without AGGREGATE function in an aggregate query.withNakedMeasuresInNonAggregateQuery
(boolean value) Sets whether the validator allows measures to be used without AGGREGATE function in a non-aggregate query.default SqlValidator.Config
withSqlConformance
(SqlConformance conformance) Deprecated.Useconformance()
withTypeCoercionEnabled
(boolean enabled) Sets whether to enable implicit type coercion for validation, default true.Sets a factory to create type coercion instance that overrides the default coercion rules defined inTypeCoercionImpl
.withTypeCoercionRules
(@Nullable SqlTypeCoercionRule rules) Sets theSqlTypeCoercionRule
instance which defines the type conversion matrix for the explicit type coercion.
-
Field Details
-
DEFAULT
Default configuration.
-
-
Method Details
-
callRewrite
@Default default boolean callRewrite()Returns whether to enable rewrite of "macro-like" calls such as COALESCE. -
withCallRewrite
Sets whether to enable rewrite of "macro-like" calls such as COALESCE. -
defaultNullCollation
Returns how NULL values should be collated if an ORDER BY item does not contain NULLS FIRST or NULLS LAST. -
withDefaultNullCollation
Sets how NULL values should be collated if an ORDER BY item does not contain NULLS FIRST or NULLS LAST. -
columnReferenceExpansion
@Default default boolean columnReferenceExpansion()Returns whether column reference expansion is enabled. -
withColumnReferenceExpansion
Sets whether to enable expansion of column references. (Currently this does not apply to the ORDER BY clause; may be fixed in the future.) -
identifierExpansion
@Default default boolean identifierExpansion()Returns whether to expand identifiers other than column references.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).
-
withIdentifierExpansion
Sets whether to enable expansion of identifiers other than column references. -
embeddedQuery
@Default default boolean embeddedQuery()Returns whether to treat the query being validated as embedded (as opposed to top-level).The default, false, treats the query as top-level; a value of true treats it as a query inside another, as would be the case for a view or common table expression.
Possible behavior differences include ignoring the
ORDER BY
clause of an embedded query, or converting measure expressions of a non-embedded query into values. -
withEmbeddedQuery
Sets whether to treat the query being validated as embedded (as opposed to top-level). -
lenientOperatorLookup
@Default default boolean lenientOperatorLookup()Returns whether this validator should be lenient upon encountering an unknown function, default false.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.
-
withLenientOperatorLookup
Sets whether this validator should be lenient upon encountering an unknown function.- Parameters:
lenient
- Whether to be lenient when encountering an unknown function
-
nakedMeasuresInNonAggregateQuery
@Default default boolean nakedMeasuresInNonAggregateQuery()Returns whether the validator allows measures to be used without AGGREGATE function in a non-aggregate query. Default is true. -
withNakedMeasuresInNonAggregateQuery
Sets whether the validator allows measures to be used without AGGREGATE function in a non-aggregate query. -
nakedMeasuresInAggregateQuery
@Default default boolean nakedMeasuresInAggregateQuery()Returns whether the validator allows measures to be used without AGGREGATE function in an aggregate query. Default is true. -
withNakedMeasuresInAggregateQuery
Sets whether the validator allows measures to be used without AGGREGATE function in an aggregate query. -
withNakedMeasures
Deprecated.Sets whether the validator allows measures to be used without the AGGREGATE function inside or outside aggregate queries. Deprecated: use the inside / outside variants instead. -
typeCoercionEnabled
@Default default boolean typeCoercionEnabled()Returns whether the validator supports implicit type coercion. -
withTypeCoercionEnabled
Sets whether to enable implicit type coercion for validation, default true.- See Also:
-
typeCoercionFactory
TypeCoercionFactory typeCoercionFactory()Returns the type coercion factory. -
withTypeCoercionFactory
Sets a factory to create type coercion instance that overrides the default coercion rules defined inTypeCoercionImpl
.- Parameters:
factory
- Factory to createTypeCoercion
instance
-
typeCoercionRules
@Nullable SqlTypeCoercionRule typeCoercionRules()Returns the type coercion rules for explicit type coercion. -
withTypeCoercionRules
Sets theSqlTypeCoercionRule
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.- Parameters:
rules
- TheSqlTypeCoercionRule
instance, see its documentation for how to customize the rules
-
conformance
Returns the dialect of SQL (SQL:2003, etc.) this validator recognizes. Default isSqlConformanceEnum.DEFAULT
. -
sqlConformance
Deprecated.Useconformance()
Returns the SQL conformance. -
withConformance
Sets the SQL conformance of the validator. -
withSqlConformance
Deprecated.Useconformance()
Sets the SQL conformance of the validator.
-
conformance()