zhangxinyao88 commented on code in PR #59346:
URL: https://github.com/apache/spark/pull/59346#discussion_r4244511953
##########
common/unsafe/src/main/java/org/apache/spark/sql/catalyst/util/CollationAwareUTF8String.java:
##########
@@ -928,8 +928,9 @@ public static int indexOf(final UTF8String target, final
UTF8String pattern,
public static int indexOf(final UTF8String target, final UTF8String pattern,
final int start, final int occurrence, final int collationId) {
assert occurrence > 0;
+ if (start == 0) return MATCH_NOT_FOUND;
if (pattern.numBytes() == 0) return target.indexOfEmpty(start);
- if (target.numBytes() == 0 || start == 0) return MATCH_NOT_FOUND;
+ if (target.numBytes() == 0) return MATCH_NOT_FOUND;
Review Comment:
Is this the cleanest solution?
--
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]