public class MysqlSqlDialect extends SqlDialect
SqlDialect implementation for the MySQL database.SqlDialect.CalendarPolicy, SqlDialect.Context, SqlDialect.DatabaseProduct, SqlDialect.FakeUtil| Modifier and Type | Field and Description |
|---|---|
static SqlDialect |
DEFAULT |
static SqlFunction |
ISNULL_FUNCTION
MySQL specific function.
|
CALCITE, DUMMY, EMPTY_CONTEXT, LOGGER, nullCollation| Constructor and Description |
|---|
MysqlSqlDialect(SqlDialect.Context context)
Creates a MysqlSqlDialect.
|
| Modifier and Type | Method and Description |
|---|---|
SqlNode |
emulateNullDirection(SqlNode node,
boolean nullsFirst,
boolean desc)
Returns the SqlNode for emulating the null direction for the given field
or
null if no emulation needs to be done. |
SqlDialect.CalendarPolicy |
getCalendarPolicy() |
SqlNode |
getCastSpec(RelDataType type) |
SqlNode |
rewriteSingleValueExpr(SqlNode aggCall)
Rewrite SINGLE_VALUE into expression based on database variants
E.g.
|
boolean |
supportsAggregateFunction(SqlKind kind) |
boolean |
supportsCharSet()
Returns whether the dialect supports character set names as part of a
data type, for instance
VARCHAR(30) CHARACTER SET `ISO-8859-1`. |
boolean |
supportsNestedAggregations()
Returns whether the dialect supports nested aggregations, for instance
SELECT SUM(SUM(1)) . |
void |
unparseCall(SqlWriter writer,
SqlCall call,
int leftPrec,
int rightPrec) |
private void |
unparseFloor(SqlWriter writer,
SqlCall call)
Unparses datetime floor for MySQL.
|
void |
unparseOffsetFetch(SqlWriter writer,
SqlNode offset,
SqlNode fetch)
Converts an offset and fetch into SQL.
|
allowsAs, create, defaultNullDirection, emptyContext, emulateNullDirectionWithIsNull, getDatabaseProduct, getNullCollation, getProduct, hasImplicitTableAlias, identifierNeedsToBeQuoted, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteStringLiteral, quoteStringLiteralUnicode, quoteTimestampLiteral, requiresAliasForFromItems, supportsAliasedValues, supportsFunction, supportsOffsetFetch, unparseDateTimeLiteral, unparseFetchUsingAnsi, unparseFetchUsingLimit, unquoteStringLiteralpublic static final SqlDialect DEFAULT
public static final SqlFunction ISNULL_FUNCTION
public MysqlSqlDialect(SqlDialect.Context context)
public boolean supportsCharSet()
SqlDialectVARCHAR(30) CHARACTER SET `ISO-8859-1`.supportsCharSet in class SqlDialectpublic void unparseOffsetFetch(SqlWriter writer, SqlNode offset, SqlNode fetch)
SqlDialectAt least one of offset and fetch must 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)
unparseOffsetFetch in class SqlDialectwriter - Writeroffset - Number of rows to skip before emitting, or nullfetch - Number of rows to fetch, or nullSqlDialect.unparseFetchUsingAnsi(SqlWriter, SqlNode, SqlNode),
SqlDialect.unparseFetchUsingLimit(SqlWriter, SqlNode, SqlNode)public SqlNode emulateNullDirection(SqlNode node, boolean nullsFirst, boolean desc)
SqlDialectnull if no emulation needs to be done.emulateNullDirection in class SqlDialectnode - The SqlNode representing the expressionnullsFirst - Whether nulls should come firstdesc - Whether the sort direction is
RelFieldCollation.Direction.DESCENDING or
RelFieldCollation.Direction.STRICTLY_DESCENDINGnull if not requiredpublic boolean supportsAggregateFunction(SqlKind kind)
supportsAggregateFunction in class SqlDialectpublic boolean supportsNestedAggregations()
SqlDialectSELECT SUM(SUM(1)) .supportsNestedAggregations in class SqlDialectpublic SqlDialect.CalendarPolicy getCalendarPolicy()
getCalendarPolicy in class SqlDialectpublic SqlNode getCastSpec(RelDataType type)
getCastSpec in class SqlDialectpublic SqlNode rewriteSingleValueExpr(SqlNode aggCall)
SqlDialectrewriteSingleValueExpr in class SqlDialectpublic void unparseCall(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec)
unparseCall in class SqlDialectCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.