public abstract class SqlAbstractConformance extends java.lang.Object implements SqlConformance
SqlConformance
.
Every method in SqlConformance
is implemented,
and behaves the same as in SqlConformanceEnum.DEFAULT
.
DEFAULT, ORACLE_10, PRAGMATIC_2003, PRAGMATIC_99, STRICT_2003, STRICT_92, STRICT_99
Constructor and Description |
---|
SqlAbstractConformance() |
Modifier and Type | Method and Description |
---|---|
boolean |
allowExplicitRowValueConstructor()
Whether to allow SQL syntax "
ROW(expr1, expr2, expr3) ". |
boolean |
allowExtend()
Whether to allow mixing table columns with extended columns in
INSERT (or UPSERT ). |
boolean |
allowExtendedTrim()
Whether TRIM should support more than one trim character.
|
boolean |
allowGeometry()
Whether to allow geo-spatial extensions, including the GEOMETRY type.
|
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 |
isApplyAllowed()
Whether
CROSS APPLY and OUTER APPLY operators are allowed
in the parser. |
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 |
isLiberal()
Whether this dialect supports features from a wide variety of
dialects.
|
boolean |
isLimitStartCountAllowed()
Whether to allow the SQL syntax "
LIMIT start, count ". |
boolean |
isMinusAllowed()
Whether
MINUS is allowed as an alternative to EXCEPT in
the parser. |
boolean |
isPercentRemainderAllowed()
Whether the "%" operator is allowed by the parser as an alternative to the
mod function. |
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'. |
boolean |
shouldConvertRaggedUnionTypesToVarying()
Whether the least restrictive type of a number of CHAR types of different
lengths should be a VARCHAR type.
|
public boolean isLiberal()
SqlConformance
isLiberal
in interface SqlConformance
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
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
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
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
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
public boolean isSortByAliasObscures()
SqlConformance
Among the built-in conformance levels, true in
SqlConformanceEnum.STRICT_92
;
false otherwise.
isSortByAliasObscures
in interface SqlConformance
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
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
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
public boolean isApplyAllowed()
SqlConformance
CROSS APPLY
and OUTER APPLY
operators are allowed
in the parser.
APPLY
invokes a table-valued function for each row returned
by a table expression. It is syntactic sugar:
SELECT * FROM emp CROSS APPLY TABLE(promote(empno)
SELECT * FROM emp CROSS JOIN LATERAL TABLE(promote(empno)
SELECT * FROM emp OUTER APPLY TABLE(promote(empno)
SELECT * FROM emp LEFT JOIN LATERAL TABLE(promote(empno)
ON true
Among the built-in conformance levels, true in
SqlConformanceEnum.BABEL
,
SqlConformanceEnum.LENIENT
,
SqlConformanceEnum.SQL_SERVER_2008
;
SqlConformanceEnum.ORACLE_12
;
false otherwise.
isApplyAllowed
in interface SqlConformance
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
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
public boolean allowExplicitRowValueConstructor()
SqlConformance
ROW(expr1, expr2, expr3)
".
The equivalent syntax in standard SQL is
"(expr1, expr2, expr3)
".
Standard SQL does not allow this because the type is not well-defined. However, PostgreSQL allows this behavior.
Standard SQL allows row expressions in other contexts, for instance
inside VALUES
clause.
Among the built-in conformance levels, true in
SqlConformanceEnum.DEFAULT
,
SqlConformanceEnum.LENIENT
;
false otherwise.
allowExplicitRowValueConstructor
in interface SqlConformance
public boolean allowExtend()
SqlConformance
INSERT
(or UPSERT
).
For example, suppose that the declaration of table T
has columns
A
and B
, and you want to insert data of column
C INTEGER
not present in the table declaration as an extended
column. You can specify the columns in an INSERT
statement as
follows:
INSERT INTO T (A, B, C INTEGER) VALUES (1, 2, 3)
Among the built-in conformance levels, true in
SqlConformanceEnum.BABEL
,
SqlConformanceEnum.LENIENT
;
false otherwise.
allowExtend
in interface SqlConformance
public boolean isLimitStartCountAllowed()
SqlConformance
LIMIT start, count
".
The equivalent syntax in standard SQL is
"OFFSET start ROW FETCH FIRST count ROWS ONLY
",
and in PostgreSQL "LIMIT count OFFSET start
".
MySQL and CUBRID allow this behavior.
Among the built-in conformance levels, true in
SqlConformanceEnum.BABEL
,
SqlConformanceEnum.LENIENT
,
SqlConformanceEnum.MYSQL_5
;
false otherwise.
isLimitStartCountAllowed
in interface SqlConformance
public boolean isPercentRemainderAllowed()
SqlConformance
mod
function.
Among the built-in conformance levels, true in
SqlConformanceEnum.BABEL
,
SqlConformanceEnum.LENIENT
,
SqlConformanceEnum.MYSQL_5
;
false otherwise.
isPercentRemainderAllowed
in interface SqlConformance
public boolean allowGeometry()
SqlConformance
Among the built-in conformance levels, true in
SqlConformanceEnum.BABEL
,
SqlConformanceEnum.LENIENT
,
SqlConformanceEnum.MYSQL_5
,
SqlConformanceEnum.SQL_SERVER_2008
;
false otherwise.
allowGeometry
in interface SqlConformance
public boolean shouldConvertRaggedUnionTypesToVarying()
SqlConformance
For example, consider the query
SELECT 'abcde' UNION SELECT 'xyz'
The input columns have types CHAR(5)
and CHAR(3)
, and
we need a result type that is large enough for both:
CHAR(5)
,
and the value in the second row will have trailing spaces.
VARCHAR(5)
, and the
values have no trailing spaces.
Among the built-in conformance levels, true in
SqlConformanceEnum.PRAGMATIC_99
,
SqlConformanceEnum.PRAGMATIC_2003
,
SqlConformanceEnum.MYSQL_5
;
SqlConformanceEnum.ORACLE_10
;
SqlConformanceEnum.ORACLE_12
;
SqlConformanceEnum.SQL_SERVER_2008
;
false otherwise.
shouldConvertRaggedUnionTypesToVarying
in interface SqlConformance
public boolean allowExtendedTrim()
SqlConformance
For example, consider the query
SELECT TRIM('eh' FROM 'hehe__hehe')
Under strict behavior, if the length of trim character is not 1, TRIM throws an exception, and the query fails. However many implementations (in databases such as MySQL and SQL Server) trim all the characters, resulting in a return value of '__'.
Among the built-in conformance levels, true in
SqlConformanceEnum.BABEL
,
SqlConformanceEnum.LENIENT
,
SqlConformanceEnum.MYSQL_5
,
SqlConformanceEnum.SQL_SERVER_2008
;
false otherwise.
allowExtendedTrim
in interface SqlConformance
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.