dongjoon-hyun commented on code in PR #1305:
URL: https://github.com/apache/orc/pull/1305#discussion_r1014989813
##########
java/core/src/java/org/apache/orc/impl/ConvertTreeReaderFactory.java:
##########
@@ -118,62 +121,62 @@ protected void
assignStringGroupVectorEntry(BytesColumnVector bytesColVector,
* length for the string group which can be (STRING, CHAR, VARCHAR).
*/
protected void assignStringGroupVectorEntry(BytesColumnVector
bytesColVector,
- int elementNum, TypeDescription readerType, byte[] bytes, int start,
int length) {
+ int elementNum,
+ TypeDescription readerType,
+ byte[] bytes,
+ int start,
+ int length) {
switch (readerType.getCategory()) {
- case STRING:
- bytesColVector.setVal(elementNum, bytes, start, length);
- break;
- case CHAR:
- {
+ case STRING:
+ bytesColVector.setVal(elementNum, bytes, start, length);
+ break;
+ case CHAR: {
int adjustedDownLen =
StringExpr.rightTrimAndTruncate(bytes, start, length,
readerType.getMaxLength());
bytesColVector.setVal(elementNum, bytes, start, adjustedDownLen);
+ break;
}
- break;
- case VARCHAR:
- {
+ case VARCHAR: {
int adjustedDownLen =
StringExpr.truncate(bytes, start, length,
readerType.getMaxLength());
bytesColVector.setVal(elementNum, bytes, start, adjustedDownLen);
+ break;
}
- break;
- default:
- throw new RuntimeException("Unexpected type kind " +
readerType.getCategory().name());
+ default:
+ throw new RuntimeException("Unexpected type kind " +
readerType.getCategory().name());
}
}
protected void convertStringGroupVectorElement(BytesColumnVector
bytesColVector,
- int elementNum, TypeDescription readerType) {
+ int elementNum,
TypeDescription readerType) {
switch (readerType.getCategory()) {
- case STRING:
- // No conversion needed.
- break;
- case CHAR:
- {
+ case STRING:
+ // No conversion needed.
+ break;
+ case CHAR: {
int length = bytesColVector.length[elementNum];
int adjustedDownLen = StringExpr
- .rightTrimAndTruncate(bytesColVector.vector[elementNum],
- bytesColVector.start[elementNum], length,
- readerType.getMaxLength());
+ .rightTrimAndTruncate(bytesColVector.vector[elementNum],
+ bytesColVector.start[elementNum], length,
+ readerType.getMaxLength());
if (adjustedDownLen < length) {
bytesColVector.length[elementNum] = adjustedDownLen;
}
+ break;
Review Comment:
ditto.
--
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]