ILuffZhe commented on code in PR #4123:
URL: https://github.com/apache/calcite/pull/4123#discussion_r1903178305
##########
core/src/main/java/org/apache/calcite/sql/dialect/StarRocksSqlDialect.java:
##########
@@ -41,9 +43,32 @@
*/
public class StarRocksSqlDialect extends MysqlSqlDialect {
+ public static final RelDataTypeSystem STARROCKS_TYPE_SYSTEM =
+ new RelDataTypeSystemImpl() {
+ @Override public int getMaxPrecision(SqlTypeName typeName) {
+ switch (typeName) {
+ case CHAR:
+ return 255;
+ case VARCHAR:
+ return 65533;
+ case VARBINARY:
Review Comment:
Is `VARBINARY` different from what in MySQL? I noticed this is the only
difference, maybe MySQL and StarRocks can share this type system to get max
precision.
##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -3747,6 +3747,30 @@ private SqlDialect nonOrdinalDialect() {
sql(query).dialect(mySqlDialect(NullCollation.LAST)).ok(expected);
}
+ @Test void testStarRocksCastToVarcharWithLessThanMaxPrecision() {
Review Comment:
Do we need tests to cover `CHAR` and `VARBINARY` types?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]