CritasWang commented on code in PR #15:
URL:
https://github.com/apache/iotdb-client-nodejs/pull/15#discussion_r3568347060
##########
src/client/Session.ts:
##########
@@ -1021,6 +1015,23 @@ export class Session {
);
}
+ // DATE columns arrive in TsBlock with wire type INT32 (1); the real DATE
+ // type is only present in the query metadata. Convert those columns'
+ // yyyyMMdd integers (e.g. 20240101) to Date objects here.
+ for (let i = 0; i < valueColumns.length; i++) {
+ if (
+ valueColumnTypes[i] === 1 &&
+ this.getDataTypeCode(dataTypes[i]) === 9
Review Comment:
Fixed in 4aacd83. `columnIndex2TsBlockColumnIndexList` is now passed into
`parseQueryResult` from both call sites (the initial `executeQueryStatement`
batch and `SessionDataSet.fetchNextBatch`) and inverted into
per-physical-column logical types before the DATE conversion, so
deduplicated/reordered TsBlock columns convert correctly. When the mapping is
absent the previous identity behavior is kept, and if two logical columns with
different types ever map to the same physical column, the conversion is skipped
with a warning instead of crashing. Added unit tests that craft raw TsBlock
buffers (INT32 wire columns) with a non-identity mapping `[1, 0]` for logical
`[DATE, INT32]`, plus dedup (`[0, 0]` same type) and conflicting-mapping cases.
--
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]