Interface SqlValidator.Config

Enclosing interface:
SqlValidator

@Immutable(singleton=false) public static interface SqlValidator.Config
Interface to define the configuration for a SqlValidator. Provides methods to set each configuration option.
  • Field Details

  • Method Details

    • callRewrite

      @Default default boolean callRewrite()
      Returns whether to enable rewrite of "macro-like" calls such as COALESCE.
    • withCallRewrite

      SqlValidator.Config withCallRewrite(boolean rewrite)
      Sets whether to enable rewrite of "macro-like" calls such as COALESCE.
    • defaultNullCollation

      @Default default NullCollation defaultNullCollation()
      Returns how NULL values should be collated if an ORDER BY item does not contain NULLS FIRST or NULLS LAST.
    • withDefaultNullCollation

      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.
    • columnReferenceExpansion

      @Default default boolean columnReferenceExpansion()
      Returns whether column reference expansion is enabled.
    • withColumnReferenceExpansion

      SqlValidator.Config withColumnReferenceExpansion(boolean expand)
      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

      SqlValidator.Config withIdentifierExpansion(boolean expand)
      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

      SqlValidator.Config withEmbeddedQuery(boolean embedded)
      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

      SqlValidator.Config withLenientOperatorLookup(boolean lenient)
      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

      SqlValidator.Config withNakedMeasuresInNonAggregateQuery(boolean value)
      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

      SqlValidator.Config withNakedMeasuresInAggregateQuery(boolean value)
      Sets whether the validator allows measures to be used without AGGREGATE function in an aggregate query.
    • withNakedMeasures

      @Deprecated default SqlValidator.Config withNakedMeasures(boolean nakedMeasures)
      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

      SqlValidator.Config withTypeCoercionEnabled(boolean enabled)
      Sets whether to enable implicit type coercion for validation, default true.
      See Also:
    • typeCoercionFactory

      TypeCoercionFactory typeCoercionFactory()
      Returns the type coercion factory.
    • withTypeCoercionFactory

      SqlValidator.Config withTypeCoercionFactory(TypeCoercionFactory factory)
      Sets a factory to create type coercion instance that overrides the default coercion rules defined in TypeCoercionImpl.
      Parameters:
      factory - Factory to create TypeCoercion instance
    • typeCoercionRules

      @Nullable SqlTypeCoercionRule typeCoercionRules()
      Returns the type coercion rules for explicit type coercion.
    • withTypeCoercionRules

      SqlValidator.Config withTypeCoercionRules(@Nullable SqlTypeCoercionRule rules)
      Sets the 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.

      Parameters:
      rules - The SqlTypeCoercionRule instance, see its documentation for how to customize the rules
    • conformance

      @Default default SqlConformance conformance()
      Returns the dialect of SQL (SQL:2003, etc.) this validator recognizes. Default is SqlConformanceEnum.DEFAULT.
    • sqlConformance

      @Deprecated default SqlConformance sqlConformance()
      Deprecated.
      Returns the SQL conformance.
    • withConformance

      SqlValidator.Config withConformance(SqlConformance conformance)
      Sets the SQL conformance of the validator.
    • withSqlConformance

      @Deprecated default SqlValidator.Config withSqlConformance(SqlConformance conformance)
      Deprecated.
      Sets the SQL conformance of the validator.