Vladsz83 commented on code in PR #11467:
URL: https://github.com/apache/ignite/pull/11467#discussion_r1770620874


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/util/TypeUtils.java:
##########
@@ -236,20 +237,36 @@ public static RelDataType getResultType(IgniteTypeFactory 
typeFactory, RelOptSch
      * @param origin Column origin.
      * @return Result type.
      */
-    private static Type getResultClass(IgniteTypeFactory typeFactory, 
RelOptSchema schema, RelDataType type,
-        @Nullable List<String> origin) {
-        if (F.isEmpty(origin))
-            return typeFactory.getResultClass(type);
+    private static Type getResultClass(
+        IgniteTypeFactory typeFactory,
+        RelOptSchema schema,
+        RelDataType type,
+        @Nullable List<String> origin
+    ) {
+        int cnt = 0; // Counter to protect from infinite recursion.
+
+        while (true) {
+            if (F.isEmpty(origin) || cnt++ >= 100)
+                return typeFactory.getResultClass(type);

Review Comment:
   What happens if the threshold is reached? A wrong type? A type coercion or a 
cast error? Do we have a test for it? I tried MAX_VIEW_DEPTH == 1, 
MAX_VIEW_DEPTH == 0. All the related tests seem to work.



-- 
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]

Reply via email to