Package org.apache.calcite.sql.dialect
Class OracleSqlDialect
java.lang.Object
org.apache.calcite.sql.SqlDialect
org.apache.calcite.sql.dialect.OracleSqlDialect
A
SqlDialect implementation for the Oracle database.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.calcite.sql.SqlDialect
SqlDialect.CalendarPolicy, SqlDialect.Context, SqlDialect.DatabaseProduct, SqlDialect.FakeUtil -
Field Summary
FieldsFields inherited from class org.apache.calcite.sql.SqlDialect
BUILT_IN_OPERATORS_LIST, EMPTY_CONTEXT, identifierEndQuoteString, identifierEscapedQuote, identifierQuoteString, literalEndQuoteString, literalEscapedQuote, literalQuoteString, LOGGER, nullCollation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanallowsAs()@Nullable SqlNodegetCastSpec(RelDataType type) Returns SqlNode for type in "cast(column as type)", which might be different between databases by type name, precision etc.Returns the name of the system table that has precisely one row.booleanReturns whether this dialect supports case when return boolean type.booleanReturns whether the dialect supports VALUES in a sub-query with and an "AS t(column, ...)" values to define column names.booleanReturns whether this dialect supports APPROX_COUNT_DISTINCT functions.booleanReturns whether the dialect supports character set names as part of a data type, for instanceVARCHAR(30) CHARACTER SET `ISO-8859-1`.booleansupportsDataType(RelDataType type) Returns whether this dialect supports a given type.voidunparseBoolLiteral(SqlWriter writer, SqlLiteral literal, int leftPrec, int rightPrec) voidunparseCall(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec) voidunparseDateTimeLiteral(SqlWriter writer, SqlAbstractDateTimeLiteral literal, int leftPrec, int rightPrec) voidunparseOffsetFetch(SqlWriter writer, @Nullable SqlNode offset, @Nullable SqlNode fetch) Converts an offset and fetch into SQL.Methods inherited from class org.apache.calcite.sql.SqlDialect
configureParser, configureParser, containsNonAscii, create, defaultNullDirection, emulateJoinTypeForCrossJoin, emulateNullDirection, emulateNullDirectionWithIsNull, getCalendarPolicy, getConformance, getDatabaseProduct, getFormatModel, getNullCollation, getProduct, getQuotedCasing, getQuoting, getTypeSystem, getUnquotedCasing, hasImplicitTableAlias, identifierNeedsQuote, isCaseSensitive, prepareUnparse, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteStringLiteral, quoteStringLiteral, quoteStringLiteralUnicode, quoteTimestampLiteral, requiresAliasForFromItems, rewriteMaxMin, rewriteMaxMinExpr, rewriteSingleValueExpr, supportsAggregateFunction, supportsAggregateFunctionFilter, supportsFunction, supportsGroupByLiteral, supportsGroupByWithCube, supportsGroupByWithRollup, supportsImplicitTypeCoercion, supportsJoinType, supportsNestedAggregations, supportsOffsetFetch, supportsTimestampPrecision, supportsWindowFunctions, unparseFetchUsingAnsi, unparseFetchUsingLimit, unparseLimit, unparseNumericLiteral, unparseOffset, unparseSqlDatetimeArithmetic, unparseSqlIntervalLiteral, unparseSqlIntervalQualifier, unparseSqlSetOption, unparseTableScanHints, unparseTopN, unquoteStringLiteral
-
Field Details
-
DEFAULT_CONTEXT
-
DEFAULT
-
-
Constructor Details
-
OracleSqlDialect
Creates an OracleSqlDialect.
-
-
Method Details
-
supportsApproxCountDistinct
public boolean supportsApproxCountDistinct()Description copied from class:SqlDialectReturns whether this dialect supports APPROX_COUNT_DISTINCT functions.- Overrides:
supportsApproxCountDistinctin classSqlDialect
-
supportsCharSet
public boolean supportsCharSet()Description copied from class:SqlDialectReturns whether the dialect supports character set names as part of a data type, for instanceVARCHAR(30) CHARACTER SET `ISO-8859-1`.- Overrides:
supportsCharSetin classSqlDialect
-
supportBooleanCaseWhen
public boolean supportBooleanCaseWhen()Description copied from class:SqlDialectReturns whether this dialect supports case when return boolean type.- Overrides:
supportBooleanCaseWhenin classSqlDialect
-
supportsDataType
Description copied from class:SqlDialectReturns whether this dialect supports a given type.- Overrides:
supportsDataTypein classSqlDialect
-
getCastSpec
Description copied from class:SqlDialectReturns SqlNode for type in "cast(column as type)", which might be different between databases by type name, precision etc.If this method returns null, the cast will be omitted. In the default implementation, this is the case for the NULL type, and therefore
CAST(NULL AS <nulltype>)is rendered asNULL.- Overrides:
getCastSpecin classSqlDialect
-
allowsAs
protected boolean allowsAs()- Overrides:
allowsAsin classSqlDialect
-
supportsAliasedValues
public boolean supportsAliasedValues()Description copied from class:SqlDialectReturns whether the dialect supports VALUES in a sub-query with and an "AS t(column, ...)" values to define column names.Currently, only Oracle does not. For this, we generate "SELECT v0 AS c0, v1 AS c1 ... UNION ALL ...". We may need to refactor this method when we support VALUES for other dialects.
- Overrides:
supportsAliasedValuesin classSqlDialect
-
unparseBoolLiteral
- Overrides:
unparseBoolLiteralin classSqlDialect
-
unparseDateTimeLiteral
public void unparseDateTimeLiteral(SqlWriter writer, SqlAbstractDateTimeLiteral literal, int leftPrec, int rightPrec) - Overrides:
unparseDateTimeLiteralin classSqlDialect
-
getSingleRowTableName
Description copied from class:SqlDialectReturns the name of the system table that has precisely one row. If there is no such table, returns null, and we will generate SELECT with no FROM clause.For
VALUES 1, Oracle returns ["DUAL"] and we generate "SELECT 1 FROM DUAL"; MySQL returns null and we generate "SELECT 1".- Overrides:
getSingleRowTableNamein classSqlDialect
-
unparseCall
- Overrides:
unparseCallin classSqlDialect
-
unparseOffsetFetch
Description copied from class:SqlDialectConverts an offset and fetch into SQL.At least one of
offsetandfetchmust be provided.Common options:
OFFSET offset ROWS FETCH NEXT fetch ROWS ONLY(ANSI standard SQL, Oracle, PostgreSQL, and the default)LIMIT fetch OFFSET offset(Apache Hive, MySQL, Redshift)
- Overrides:
unparseOffsetFetchin classSqlDialect- Parameters:
writer- Writeroffset- Number of rows to skip before emitting, or nullfetch- Number of rows to fetch, or null- See Also:
-