slinkydeveloper commented on a change in pull request #19137:
URL: https://github.com/apache/flink/pull/19137#discussion_r831067054



##########
File path: 
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/calcite/FlinkRelBuilder.java
##########
@@ -105,6 +116,55 @@ public static RelBuilderFactory proto(Context context) {
         };
     }
 
+    /**
+     * {@link RelBuilder#functionScan(SqlOperator, int, Iterable)} cannot work 
smoothly with aliases
+     * which is why we implement a custom one. The method is static because 
some {@link RelOptRule}s
+     * doesn't use {@link FlinkRelBuilder}.
+     */
+    @SuppressWarnings({"rawtypes", "unchecked"})
+    public static RelBuilder pushFunctionScan(
+            RelBuilder relBuilder,
+            SqlOperator operator,
+            int inputCount,
+            Iterable<? extends RexNode> operands,

Review comment:
       Just remove the bound check here so you can remove the suppress warnings?

##########
File path: 
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/runtime/stream/table/FunctionITCase.java
##########
@@ -28,24 +28,20 @@
 import org.apache.flink.table.planner.runtime.utils.StreamingTestBase;
 import org.apache.flink.types.Row;
 
-import org.junit.Rule;
 import org.junit.Test;
-import org.junit.rules.ExpectedException;
 
 import java.util.Arrays;
 import java.util.List;
 
+import static org.apache.flink.core.testutils.FlinkAssertions.anyCauseMatches;
 import static org.apache.flink.table.api.Expressions.$;
 import static org.apache.flink.table.api.Expressions.call;
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.junit.internal.matchers.ThrowableMessageMatcher.hasMessage;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
 /** Tests for user defined functions in the Table API. */
 public class FunctionITCase extends StreamingTestBase {
 
-    @Rule public ExpectedException thrown = ExpectedException.none();
-
     @Test

Review comment:
       Use JUnit 5




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