public class SqlDelegatingConformance extends SqlAbstractConformance
SqlConformance
that delegates all methods to
another object. You can create a sub-class that overrides particular
methods.Modifier and Type | Field and Description |
---|---|
private SqlConformance |
delegate |
DEFAULT, ORACLE_10, PRAGMATIC_2003, PRAGMATIC_99, STRICT_2003, STRICT_92, STRICT_99
Modifier | Constructor and Description |
---|---|
protected |
SqlDelegatingConformance(SqlConformance delegate)
Creates a SqlDelegatingConformance.
|
Modifier and Type | Method and 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()
Whether
FROM clause is required in a SELECT statement. |
boolean |
isGroupByAlias()
Whether to allow aliases from the
SELECT clause to be used as
column names in the GROUP BY clause. |
boolean |
isGroupByOrdinal()
Whether
GROUP BY 2 is interpreted to mean 'group by the 2nd column
in the select list'. |
boolean |
isHavingAlias()
Whether to allow aliases from the
SELECT clause to be used as
column names in the HAVING clause. |
boolean |
isInsertSubsetColumnsAllowed()
Whether to allow
INSERT (or UPSERT ) with no column list
but fewer values than the target table. |
boolean |
isMinusAllowed()
Whether
MINUS is allowed as an alternative to EXCEPT 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'. |
allowExplicitRowValueConstructor, allowExtend, allowExtendedTrim, allowGeometry, isApplyAllowed, isLiberal, isLimitStartCountAllowed, isPercentRemainderAllowed, shouldConvertRaggedUnionTypesToVarying
private final SqlConformance delegate
protected SqlDelegatingConformance(SqlConformance delegate)
public boolean isGroupByAlias()
SqlConformance
SELECT
clause to be used as
column names in the GROUP BY
clause.
Among the built-in conformance levels, true in
SqlConformanceEnum.BABEL
,
SqlConformanceEnum.LENIENT
,
SqlConformanceEnum.MYSQL_5
;
false otherwise.
isGroupByAlias
in interface SqlConformance
isGroupByAlias
in class SqlAbstractConformance
public boolean isGroupByOrdinal()
SqlConformance
GROUP 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.
isGroupByOrdinal
in interface SqlConformance
isGroupByOrdinal
in class SqlAbstractConformance
public boolean isHavingAlias()
SqlConformance
SELECT
clause to be used as
column names in the HAVING
clause.
Among the built-in conformance levels, true in
SqlConformanceEnum.BABEL
,
SqlConformanceEnum.LENIENT
,
SqlConformanceEnum.MYSQL_5
;
false otherwise.
isHavingAlias
in interface SqlConformance
isHavingAlias
in class SqlAbstractConformance
public boolean isSortByOrdinal()
SqlConformance
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.
isSortByOrdinal
in interface SqlConformance
isSortByOrdinal
in class SqlAbstractConformance
public boolean isSortByAlias()
SqlConformance
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.
isSortByAlias
in interface SqlConformance
isSortByAlias
in class SqlAbstractConformance
public boolean isSortByAliasObscures()
SqlConformance
Among the built-in conformance levels, true in
SqlConformanceEnum.STRICT_92
;
false otherwise.
isSortByAliasObscures
in interface SqlConformance
isSortByAliasObscures
in class SqlAbstractConformance
public boolean isFromRequired()
SqlConformance
FROM
clause is required in a SELECT
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.
isFromRequired
in interface SqlConformance
isFromRequired
in class SqlAbstractConformance
public boolean isBangEqualAllowed()
SqlConformance
Among the built-in conformance levels, true in
SqlConformanceEnum.BABEL
,
SqlConformanceEnum.LENIENT
,
SqlConformanceEnum.MYSQL_5
,
SqlConformanceEnum.ORACLE_10
;
SqlConformanceEnum.ORACLE_12
;
false otherwise.
isBangEqualAllowed
in interface SqlConformance
isBangEqualAllowed
in class SqlAbstractConformance
public boolean isMinusAllowed()
SqlConformance
MINUS
is allowed as an alternative to EXCEPT
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
or EXCEPT
(as of
version 5.5).
isMinusAllowed
in interface SqlConformance
isMinusAllowed
in class SqlAbstractConformance
public boolean isInsertSubsetColumnsAllowed()
SqlConformance
INSERT
(or UPSERT
) 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 the CREATE TABLE
statement, or is NULL
if the
column is not declared NOT NULL
.
Among the built-in conformance levels, true in
SqlConformanceEnum.BABEL
,
SqlConformanceEnum.LENIENT
,
SqlConformanceEnum.PRAGMATIC_99
,
SqlConformanceEnum.PRAGMATIC_2003
;
false otherwise.
isInsertSubsetColumnsAllowed
in interface SqlConformance
isInsertSubsetColumnsAllowed
in class SqlAbstractConformance
public boolean allowNiladicParentheses()
SqlConformance
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.
allowNiladicParentheses
in interface SqlConformance
allowNiladicParentheses
in class SqlAbstractConformance
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.