ChengJie1053 commented on code in PR #3944:
URL: https://github.com/apache/calcite/pull/3944#discussion_r1741323599
##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -3684,12 +3684,15 @@ private SqlDialect nonOrdinalDialect() {
String query = "select cast(\"product_id\" as char) from \"product\"";
final String expectedMysql = "SELECT CAST(`product_id` AS CHAR)\n"
+ "FROM `foodmart`.`product`";
+ final String expectedMssql = "SELECT CAST([product_id] AS CHAR)\n"
Review Comment:
Ok, thank you for helping me review the code, I will modify it
##########
core/src/main/java/org/apache/calcite/rel/type/RelDataTypeSystemImpl.java:
##########
@@ -57,7 +57,7 @@ public abstract class RelDataTypeSystemImpl implements
RelDataTypeSystem {
case INTERVAL_SECOND:
return SqlTypeName.MAX_INTERVAL_FRACTIONAL_SECOND_PRECISION;
default:
- return -1;
+ return RelDataType.PRECISION_NOT_SPECIFIED;
Review Comment:
Ok, thank you for helping me review the code, I will modify it
##########
core/src/main/java/org/apache/calcite/sql/dialect/MssqlSqlDialect.java:
##########
@@ -47,9 +50,22 @@
* database.
*/
public class MssqlSqlDialect extends SqlDialect {
+ /**
+ * Mssql type system.
+ */
+ public static final RelDataTypeSystem MSSQL_TYPE_SYSTEM =
+ new RelDataTypeSystemImpl() {
+ @Override public int getDefaultPrecision(SqlTypeName typeName) {
+ if (typeName == SqlTypeName.CHAR) {
+ return RelDataType.PRECISION_NOT_SPECIFIED;
Review Comment:
Ok, thank you for helping me review the code, I will modify it
--
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]