Class SqlDelegatingConformance
- java.lang.Object
-
- org.apache.calcite.sql.validate.SqlAbstractConformance
-
- org.apache.calcite.sql.validate.SqlDelegatingConformance
-
- All Implemented Interfaces:
SqlConformance
public class SqlDelegatingConformance extends SqlAbstractConformance
Implementation ofSqlConformance
that delegates all methods to another object. You can create a sub-class that overrides particular methods.
-
-
Field Summary
Fields Modifier and Type Field Description private SqlConformance
delegate
-
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
Constructors Modifier Constructor Description protected
SqlDelegatingConformance(SqlConformance delegate)
Creates a SqlDelegatingConformance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allowNiladicParentheses()
Whether to allow parentheses to be specified in calls to niladic functions and procedures (that is, functions and procedures with no parameters).boolean
isBangEqualAllowed()
Whether the bang-equal token != is allowed as an alternative to <> in the parser.boolean
isFromRequired()
WhetherFROM
clause is required in aSELECT
statement.boolean
isGroupByAlias()
Whether to allow aliases from theSELECT
clause to be used as column names in theGROUP BY
clause.boolean
isGroupByOrdinal()
WhetherGROUP BY 2
is interpreted to mean 'group by the 2nd column in the select list'.boolean
isHavingAlias()
Whether to allow aliases from theSELECT
clause to be used as column names in theHAVING
clause.boolean
isInsertSubsetColumnsAllowed()
Whether to allowINSERT
(orUPSERT
) with no column list but fewer values than the target table.boolean
isMinusAllowed()
WhetherMINUS
is allowed as an alternative toEXCEPT
in the parser.boolean
isSortByAlias()
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
isSortByAliasObscures()
Whether "empno" is invalid in "select empno as x from emp order by empno" because the alias "x" obscures it.boolean
isSortByOrdinal()
Whether 'ORDER BY 2
' is interpreted to mean 'sort by the 2nd column in the select list'.-
Methods inherited from class org.apache.calcite.sql.validate.SqlAbstractConformance
allowExplicitRowValueConstructor, allowExtend, allowExtendedTrim, allowGeometry, isApplyAllowed, isLiberal, isLimitStartCountAllowed, isPercentRemainderAllowed, shouldConvertRaggedUnionTypesToVarying
-
-
-
-
Field Detail
-
delegate
private final SqlConformance delegate
-
-
Constructor Detail
-
SqlDelegatingConformance
protected SqlDelegatingConformance(SqlConformance delegate)
Creates a SqlDelegatingConformance.
-
-
Method Detail
-
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.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.LENIENT
,SqlConformanceEnum.MYSQL_5
; 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.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.STRICT_92
,SqlConformanceEnum.PRAGMATIC_99
,SqlConformanceEnum.PRAGMATIC_2003
;SqlConformanceEnum.SQL_SERVER_2008
; 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.LENIENT
,SqlConformanceEnum.MYSQL_5
,SqlConformanceEnum.ORACLE_10
,SqlConformanceEnum.ORACLE_12
,SqlConformanceEnum.STRICT_92
;SqlConformanceEnum.SQL_SERVER_2008
; 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
; 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
-
-