Class TeradataSqlDialect
- java.lang.Object
-
- org.apache.calcite.sql.SqlDialect
-
- org.apache.calcite.sql.dialect.TeradataSqlDialect
-
- com.amazonaws.athena.connectors.teradata.TeradataSqlDialect
-
public class TeradataSqlDialect extends org.apache.calcite.sql.dialect.TeradataSqlDialectCustom SQL dialect for Teradata that extends Calcite'sTeradataSqlDialectto handle Teradata-specific SQL generation for Athena query federation.This dialect overrides the default OFFSET/FETCH unparsing behavior because Teradata does not support standard SQL LIMIT, OFFSET, or FETCH NEXT clauses. Athena's query federation framework uses Calcite to generate SQL pushed down to the source database, and without this override, Calcite would emit OFFSET/FETCH syntax that Teradata cannot execute.
-
-
Constructor Summary
Constructors Constructor Description TeradataSqlDialect()Constructs a newTeradataSqlDialectusing theTeradataSqlDialect.DEFAULT_CONTEXTfrom Calcite's built-in Teradata dialect.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidunparseOffsetFetch(org.apache.calcite.sql.SqlWriter writer, @Nullable org.apache.calcite.sql.SqlNode offset, @Nullable org.apache.calcite.sql.SqlNode fetch)No-op override that suppresses OFFSET/FETCH clause generation.-
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, rewriteMaxMin, rewriteMaxMinExpr, rewriteSingleValueExpr, supportBooleanCaseWhen, supportsAggregateFunction, supportsAggregateFunctionFilter, supportsAliasedValues, supportsApproxCountDistinct, supportsCharSet, supportsDataType, supportsFunction, supportsGroupByLiteral, supportsGroupByWithCube, supportsGroupByWithRollup, supportsImplicitTypeCoercion, supportsJoinType, supportsNestedAggregations, supportsOffsetFetch, supportsTimestampPrecision, supportsWindowFunctions, unparseBoolLiteral, unparseCall, unparseDateTimeLiteral, unparseFetchUsingAnsi, unparseFetchUsingLimit, unparseLimit, unparseNumericLiteral, unparseOffset, unparseSqlDatetimeArithmetic, unparseSqlIntervalLiteral, unparseSqlIntervalQualifier, unparseSqlSetOption, unparseTableScanHints, unparseTopN, unquoteStringLiteral
-
-
-
-
Method Detail
-
unparseOffsetFetch
public void unparseOffsetFetch(org.apache.calcite.sql.SqlWriter writer, @Nullable org.apache.calcite.sql.SqlNode offset, @Nullable org.apache.calcite.sql.SqlNode fetch)No-op override that suppresses OFFSET/FETCH clause generation.Teradata does not support the standard SQL OFFSET/FETCH NEXT syntax. This method intentionally writes nothing to the
SqlWriter, preventing Calcite from emitting unsupported clauses in the pushed-down query.- Overrides:
unparseOffsetFetchin classorg.apache.calcite.sql.SqlDialect- Parameters:
writer- the SQL writer building the output queryoffset- the OFFSET node (ignored)fetch- the FETCH node (ignored)
-
-