Package org.apache.calcite.sql.dialect
Class SnowflakeSqlDialect
java.lang.Object
org.apache.calcite.sql.SqlDialect
org.apache.calcite.sql.dialect.SnowflakeSqlDialect
A
SqlDialect implementation for the Snowflake 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
ConstructorsConstructorDescriptionSnowflakeSqlDialect(SqlDialect.Context context) Creates a SnowflakeSqlDialect. -
Method Summary
Modifier and TypeMethodDescriptionstatic SqlNoderewriteMaxMin(SqlNode aggCall, RelDataType relDataType) Helper for rewrites of MAX/MIN.rewriteMaxMinExpr(SqlNode aggCall, RelDataType relDataType) Rewrites MAX(x)/MIN(x) as BOOL_OR(x)/BOOL_AND(x) for certain database variants (Postgres and Redshift, currently).booleanReturns whether this dialect supports APPROX_COUNT_DISTINCT functions.voidunparseCall(SqlWriter writer, SqlCall call, 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
allowsAs, configureParser, configureParser, containsNonAscii, create, defaultNullDirection, emulateJoinTypeForCrossJoin, emulateNullDirection, emulateNullDirectionWithIsNull, getCalendarPolicy, getCastSpec, getConformance, getDatabaseProduct, getFormatModel, getNullCollation, getProduct, getQuotedCasing, getQuoting, getSingleRowTableName, getTypeSystem, getUnquotedCasing, hasImplicitTableAlias, identifierNeedsQuote, isCaseSensitive, prepareUnparse, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteStringLiteral, quoteStringLiteral, quoteStringLiteralUnicode, quoteTimestampLiteral, requiresAliasForFromItems, rewriteSingleValueExpr, supportBooleanCaseWhen, supportsAggregateFunction, supportsAggregateFunctionFilter, supportsAliasedValues, supportsCharSet, supportsDataType, supportsFunction, supportsGroupByLiteral, supportsGroupByWithCube, supportsGroupByWithRollup, supportsImplicitTypeCoercion, supportsJoinType, supportsNestedAggregations, supportsOffsetFetch, supportsTimestampPrecision, supportsWindowFunctions, unparseBoolLiteral, unparseDateTimeLiteral, unparseFetchUsingAnsi, unparseFetchUsingLimit, unparseLimit, unparseNumericLiteral, unparseOffset, unparseSqlDatetimeArithmetic, unparseSqlIntervalLiteral, unparseSqlIntervalQualifier, unparseSqlSetOption, unparseTableScanHints, unparseTopN, unquoteStringLiteral
-
Field Details
-
DEFAULT_CONTEXT
-
DEFAULT
-
-
Constructor Details
-
SnowflakeSqlDialect
Creates a SnowflakeSqlDialect.
-
-
Method Details
-
unparseCall
- Overrides:
unparseCallin classSqlDialect
-
rewriteMaxMinExpr
Description copied from class:SqlDialectRewrites MAX(x)/MIN(x) as BOOL_OR(x)/BOOL_AND(x) for certain database variants (Postgres and Redshift, currently).- Overrides:
rewriteMaxMinExprin classSqlDialect- See Also:
-
rewriteMaxMin
Helper for rewrites of MAX/MIN. Snowflake, rewrite as BOOLOR_AGG/BOOLAND_AGG if the return type is BOOLEAN. -
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:
-
supportsApproxCountDistinct
public boolean supportsApproxCountDistinct()Description copied from class:SqlDialectReturns whether this dialect supports APPROX_COUNT_DISTINCT functions.- Overrides:
supportsApproxCountDistinctin classSqlDialect
-