SinyoWong commented on code in PR #5865:
URL: https://github.com/apache/seatunnel/pull/5865#discussion_r1396881682
##########
seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/writer/OrcWriteStrategy.java:
##########
@@ -74,13 +74,14 @@ public void write(@NonNull SeaTunnelRow seaTunnelRow) {
Writer writer = getOrCreateWriter(filePath);
TypeDescription schema = buildSchemaWithRowType();
VectorizedRowBatch rowBatch = schema.createRowBatch();
- int i = 0;
int row = rowBatch.size++;
- for (Integer index : sinkColumnsIndexInRow) {
- Object value = seaTunnelRow.getField(index);
- ColumnVector vector = rowBatch.cols[i];
- setColumn(value, vector, row);
- i++;
+ for (int i = 0; i < sinkColumnsIndexInRow.size(); i++) {
+ Integer index = sinkColumnsIndexInRow.indexOf(i);
+ if (index != null) {
+ Object value = seaTunnelRow.getField(index);
+ ColumnVector vector = rowBatch.cols[i];
+ setColumn(value, vector, row);
+ }
Review Comment:
It's my mistake to use method indexOf() instead of get().
Already updated.
Thks a lot.
--
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]