Class FireboltSqlDialect

java.lang.Object
org.apache.calcite.sql.SqlDialect
org.apache.calcite.sql.dialect.FireboltSqlDialect

public class FireboltSqlDialect extends SqlDialect
A SqlDialect implementation for the Firebolt database.
  • Field Details

  • Constructor Details

    • FireboltSqlDialect

      public FireboltSqlDialect(SqlDialect.Context context)
      Creates a FireboltSqlDialect.
  • Method Details

    • supportsCharSet

      public boolean supportsCharSet()
      Description copied from class: SqlDialect
      Returns whether the dialect supports character set names as part of a data type, for instance VARCHAR(30) CHARACTER SET `ISO-8859-1`.
      Overrides:
      supportsCharSet in class SqlDialect
    • unparseOffsetFetch

      public void unparseOffsetFetch(SqlWriter writer, @Nullable SqlNode offset, @Nullable SqlNode fetch)
      Description copied from class: SqlDialect
      Converts an offset and fetch into SQL.

      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)
      Overrides:
      unparseOffsetFetch in class SqlDialect
      Parameters:
      writer - Writer
      offset - Number of rows to skip before emitting, or null
      fetch - Number of rows to fetch, or null
      See Also:
    • supportsAggregateFunction

      public boolean supportsAggregateFunction(SqlKind kind)
      Overrides:
      supportsAggregateFunction in class SqlDialect
    • identifierNeedsQuote

      protected boolean identifierNeedsQuote(String val)
      Description copied from class: SqlDialect
      Returns whether to quote an identifier. By default, all identifiers are quoted.
      Overrides:
      identifierNeedsQuote in class SqlDialect
    • getCastSpec

      public @Nullable SqlNode getCastSpec(RelDataType type)
      Description copied from class: SqlDialect
      Returns SqlNode for type in "cast(column as type)", which might be different between databases by type name, precision etc.

      If this method returns null, the cast will be omitted. In the default implementation, this is the case for the NULL type, and therefore CAST(NULL AS <nulltype>) is rendered as NULL.

      Overrides:
      getCastSpec in class SqlDialect
    • supportsAggregateFunctionFilter

      public boolean supportsAggregateFunctionFilter()
      Description copied from class: SqlDialect
      Returns whether this dialect supports the use of FILTER clauses for aggregate functions. e.g. COUNT(*) FILTER (WHERE a = 2).
      Overrides:
      supportsAggregateFunctionFilter in class SqlDialect
    • supportsFunction

      public boolean supportsFunction(SqlOperator operator, RelDataType type, List<RelDataType> paramTypes)
      Description copied from class: SqlDialect
      Returns whether this dialect supports a given function or operator. It only applies to built-in scalar functions and operators, since user-defined functions and procedures should be read by JdbcSchema.
      Overrides:
      supportsFunction in class SqlDialect
    • unparseCall

      public void unparseCall(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec)
      Overrides:
      unparseCall in class SqlDialect
    • unparseSqlIntervalLiteral

      public void unparseSqlIntervalLiteral(SqlWriter writer, SqlIntervalLiteral literal, int leftPrec, int rightPrec)
      Firebolt interval syntax: sign INTERVAL int64 time_unit.
      Overrides:
      unparseSqlIntervalLiteral in class SqlDialect
    • unparseSqlIntervalQualifier

      public void unparseSqlIntervalQualifier(SqlWriter writer, SqlIntervalQualifier qualifier, RelDataTypeSystem typeSystem)
      Description copied from class: SqlDialect
      Converts an interval qualifier to a SQL string. The default implementation returns strings such as INTERVAL '1 2:3:4' DAY(4) TO SECOND(4).
      Overrides:
      unparseSqlIntervalQualifier in class SqlDialect