Repository: apache/flink
File: flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/MiscFunctionsITCase.java (Java)

Code before:
                                "Duplicate named argument found: s"),
                TestSetSpec.forExpression("position-based optional argument")
                        .onFieldsWithData(12)
                        .andDataTypes(DataTypes.INT().notNull())
                        .testTableApiResult(
                                call(OptionalArgAtEndFunction.class, $("f0")),
                                "i=12,optional=null",
                                DataTypes.STRING()),
                TestSetSpec.forFunction(BuiltInFunctionDefinitions.ENCODE)
                        .onFieldsWithData(null, "Hello world", "utf-8")
                        .andDataTypes(
                                DataTypes.STRING().nullable(),
                                DataTypes.STRING(),
                                DataTypes.STRING())
                        .testResult(
                                $("f0").encode($("f2")),
                                "ENCODE(f0, f2)",
                                null,
                                DataTypes.BYTES().nullable())
                        .testResult(
                                $("f1").encode($("f2")),
                                "ENCODE(f1, f2)",
                                "Hello world".getBytes(StandardCharsets.UTF_8),
                                DataTypes.BYTES().nullable())
                        .testResult(
                                // test for static values
                                lit("Hello world").encode($("f2")),
                                "ENCODE('Hello world', f2)",
                                "Hello world".getBytes(StandardCharsets.UTF_8),
                                DataTypes.BYTES().nullable()),
                TestSetSpec.forFunction(BuiltInFunctionDefinitions.DECODE)
                        .onFieldsWithData(
                                null, "Hello world".getBytes(StandardCharsets.UTF_8), "utf-8")
                        .andDataTypes(
                                DataTypes.BYTES().nullable(), DataTypes.BYTES(), DataTypes.STRING())
                        .testResult(
                                $("f0").decode($("f2")),
                                "DECODE(f0, f2)",
                                null,
                                DataTypes.STRING().nullable())
                        .testResult(
                                $("f1").decode($("f2")),
                                "DECODE(f1, f2)",
                                "Hello world",
                                DataTypes.STRING().nullable())
                        .testResult(
                                // test for static values
                                lit("Hello world".getBytes(StandardCharsets.UTF_8)).decode($("f2")),
                                "DECODE(" + toHexString("Hello world") + ", f2)",
                                "Hello world",
                                DataTypes.STRING().nullable()));

Review comment (suggestion):
```suggestion
                                // test for literal values
```

Code after:
                                        $("f2").asArgument("s")),
                                "Duplicate named argument found: s"),
                TestSetSpec.forExpression("position-based optional argument")
                        .onFieldsWithData(12)
                        .andDataTypes(DataTypes.INT().notNull())
                        .testTableApiResult(
                                call(OptionalArgAtEndFunction.class, $("f0")),
                                "i=12,optional=null",
                                DataTypes.STRING()),
                TestSetSpec.forFunction(BuiltInFunctionDefinitions.ENCODE)
                        .onFieldsWithData(null, "Hello world", "utf-8")
                        .andDataTypes(
                                DataTypes.STRING().nullable(),
                                DataTypes.STRING(),
                                DataTypes.STRING())
                        .testResult(
                                $("f0").encode($("f2")),
                                "ENCODE(f0, f2)",
                                null,
                                DataTypes.BYTES().nullable())
                        .testResult(
                                $("f1").encode($("f2")),
                                "ENCODE(f1, f2)",
                                "Hello world".getBytes(StandardCharsets.UTF_8),
                                DataTypes.BYTES().nullable())
                        .testResult(
                                // test for literal values
                                lit("Hello world").encode($("f2")),
                                "ENCODE('Hello world', f2)",
                                "Hello world".getBytes(StandardCharsets.UTF_8),
                                DataTypes.BYTES().nullable()),
                TestSetSpec.forFunction(BuiltInFunctionDefinitions.DECODE)
                        .onFieldsWithData(
                                null, "Hello world".getBytes(StandardCharsets.UTF_8), "utf-8")
                        .andDataTypes(
                                DataTypes.BYTES().nullable(), DataTypes.BYTES(), DataTypes.STRING())
                        .testResult(
                                $("f0").decode($("f2")),
                                "DECODE(f0, f2)",
                                null,
                                DataTypes.STRING().nullable())
                        .testResult(
                                $("f1").decode($("f2")),
                                "DECODE(f1, f2)",
                                "Hello world",
                                DataTypes.STRING().nullable())
                        .testResult(
                                // test for literal values
                                lit("Hello world".getBytes(StandardCharsets.UTF_8)).decode($("f2")),
                                "DECODE(x'" + EncodingUtils.hex("Hello world") + "', f2)",
                                "Hello world",