Class SAPHanaSqlDialect
- java.lang.Object
-
- org.apache.calcite.sql.SqlDialect
-
- org.apache.calcite.sql.dialect.PostgresqlSqlDialect
-
- com.amazonaws.athena.connectors.saphana.SAPHanaSqlDialect
-
public class SAPHanaSqlDialect extends org.apache.calcite.sql.dialect.PostgresqlSqlDialectCalcite SQL dialect for SAP HANA (Calcite 1.40.0). Behavior: - Unquoted identifiers are folded to UPPERCASE - Quoted identifiers preserve case - BOOLEAN MAX/MIN rewritten to BOOL aggregations - OFFSET/FETCH rendered as LIMIT/OFFSET
-
-
Field Summary
Fields Modifier and Type Field Description static SAPHanaSqlDialectDEFAULTstatic org.apache.calcite.sql.SqlDialect.ContextDEFAULT_CONTEXT
-
Constructor Summary
Constructors Constructor Description SAPHanaSqlDialect(org.apache.calcite.sql.SqlDialect.Context context, boolean upperCaseFilterApplied)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringBuilderquoteIdentifier(StringBuilder buf, String identifier)org.apache.calcite.sql.SqlNoderewriteMaxMinExpr(org.apache.calcite.sql.SqlNode aggCall, org.apache.calcite.rel.type.RelDataType relDataType)Rewrite MAX/MIN(boolean) since SAP HANA does not support MAX/MIN on BOOLEAN types.booleansupportsApproxCountDistinct()voidunparseCall(org.apache.calcite.sql.SqlWriter writer, org.apache.calcite.sql.SqlCall call, int leftPrec, int rightPrec)voidunparseOffsetFetch(org.apache.calcite.sql.SqlWriter writer, @Nullable org.apache.calcite.sql.SqlNode offset, @Nullable org.apache.calcite.sql.SqlNode fetch)-
Methods inherited from class org.apache.calcite.sql.dialect.PostgresqlSqlDialect
getCastSpec, requiresAliasForFromItems, rewriteSingleValueExpr, supportsCharSet, supportsFunction, supportsGroupByLiteral, supportsImplicitTypeCoercion, supportsNestedAggregations, unparseSqlSetOption
-
Methods inherited from class org.apache.calcite.sql.SqlDialect
allowsAs, configureParser, configureParser, containsNonAscii, create, defaultNullDirection, emulateJoinTypeForCrossJoin, emulateNullDirection, emulateNullDirectionWithIsNull, getCalendarPolicy, getConformance, getDatabaseProduct, getFormatModel, getNullCollation, getProduct, getQuotedCasing, getQuoting, getSingleRowTableName, getTypeSystem, getUnquotedCasing, hasImplicitTableAlias, identifierNeedsQuote, isCaseSensitive, prepareUnparse, quoteIdentifier, quoteIdentifier, quoteStringLiteral, quoteStringLiteral, quoteStringLiteralUnicode, quoteTimestampLiteral, rewriteMaxMin, supportBooleanCaseWhen, supportsAggregateFunction, supportsAggregateFunctionFilter, supportsAliasedValues, supportsDataType, supportsGroupByWithCube, supportsGroupByWithRollup, supportsJoinType, supportsOffsetFetch, supportsTimestampPrecision, supportsWindowFunctions, unparseBoolLiteral, unparseDateTimeLiteral, unparseFetchUsingAnsi, unparseFetchUsingLimit, unparseLimit, unparseNumericLiteral, unparseOffset, unparseSqlDatetimeArithmetic, unparseSqlIntervalLiteral, unparseSqlIntervalQualifier, unparseTableScanHints, unparseTopN, unquoteStringLiteral
-
-
-
-
Field Detail
-
DEFAULT_CONTEXT
public static final org.apache.calcite.sql.SqlDialect.Context DEFAULT_CONTEXT
-
DEFAULT
public static final SAPHanaSqlDialect DEFAULT
-
-
Method Detail
-
unparseCall
public void unparseCall(org.apache.calcite.sql.SqlWriter writer, org.apache.calcite.sql.SqlCall call, int leftPrec, int rightPrec)- Overrides:
unparseCallin classorg.apache.calcite.sql.dialect.PostgresqlSqlDialect
-
rewriteMaxMinExpr
public org.apache.calcite.sql.SqlNode rewriteMaxMinExpr(org.apache.calcite.sql.SqlNode aggCall, org.apache.calcite.rel.type.RelDataType relDataType)Rewrite MAX/MIN(boolean) since SAP HANA does not support MAX/MIN on BOOLEAN types. MAX(boolean) -> BOOLOR_AGG MIN(boolean) -> BOOLAND_AGG- Overrides:
rewriteMaxMinExprin classorg.apache.calcite.sql.dialect.PostgresqlSqlDialect
-
unparseOffsetFetch
public void unparseOffsetFetch(org.apache.calcite.sql.SqlWriter writer, @Nullable org.apache.calcite.sql.SqlNode offset, @Nullable org.apache.calcite.sql.SqlNode fetch)- Overrides:
unparseOffsetFetchin classorg.apache.calcite.sql.SqlDialect
-
supportsApproxCountDistinct
public boolean supportsApproxCountDistinct()
- Overrides:
supportsApproxCountDistinctin classorg.apache.calcite.sql.SqlDialect
-
quoteIdentifier
public StringBuilder quoteIdentifier(StringBuilder buf, String identifier)
- Overrides:
quoteIdentifierin classorg.apache.calcite.sql.SqlDialect
-
-