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 |
BUILT_IN_OPERATORS_LIST, 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. |
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` . |
void |
unparseCall(SqlWriter writer,
SqlCall call,
int leftPrec,
int rightPrec) |
void |
unparseOffsetFetch(SqlWriter writer,
SqlNode offset,
SqlNode fetch)
Converts an offset and fetch into SQL.
|
configureParser, create, defaultNullDirection, emptyContext, emulateJoinTypeForCrossJoin, emulateNullDirectionWithIsNull, getCalendarPolicy, getCastSpec, getConformance, getDatabaseProduct, getNullCollation, getProduct, getQuotedCasing, getQuoting, getTypeSystem, getUnquotedCasing, hasImplicitTableAlias, isCaseSensitive, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteStringLiteral, quoteStringLiteralUnicode, quoteTimestampLiteral, requiresAliasForFromItems, rewriteSingleValueExpr, supportsAggregateFunction, supportsAliasedValues, supportsFunction, supportsGroupByWithCube, supportsGroupByWithRollup, supportsNestedAggregations, supportsOffsetFetch, supportsWindowFunctions, unparseDateTimeLiteral, unparseFetchUsingAnsi, unparseFetchUsingLimit, unparseSqlDatetimeArithmetic, unparseSqlIntervalLiteral, unparseSqlIntervalQualifier, unquoteStringLiteral
public static final SqlDialect DEFAULT
private final boolean emulateNullDirection
public HiveSqlDialect(SqlDialect.Context context)
protected boolean allowsAs()
allowsAs
in class SqlDialect
public void unparseOffsetFetch(SqlWriter writer, SqlNode offset, SqlNode fetch)
SqlDialect
At 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 SqlDialect
writer
- 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)
SqlDialect
null
if no emulation needs to be done.emulateNullDirection
in class SqlDialect
node
- The SqlNode representing the expressionnullsFirst
- Whether nulls should come firstdesc
- Whether the sort direction is
RelFieldCollation.Direction.DESCENDING
or
RelFieldCollation.Direction.STRICTLY_DESCENDING
null
if not requiredpublic void unparseCall(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec)
unparseCall
in class SqlDialect
public boolean supportsCharSet()
SqlDialect
VARCHAR(30) CHARACTER SET `ISO-8859-1`
.supportsCharSet
in class SqlDialect
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.