Class SqlDelegatingConformance
- All Implemented Interfaces:
SqlConformance
SqlConformance
that delegates all methods to
another object. You can create a sub-class that overrides particular
methods.-
Field Summary
Fields inherited from interface org.apache.calcite.sql.validate.SqlConformance
DEFAULT, ORACLE_10, PRAGMATIC_2003, PRAGMATIC_99, STRICT_2003, STRICT_92, STRICT_99
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
SqlDelegatingConformance
(SqlConformance delegate) Creates a SqlDelegatingConformance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Whether directly alias array items in UNNEST.boolean
Whether to allow parentheses to be specified in calls to niladic functions and procedures (that is, functions and procedures with no parameters).boolean
Whether the bang-equal token != is allowed as an alternative to <> in the parser.boolean
WhetherFROM
clause is required in aSELECT
statement.boolean
Whether to allow aliases from theSELECT
clause to be used as column names in theGROUP BY
clause.boolean
WhetherGROUP BY 2
is interpreted to mean 'group by the 2nd column in the select list'.boolean
Whether to allow aliases from theSELECT
clause to be used as column names in theHAVING
clause.boolean
Whether to allowINSERT
(orUPSERT
) with no column list but fewer values than the target table.boolean
WhetherMINUS
is allowed as an alternative toEXCEPT
in the parser.boolean
Whether 'ORDER BY x
' is interpreted to mean 'sort by the select list item whose alias is x' even if there is a column called x.boolean
Whether "empno" is invalid in "select empno as x from emp order by empno" because the alias "x" obscures it.boolean
Whether 'ORDER BY 2
' is interpreted to mean 'sort by the 2nd column in the select list'.boolean
WhetherVALUE
is allowed as an alternative toVALUES
in the parser.Controls the behavior of operators that are part of Standard SQL but nevertheless have different behavior in different databases.Methods inherited from class org.apache.calcite.sql.validate.SqlAbstractConformance
allowCharLiteralAlias, allowCoercionStringToArray, allowExplicitRowValueConstructor, allowExtend, allowExtendedTrim, allowGeometry, allowHyphenInUnquotedTableName, allowPluralTimeUnits, allowQualifyingCommonColumn, isApplyAllowed, isLiberal, isLimitStartCountAllowed, isOffsetLimitAllowed, isPercentRemainderAllowed, shouldConvertRaggedUnionTypesToVarying, splitQuotedTableName
-
Constructor Details
-
SqlDelegatingConformance
Creates a SqlDelegatingConformance.
-
-
Method Details
-
isGroupByAlias
public boolean isGroupByAlias()Description copied from interface:SqlConformance
Whether to allow aliases from theSELECT
clause to be used as column names in theGROUP BY
clause.Among the built-in conformance levels, true in
SqlConformanceEnum.BABEL
,SqlConformanceEnum.BIG_QUERY
,SqlConformanceEnum.LENIENT
,SqlConformanceEnum.MYSQL_5
; false otherwise.- Specified by:
isGroupByAlias
in interfaceSqlConformance
- Overrides:
isGroupByAlias
in classSqlAbstractConformance
-
isGroupByOrdinal
public boolean isGroupByOrdinal()Description copied from interface:SqlConformance
WhetherGROUP BY 2
is interpreted to mean 'group by the 2nd column in the select list'.Among the built-in conformance levels, true in
SqlConformanceEnum.BABEL
,SqlConformanceEnum.BIG_QUERY
,SqlConformanceEnum.LENIENT
,SqlConformanceEnum.MYSQL_5
,SqlConformanceEnum.PRESTO
; false otherwise.- Specified by:
isGroupByOrdinal
in interfaceSqlConformance
- Overrides:
isGroupByOrdinal
in classSqlAbstractConformance
-
isHavingAlias
public boolean isHavingAlias()Description copied from interface:SqlConformance
Whether to allow aliases from theSELECT
clause to be used as column names in theHAVING
clause.Among the built-in conformance levels, true in
SqlConformanceEnum.BABEL
,SqlConformanceEnum.BIG_QUERY
,SqlConformanceEnum.LENIENT
,SqlConformanceEnum.MYSQL_5
; false otherwise.- Specified by:
isHavingAlias
in interfaceSqlConformance
- Overrides:
isHavingAlias
in classSqlAbstractConformance
-
isSortByOrdinal
public boolean isSortByOrdinal()Description copied from interface:SqlConformance
Whether 'ORDER BY 2
' is interpreted to mean 'sort by the 2nd column in the select list'.Among the built-in conformance levels, true in
SqlConformanceEnum.DEFAULT
,SqlConformanceEnum.BABEL
,SqlConformanceEnum.LENIENT
,SqlConformanceEnum.MYSQL_5
,SqlConformanceEnum.ORACLE_10
,SqlConformanceEnum.ORACLE_12
,SqlConformanceEnum.PRAGMATIC_99
,SqlConformanceEnum.PRAGMATIC_2003
,SqlConformanceEnum.PRESTO
,SqlConformanceEnum.SQL_SERVER_2008
,SqlConformanceEnum.STRICT_92
; false otherwise.- Specified by:
isSortByOrdinal
in interfaceSqlConformance
- Overrides:
isSortByOrdinal
in classSqlAbstractConformance
-
isSortByAlias
public boolean isSortByAlias()Description copied from interface:SqlConformance
Whether 'ORDER BY x
' is interpreted to mean 'sort by the select list item whose alias is x' even if there is a column called x.Among the built-in conformance levels, true in
SqlConformanceEnum.DEFAULT
,SqlConformanceEnum.BABEL
,SqlConformanceEnum.BIG_QUERY
,SqlConformanceEnum.LENIENT
,SqlConformanceEnum.MYSQL_5
,SqlConformanceEnum.ORACLE_10
,SqlConformanceEnum.ORACLE_12
,SqlConformanceEnum.SQL_SERVER_2008
,SqlConformanceEnum.STRICT_92
; false otherwise.- Specified by:
isSortByAlias
in interfaceSqlConformance
- Overrides:
isSortByAlias
in classSqlAbstractConformance
-
isSortByAliasObscures
public boolean isSortByAliasObscures()Description copied from interface:SqlConformance
Whether "empno" is invalid in "select empno as x from emp order by empno" because the alias "x" obscures it.Among the built-in conformance levels, true in
SqlConformanceEnum.STRICT_92
; false otherwise.- Specified by:
isSortByAliasObscures
in interfaceSqlConformance
- Overrides:
isSortByAliasObscures
in classSqlAbstractConformance
-
isFromRequired
public boolean isFromRequired()Description copied from interface:SqlConformance
WhetherFROM
clause is required in aSELECT
statement.Among the built-in conformance levels, true in
SqlConformanceEnum.ORACLE_10
,SqlConformanceEnum.ORACLE_12
,SqlConformanceEnum.STRICT_92
,SqlConformanceEnum.STRICT_99
,SqlConformanceEnum.STRICT_2003
; false otherwise.- Specified by:
isFromRequired
in interfaceSqlConformance
- Overrides:
isFromRequired
in classSqlAbstractConformance
-
isBangEqualAllowed
public boolean isBangEqualAllowed()Description copied from interface:SqlConformance
Whether the bang-equal token != is allowed as an alternative to <> in the parser.Among the built-in conformance levels, true in
SqlConformanceEnum.BABEL
,SqlConformanceEnum.LENIENT
,SqlConformanceEnum.MYSQL_5
,SqlConformanceEnum.ORACLE_10
,SqlConformanceEnum.ORACLE_12
,SqlConformanceEnum.PRESTO
; false otherwise.- Specified by:
isBangEqualAllowed
in interfaceSqlConformance
- Overrides:
isBangEqualAllowed
in classSqlAbstractConformance
-
isMinusAllowed
public boolean isMinusAllowed()Description copied from interface:SqlConformance
WhetherMINUS
is allowed as an alternative toEXCEPT
in the parser.Among the built-in conformance levels, true in
SqlConformanceEnum.BABEL
,SqlConformanceEnum.LENIENT
,SqlConformanceEnum.ORACLE_10
,SqlConformanceEnum.ORACLE_12
; false otherwise.Note: MySQL does not support
MINUS
orEXCEPT
(as of version 5.5).- Specified by:
isMinusAllowed
in interfaceSqlConformance
- Overrides:
isMinusAllowed
in classSqlAbstractConformance
-
isInsertSubsetColumnsAllowed
public boolean isInsertSubsetColumnsAllowed()Description copied from interface:SqlConformance
Whether to allowINSERT
(orUPSERT
) with no column list but fewer values than the target table.The N values provided are assumed to match the first N columns of the table, and for each of the remaining columns, the default value of the column is used. It is an error if any of these columns has no default value.
The default value of a column is specified by the
DEFAULT
clause in theCREATE TABLE
statement, or isNULL
if the column is not declaredNOT NULL
.Among the built-in conformance levels, true in
SqlConformanceEnum.BABEL
,SqlConformanceEnum.LENIENT
,SqlConformanceEnum.PRAGMATIC_99
,SqlConformanceEnum.PRAGMATIC_2003
; false otherwise.- Specified by:
isInsertSubsetColumnsAllowed
in interfaceSqlConformance
- Overrides:
isInsertSubsetColumnsAllowed
in classSqlAbstractConformance
-
allowNiladicParentheses
public boolean allowNiladicParentheses()Description copied from interface:SqlConformance
Whether to allow parentheses to be specified in calls to niladic functions and procedures (that is, functions and procedures with no parameters).For example,
CURRENT_DATE
is a niladic system function. In standard SQL it must be invoked without parentheses:VALUES CURRENT_DATE
If
allowNiladicParentheses
, the following syntax is also valid:VALUES CURRENT_DATE()
Of the popular databases, MySQL, Apache Phoenix and VoltDB allow this behavior; Apache Hive, HSQLDB, IBM DB2, Microsoft SQL Server, Oracle, PostgreSQL do not.
Among the built-in conformance levels, true in
SqlConformanceEnum.BABEL
,SqlConformanceEnum.LENIENT
,SqlConformanceEnum.MYSQL_5
; false otherwise.- Specified by:
allowNiladicParentheses
in interfaceSqlConformance
- Overrides:
allowNiladicParentheses
in classSqlAbstractConformance
-
allowAliasUnnestItems
public boolean allowAliasUnnestItems()Description copied from interface:SqlConformance
Whether directly alias array items in UNNEST.E.g. in UNNEST(a_array, b_array) AS T(a, b), a and b will be aliases of elements in a_array and b_array respectively.
Without this flag set, T will be the alias of the element in a_array and a, b will be the top level fields of T if T is a STRUCT type.
Among the built-in conformance levels, true in
SqlConformanceEnum.PRESTO
; false otherwise.- Specified by:
allowAliasUnnestItems
in interfaceSqlConformance
- Overrides:
allowAliasUnnestItems
in classSqlAbstractConformance
-
isValueAllowed
public boolean isValueAllowed()Description copied from interface:SqlConformance
WhetherVALUE
is allowed as an alternative toVALUES
in the parser.Among the built-in conformance levels, true in
SqlConformanceEnum.BABEL
,SqlConformanceEnum.LENIENT
,SqlConformanceEnum.MYSQL_5
; false otherwise.- Specified by:
isValueAllowed
in interfaceSqlConformance
- Overrides:
isValueAllowed
in classSqlAbstractConformance
-
semantics
Description copied from interface:SqlConformance
Controls the behavior of operators that are part of Standard SQL but nevertheless have different behavior in different databases.Consider the
SUBSTRING
operator. In ISO standard SQL, negative start indexes are converted to 1; in Google BigQuery, negative start indexes are treated as offsets from the end of the string. For example,SUBSTRING('abcde' FROM -3 FOR 2)
returns'ab'
in standard SQL and 'cd' in BigQuery.If you specify
conformance=BIG_QUERY
in your connection parameters,SUBSTRING
will give the BigQuery behavior. Similarly MySQL and Oracle.Among the built-in conformance levels:
SqlConformanceEnum.BIG_QUERY
returnsSqlLibrary.BIG_QUERY
;SqlConformanceEnum.MYSQL_5
returnsSqlLibrary.MYSQL
;SqlConformanceEnum.ORACLE_10
andSqlConformanceEnum.ORACLE_12
returnSqlLibrary.ORACLE
;- otherwise returns
SqlLibrary.STANDARD
.
- Specified by:
semantics
in interfaceSqlConformance
- Overrides:
semantics
in classSqlAbstractConformance
-