Class SaphanaQueryStringBuilder
- java.lang.Object
-
- com.amazonaws.athena.connectors.jdbc.manager.JdbcSplitQueryBuilder
-
- com.amazonaws.athena.connectors.saphana.SaphanaQueryStringBuilder
-
public class SaphanaQueryStringBuilder extends JdbcSplitQueryBuilder
-
-
Field Summary
-
Fields inherited from class com.amazonaws.athena.connectors.jdbc.manager.JdbcSplitQueryBuilder
emptyString
-
-
Constructor Summary
Constructors Constructor Description SaphanaQueryStringBuilder(String quoteCharacters, FederationExpressionParser federationExpressionParser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PreparedStatementbuildSql(Connection jdbcConnection, String catalog, String schema, String table, org.apache.arrow.vector.types.pojo.Schema tableSchema, Constraints constraints, Split split)Common logic to build Split SQL including constraints translated in where clause.protected StringgetFromClauseWithSplit(String catalog, String schema, String table, Split split)protected List<String>getPartitionWhereClauses(Split split)protected org.apache.calcite.sql.SqlDialectgetSqlDialect()protected org.apache.calcite.sql.SqlDialectgetSqlDialect(boolean catalogCasingFilterApplied)Returns the SQL dialect to use for query generation with catalog casing filter support.protected Stringquote(String name)protected StringtoPredicate(String columnName, String operator, Object value, org.apache.arrow.vector.types.pojo.ArrowType type, List<TypeAndValue> accumulator)-
Methods inherited from class com.amazonaws.athena.connectors.jdbc.manager.JdbcSplitQueryBuilder
addPartitionWhereClauses, appendLimitOffset, appendLimitOffset, appendLimitOffsetWithValue, buildSQLStringLiteral, extractOrderByClause, prepareStatementWithCalciteSql, prepareStatementWithSql
-
-
-
-
Constructor Detail
-
SaphanaQueryStringBuilder
public SaphanaQueryStringBuilder(String quoteCharacters, FederationExpressionParser federationExpressionParser)
-
-
Method Detail
-
getFromClauseWithSplit
protected String getFromClauseWithSplit(String catalog, String schema, String table, Split split)
- Specified by:
getFromClauseWithSplitin classJdbcSplitQueryBuilder
-
getPartitionWhereClauses
protected List<String> getPartitionWhereClauses(Split split)
- Specified by:
getPartitionWhereClausesin classJdbcSplitQueryBuilder
-
buildSql
public PreparedStatement buildSql(Connection jdbcConnection, String catalog, String schema, String table, org.apache.arrow.vector.types.pojo.Schema tableSchema, Constraints constraints, Split split) throws SQLException
Description copied from class:JdbcSplitQueryBuilderCommon logic to build Split SQL including constraints translated in where clause.- Overrides:
buildSqlin classJdbcSplitQueryBuilder- Parameters:
jdbcConnection- JDBC connection. SeeConnection.catalog- Athena provided catalog name.schema- table schema name.table- table name.tableSchema- table schema (column and type information).constraints- constraints passed by Athena to push down.split- table split.- Returns:
- prepated statement with SQL. See
PreparedStatement. - Throws:
SQLException- JDBC database exception.
-
quote
protected String quote(String name)
- Overrides:
quotein classJdbcSplitQueryBuilder
-
getSqlDialect
protected org.apache.calcite.sql.SqlDialect getSqlDialect()
- Overrides:
getSqlDialectin classJdbcSplitQueryBuilder
-
getSqlDialect
protected org.apache.calcite.sql.SqlDialect getSqlDialect(boolean catalogCasingFilterApplied)
Description copied from class:JdbcSplitQueryBuilderReturns the SQL dialect to use for query generation with catalog casing filter support. Subclasses should override to return a database-specific dialect.- Overrides:
getSqlDialectin classJdbcSplitQueryBuilder- Parameters:
catalogCasingFilterApplied- whether to apply catalog casing to quoted identifiers- Returns:
- the
SqlDialectinstance
-
toPredicate
protected String toPredicate(String columnName, String operator, Object value, org.apache.arrow.vector.types.pojo.ArrowType type, List<TypeAndValue> accumulator)
- Overrides:
toPredicatein classJdbcSplitQueryBuilder
-
-