public class HiveSqlDialect extends SqlDialect
SqlDialect implementation for the Apache Hive database.SqlDialect.CalendarPolicy, SqlDialect.Context, SqlDialect.DatabaseProduct, SqlDialect.FakeUtil| Modifier and Type | Field and Description |
|---|---|
static SqlDialect |
DEFAULT |
private boolean |
emulateNullDirection |
CALCITE, DUMMY, EMPTY_CONTEXT, LOGGER, nullCollation| Constructor and Description |
|---|
HiveSqlDialect(SqlDialect.Context context)
Creates a HiveSqlDialect.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
allowsAs() |
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. |
void |
unparseOffsetFetch(SqlWriter writer,
SqlNode offset,
SqlNode fetch)
Converts an offset and fetch into SQL.
|
create, defaultNullDirection, emptyContext, emulateNullDirectionWithIsNull, getCalendarPolicy, getCastSpec, getDatabaseProduct, getNullCollation, getProduct, hasImplicitTableAlias, identifierNeedsToBeQuoted, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteStringLiteral, quoteStringLiteralUnicode, quoteTimestampLiteral, requiresAliasForFromItems, rewriteSingleValueExpr, supportsAggregateFunction, supportsAliasedValues, supportsCharSet, supportsFunction, supportsNestedAggregations, supportsOffsetFetch, unparseCall, unparseDateTimeLiteral, unparseFetchUsingAnsi, unparseFetchUsingLimit, unquoteStringLiteralpublic static final SqlDialect DEFAULT
private final boolean emulateNullDirection
public HiveSqlDialect(SqlDialect.Context context)
protected boolean allowsAs()
allowsAs 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 requiredCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.