mridulm commented on code in PR #37843:
URL: https://github.com/apache/spark/pull/37843#discussion_r970375264
##########
sql/catalyst/src/main/java/org/apache/spark/sql/connector/util/V2ExpressionSQLBuilder.java:
##########
@@ -393,10 +394,11 @@ private String[] expressionsToStringArray(Expression[]
expressions) {
return result;
}
- private List<String> expressionsToStringList(Expression[] expressions) {
- List<String> list = new ArrayList<>(expressions.length);
- for (Expression expression : expressions) {
- list.add(build(expression));
+ private List<String> expressionsToStringList(Expression[] expressions, int
offset, int length) {
+ List<String> list = new ArrayList<>(length);
+ while (offset < offset + length) {
+ list.add(build(expressions[offset]));
+ offset++;
Review Comment:
This looks wrong ...
Probably you meant something like :
```
final int till = Math.min(offset + length, expressions.length);
while (offset < till) {
list.add(build(expressions[offset]));
offset ++;
}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]