twalthr commented on code in PR #29785:
URL: https://github.com/apache/flink/pull/29785#discussion_r4466970121
##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/codegen/calls/ScalarOperatorGens.scala:
##########
@@ -1808,12 +1809,18 @@ object ScalarOperatorGens {
variantTerm: String,
variantTypeTerm: String,
keyTerm: String,
+ indexTerm: String,
resultTerm: String,
nullTerm: String,
tmpValue: String): String = {
+ // The key may be a BIGINT. Narrowing it to int before the range check
would wrap an
+ // out-of-range key onto an existing element.
s"""
| if ($variantTerm.isArray()){
- | $variantTypeTerm $tmpValue = $variantTerm.getElement((int)
$keyTerm - 1);
+ | long $indexTerm = $keyTerm - 1L;
Review Comment:
Don't we know the keyType upfront? We can skip this check for interger key
type.
--
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]