You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "guluo2016 (via GitHub)" <gi...@apache.org> on 2025/12/07 15:42:25 UTC
[I] [Bug] `ArrowFieldWriters.TimeWriter` ignores startIndex and reads incorrect rows [paimon]
guluo2016 opened a new issue, #6767:
URL: https://github.com/apache/paimon/issues/6767
### Search before asking
- [x] I searched in the [issues](https://github.com/apache/paimon/issues) and found nothing similar.
### Paimon version
master
### Compute Engine
None
### Minimal reproduce step
Description:
In `ArrowFieldWriters.TimeWriter`, the `doWrite` method uses wrong index `i` instead of `row` when reading from the source columnVector.
Impact:
When `startIndex > 0`, the writer reads incorrect values from the source column vector, causing data corruption in the Arrow output.
Reproduction:
```java
public static void main(String[] args) {
RowType rowType = new RowType(
Collections.singletonList(new DataField(0, "time_field", DataTypes.TIME())));
int startIndex = 2;
final int batchRows = 3;
try (RootAllocator allocator = new RootAllocator();
VectorSchemaRoot vsr = ArrowUtils.createVectorSchemaRoot(rowType, allocator)) {
ArrowFieldWriter[] fieldWriters = ArrowUtils.createArrowFieldWriters(vsr, rowType);
IntColumnVector timeVec = new IntColumnVector() {
final int[] values = new int[] {0, 1000, 2000, 3000, 4000};
@Override public int getInt(int i) { return values[i]; }
@Override public boolean isNullAt(int i) { return false; }
};
fieldWriters[0].write(timeVec, null, 2, batchRows);
vsr.setRowCount(batchRows);
TimeMilliVector timeMilliVector = (TimeMilliVector) vsr.getVector("time_field");
for (int i = 0; i < batchRows; i++) {
System.out.printf("paimonValue: %s, <--> arrowValue: %s%n",
timeVec.getInt(i + startIndex), timeMilliVector.get(i));
}
} catch (Exception e) {
e.printStackTrace();
}
}
```
Print output:
```bash
paimonValue: 2000, <--> arrowValue: 0
paimonValue: 3000, <--> arrowValue: 1000
paimonValue: 4000, <--> arrowValue: 2000
```
### What doesn't meet your expectations?
None
### Anything else?
_No response_
### Are you willing to submit a PR?
- [x] I'm willing to submit a PR!
--
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: issues-unsubscribe@paimon.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] `ArrowFieldWriters.TimeWriter` ignores startIndex and reads incorrect rows [paimon]
Posted by "guluo2016 (via GitHub)" <gi...@apache.org>.
guluo2016 closed issue #6767: [Bug] `ArrowFieldWriters.TimeWriter` ignores startIndex and reads incorrect rows
URL: https://github.com/apache/paimon/issues/6767
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org