Admaing opened a new pull request, #30251:
URL: https://github.com/apache/flink/pull/30251

   ## What is the purpose of the change
   
   Fixes [FLINK-41786](https://issues.apache.org/jira/browse/FLINK-41786). 
`SIGN` and `TRUNCATE` over `TINYINT` and `SMALLINT` values failed during code 
generation because the planner selected the `INTEGER` runtime overloads. The 
generated expression assigned an `int` result to a `byte` or `short` and failed 
with `CompileException: Assignment conversion not possible`.
   
   ## Brief change log
   
   - Add `byte` and `short` overloads for `SIGN` and both one- and two-argument 
`TRUNCATE` in `SqlFunctionUtils`.
   - Register those overloads in `FunctionGenerator` so code generation 
preserves the argument type.
   - Extend `MathFunctionsITCase` with `TINYINT` and `SMALLINT` coverage 
through both the Table API and SQL.
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
   - Before the fix, the new `MathFunctionsITCase` cases failed with 18 
`CompileException`s for conversions from `int` to `byte`/`short`.
   - After the fix, `MathFunctionsITCase` passes: 95 tests, 0 failures, 0 
errors.
   - `./mvnw -pl 
flink-table/flink-table-runtime,flink-table/flink-table-planner spotless:apply` 
passes.
   - `./mvnw -pl 
flink-table/flink-table-runtime,flink-table/flink-table-planner 
checkstyle:check -T1C` passes with 0 violations.
   
   ## Does this pull request potentially affect one of the following parts:
   
   - Dependencies (does it add or upgrade a dependency): no
   - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: no
   - The serializers: no
   - The runtime per-record code paths (performance sensitive): no existing 
working path changes; the previously failing `TINYINT`/`SMALLINT` calls now use 
type-preserving overloads
   - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
   - The S3 file system connector: no
   
   ## Documentation
   
   - Does this pull request introduce a new feature? no
   - If yes, how is the feature documented? not applicable
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] Yes (please specify the tool below)
   
   Generated-by: Codex CLI 0.169.0-alpha.11.1
   


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