You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "zabetak (via GitHub)" <gi...@apache.org> on 2023/04/18 21:22:20 UTC

[GitHub] [calcite] zabetak commented on a diff in pull request #3155: [CALCITE-5650] Preserve typeSystem field when changing dialect in SqlToRelConverterTest

zabetak commented on code in PR #3155:
URL: https://github.com/apache/calcite/pull/3155#discussion_r1170582001


##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -6840,6 +6828,20 @@ Sql withSpark() {
       return dialect(DatabaseProduct.SPARK.getDialect());
     }
 
+    Sql withRedshiftHighPrecision() {
+      SqlDialect.Context context =
+          RedshiftSqlDialect.DEFAULT_CONTEXT.withDataTypeSystem(new RelDataTypeSystemImpl() {
+            @Override
+            public int getMaxNumericPrecision() {
+              // Ensures that parsed decimal will not be truncated during SQL to Rel transformation
+              // The default type system sets precision to 19 so it is not sufficient to test
+              // this change.
+              return 100;
+            }
+          });
+      return dialect(new RedshiftSqlDialect(context));
+    }
+

Review Comment:
   Probably we don't need this at all. If we get the `typesystem` from the dialect as you did in L6947 we could just use the normal Redshift dialect without changing its default `typesystem`. The test results will not change.



-- 
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: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org