keriharris opened a new pull request, #17275:
URL: https://github.com/apache/pinot/pull/17275
The Pinot JDBC driver implements the `getDriverMajorVersion` and
`getDriverMinorVersion` methods using `Spring.split`:
```java
@Override
public int getDriverMajorVersion() {
return Integer.parseInt(DRIVER_VERSION.split(".")[0]);
}
@Override
public int getDriverMinorVersion() {
return Integer.parseInt(DRIVER_VERSION.split(".")[1]);
}
```
`String.split` takes an argument representing a regex. The dot ('.')
character needs to be escaped, otherwise it represents any character leading to
`String.split` returning an empty array. This causes the above methods to throw
an exception:
```
java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at
org.apache.pinot.client.PinotConnectionMetaData.getDriverMajorVersion(PinotConnectionMetaData.java:90)
at
org.apache.pinot.client.PinotConnectionTest.getMetaDataTest(PinotConnectionTest.java:64)
```
--
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]