Repository: apache/flink
File: flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/ProcessTableFunctionSemanticTests.java (Java)

Code before:
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.flink.table.planner.plan.nodes.exec.stream;

import org.apache.flink.table.api.TableConfig;
import org.apache.flink.table.planner.plan.nodes.exec.testutils.SemanticTestBase;
import org.apache.flink.table.test.program.TableTestProgram;

import java.util.List;

/** Semantic tests for {@link StreamExecProcessTableFunction}. */
public class ProcessTableFunctionSemanticTests extends SemanticTestBase {

    // TODO [FLINK-38233]: Remove this override when PTF support in
    //  StreamNonDeterministicUpdatePlanVisitor is added.
    @Override
    protected void applyDefaultEnvironmentOptions(TableConfig config) {}

    @Override
    public List<TableTestProgram> programs() {
        return List.of(
                ProcessTableFunctionTestPrograms.PROCESS_SCALAR_ARGS,
                ProcessTableFunctionTestPrograms.PROCESS_SCALAR_ARGS_TABLE_API,
                ProcessTableFunctionTestPrograms.PROCESS_ROW_SEMANTIC_TABLE,
                ProcessTableFunctionTestPrograms.PROCESS_ROW_SEMANTIC_TABLE_TABLE_API,
                ProcessTableFunctionTestPrograms.PROCESS_ROW_SEMANTIC_TABLE_TABLE_API_INLINE,
                ProcessTableFunctionTestPrograms.PROCESS_ROW_SEMANTIC_TABLE_TABLE_API_INLINE_NAMED,
                ProcessTableFunctionTestPrograms.PROCESS_TYPED_ROW_SEMANTIC_TABLE,
                ProcessTableFunctionTestPrograms.PROCESS_TYPED_ROW_SEMANTIC_TABLE_TABLE_API,
                ProcessTableFunctionTestPrograms.PROCESS_SET_SEMANTIC_TABLE,
                ProcessTableFunctionTestPrograms.PROCESS_SET_SEMANTIC_TABLE_TABLE_API,
                ProcessTableFunctionTestPrograms.PROCESS_SET_SEMANTIC_TABLE_TABLE_API_INLINE,
                ProcessTableFunctionTestPrograms.PROCESS_SET_SEMANTIC_TABLE_TABLE_API_INLINE_NAMED,
                ProcessTableFunctionTestPrograms.PROCESS_TYPED_SET_SEMANTIC_TABLE,
                ProcessTableFunctionTestPrograms.PROCESS_TYPED_SET_SEMANTIC_TABLE_TABLE_API,
                ProcessTableFunctionTestPrograms.PROCESS_POJO_ARGS,
                ProcessTableFunctionTestPrograms.PROCESS_EMPTY_ARGS,
                ProcessTableFunctionTestPrograms.PROCESS_ROW_SEMANTIC_TABLE_PASS_THROUGH,
                ProcessTableFunctionTestPrograms.PROCESS_SET_SEMANTIC_TABLE_PASS_THROUGH,
                ProcessTableFunctionTestPrograms.PROCESS_UPDATING_INPUT_RETRACT,
                ProcessTableFunctionTestPrograms.PROCESS_UPDATING_INPUT_UPSERT,
                ProcessTableFunctionTestPrograms.PROCESS_UPDATING_INPUT_ENFORCED_RETRACT,

Review comment (performance):
do we need both the change in TableTestPrograms and this method? shouldn't a change here be enough? We also don't need to erase everything coming from the upper class, but only override `OptimizerConfigOptions.TABLE_OPTIMIZER_NONDETERMINISTIC_UPDATE_STRATEGY` but defer to `super` otherwise. 

Code after:
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.flink.table.planner.plan.nodes.exec.stream;

import org.apache.flink.table.api.TableConfig;
import org.apache.flink.table.api.config.OptimizerConfigOptions;
import org.apache.flink.table.planner.plan.nodes.exec.testutils.SemanticTestBase;
import org.apache.flink.table.test.program.TableTestProgram;

import java.util.List;

/** Semantic tests for {@link StreamExecProcessTableFunction}. */
public class ProcessTableFunctionSemanticTests extends SemanticTestBase {

    // TODO [FLINK-38233]: Remove this override when PTF support in
    //  StreamNonDeterministicUpdatePlanVisitor is added.
    @Override
    protected void applyDefaultEnvironmentOptions(TableConfig config) {
        super.applyDefaultEnvironmentOptions(config);
        config.set(
                OptimizerConfigOptions.TABLE_OPTIMIZER_NONDETERMINISTIC_UPDATE_STRATEGY,
                OptimizerConfigOptions.NonDeterministicUpdateStrategy.IGNORE);
    }

    @Override
    public List<TableTestProgram> programs() {
        return List.of(
                ProcessTableFunctionTestPrograms.PROCESS_SCALAR_ARGS,
                ProcessTableFunctionTestPrograms.PROCESS_SCALAR_ARGS_TABLE_API,
                ProcessTableFunctionTestPrograms.PROCESS_ROW_SEMANTIC_TABLE,
                ProcessTableFunctionTestPrograms.PROCESS_ROW_SEMANTIC_TABLE_TABLE_API,
                ProcessTableFunctionTestPrograms.PROCESS_ROW_SEMANTIC_TABLE_TABLE_API_INLINE,
                ProcessTableFunctionTestPrograms.PROCESS_ROW_SEMANTIC_TABLE_TABLE_API_INLINE_NAMED,
                ProcessTableFunctionTestPrograms.PROCESS_TYPED_ROW_SEMANTIC_TABLE,
                ProcessTableFunctionTestPrograms.PROCESS_TYPED_ROW_SEMANTIC_TABLE_TABLE_API,
                ProcessTableFunctionTestPrograms.PROCESS_SET_SEMANTIC_TABLE,
                ProcessTableFunctionTestPrograms.PROCESS_SET_SEMANTIC_TABLE_TABLE_API,
                ProcessTableFunctionTestPrograms.PROCESS_SET_SEMANTIC_TABLE_TABLE_API_INLINE,
                ProcessTableFunctionTestPrograms.PROCESS_SET_SEMANTIC_TABLE_TABLE_API_INLINE_NAMED,
                ProcessTableFunctionTestPrograms.PROCESS_TYPED_SET_SEMANTIC_TABLE,
                ProcessTableFunctionTestPrograms.PROCESS_TYPED_SET_SEMANTIC_TABLE_TABLE_API,
                ProcessTableFunctionTestPrograms.PROCESS_POJO_ARGS,