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


##########
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:
   An exception may be like "Unsupported views depth"? Should we limit this 
threshold somewhere at a view creation? Like MAX_VIEW_DEPTH = 10? 



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