Package org.apache.calcite.sql.dialect
Class StarRocksSqlDialect
java.lang.Object
org.apache.calcite.sql.SqlDialect
org.apache.calcite.sql.dialect.MysqlSqlDialect
org.apache.calcite.sql.dialect.StarRocksSqlDialect
- Direct Known Subclasses:
DorisSqlDialect
A
SqlDialect implementation for the StarRocks 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
FieldsModifier and TypeFieldDescriptionstatic final SqlDialectstatic final SqlDialect.Contextstatic final RelDataTypeSystemStarRocks type system.Fields inherited from class org.apache.calcite.sql.dialect.MysqlSqlDialect
ISNULL_FUNCTION, MYSQL_TYPE_SYSTEMFields inherited from class org.apache.calcite.sql.SqlDialect
BUILT_IN_OPERATORS_LIST, EMPTY_CONTEXT, identifierEndQuoteString, identifierEscapedQuote, identifierQuoteString, literalEndQuoteString, literalEscapedQuote, literalQuoteString, LOGGER, nullCollation -
Constructor Summary
ConstructorsConstructorDescriptionStarRocksSqlDialect(SqlDialect.Context context) Creates a StarRocksSqlDialect. -
Method Summary
Modifier and TypeMethodDescription@Nullable SqlNodegetCastSpec(RelDataType type) Returns SqlNode for type in "cast(column as type)", which might be different between databases by type name, precision etc.prepareUnparse(RexNode arg) booleanReturns whether this dialect supports APPROX_COUNT_DISTINCT functions.booleanReturns whether this dialect supports "WITH ROLLUP" in the "GROUP BY" clause.booleansupportsJoinType(JoinRelType joinType) Returns whether this dialect support the specified type of join.booleanReturns whether this dialect supports TIMESTAMP with precision.voidunparseCall(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec) voidunparseDateTimeLiteral(SqlWriter writer, SqlAbstractDateTimeLiteral literal, int leftPrec, int rightPrec) Methods inherited from class org.apache.calcite.sql.dialect.MysqlSqlDialect
emulateNullDirection, getCalendarPolicy, requiresAliasForFromItems, rewriteSingleValueExpr, supportsAggregateFunction, supportsAggregateFunctionFilter, supportsAliasedValues, supportsCharSet, supportsNestedAggregations, unparseOffsetFetch, unparseSqlIntervalQualifierMethods inherited from class org.apache.calcite.sql.SqlDialect
allowsAs, configureParser, configureParser, containsNonAscii, create, defaultNullDirection, emulateJoinTypeForCrossJoin, emulateNullDirectionWithIsNull, getConformance, getDatabaseProduct, getFormatModel, getNullCollation, getProduct, getQuotedCasing, getQuoting, getSingleRowTableName, getTypeSystem, getUnquotedCasing, hasImplicitTableAlias, identifierNeedsQuote, isCaseSensitive, quoteIdentifier, quoteIdentifier, quoteIdentifier, quoteStringLiteral, quoteStringLiteral, quoteStringLiteralUnicode, quoteTimestampLiteral, rewriteMaxMin, rewriteMaxMinExpr, supportBooleanCaseWhen, supportsDataType, supportsFunction, supportsGroupByLiteral, supportsGroupByWithCube, supportsImplicitTypeCoercion, supportsOffsetFetch, supportsWindowFunctions, unparseBoolLiteral, unparseFetchUsingAnsi, unparseFetchUsingLimit, unparseLimit, unparseNumericLiteral, unparseOffset, unparseSqlDatetimeArithmetic, unparseSqlIntervalLiteral, unparseSqlSetOption, unparseTableScanHints, unparseTopN, unquoteStringLiteral
-
Field Details
-
STARROCKS_TYPE_SYSTEM
StarRocks type system. -
DEFAULT_CONTEXT
-
DEFAULT
-
-
Constructor Details
-
StarRocksSqlDialect
Creates a StarRocksSqlDialect.
-
-
Method Details
-
supportsGroupByWithRollup
public boolean supportsGroupByWithRollup()Description copied from class:SqlDialectReturns whether this dialect supports "WITH ROLLUP" in the "GROUP BY" clause.For instance, in MySQL version 5,
SELECT deptno, job, COUNT(*) AS c FROM emp GROUP BY deptno, job WITH ROLLUPis equivalent to standard SQL
SELECT deptno, job, COUNT(*) AS c FROM emp GROUP BY ROLLUP(deptno, job) ORDER BY deptno, jobThe "WITH ROLLUP" clause was introduced in MySQL and is not standard SQL.
See also
SqlDialect.supportsAggregateFunction(SqlKind)applied toSqlKind.ROLLUP, which returns true in MySQL 8 and higher.- Overrides:
supportsGroupByWithRollupin classMysqlSqlDialect
-
supportsTimestampPrecision
public boolean supportsTimestampPrecision()Description copied from class:SqlDialectReturns whether this dialect supports TIMESTAMP with precision.- Overrides:
supportsTimestampPrecisionin classSqlDialect
-
supportsApproxCountDistinct
public boolean supportsApproxCountDistinct()Description copied from class:SqlDialectReturns whether this dialect supports APPROX_COUNT_DISTINCT functions.- Overrides:
supportsApproxCountDistinctin classSqlDialect
-
supportsJoinType
Description copied from class:SqlDialectReturns whether this dialect support the specified type of join.- Overrides:
supportsJoinTypein classMysqlSqlDialect
-
prepareUnparse
Description copied from class:SqlDialect- Overrides:
prepareUnparsein classSqlDialect
-
unparseCall
- Overrides:
unparseCallin classMysqlSqlDialect
-
getCastSpec
Description copied from class:SqlDialectReturns 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 asNULL.- Overrides:
getCastSpecin classMysqlSqlDialect
-
unparseDateTimeLiteral
public void unparseDateTimeLiteral(SqlWriter writer, SqlAbstractDateTimeLiteral literal, int leftPrec, int rightPrec) - Overrides:
unparseDateTimeLiteralin classSqlDialect
-