Correct the date_bin timezone statement in IoTDBTableTimeseriesDao's Javadoc - #124
Open
PDGGK wants to merge 1 commit into
Open
Correct the date_bin timezone statement in IoTDBTableTimeseriesDao's Javadoc#124PDGGK wants to merge 1 commit into
PDGGK wants to merge 1 commit into
Conversation
…Javadoc The Javadoc said date_bin "computes in the server's UTC zone only". That is wrong: DateBinFunctionColumnTransformer does its calendar arithmetic in a ZoneId, and ColumnTransformerBuilder passes context.sessionInfo.getZoneId() identically at v2.0.8 and on master. It was never UTC-only. The surrounding design decision is unchanged, but its reason is different and this is the accurate one: the zone is session-scoped and fixed when the session pool is built, so a pooled session cannot rebind it per query, while each ReadTsKvQuery carries its own tzId. Walking the calendar boundaries in Java remains necessary. Comment-only change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The calendar-aggregation Javadoc I added in #115 says
date_binThe first half is right; the parenthetical is wrong, and it was wrong when I wrote it rather than having gone stale.
DateBinFunctionColumnTransformer.dateBin(long source, long origin, int monthDuration, long nonMonthDuration, ZoneId zoneId)converts throughLocalDateTimein thatZoneId, andColumnTransformerBuilder'sDATE_BINbranch passescontext.sessionInfo.getZoneId()— identically atv2.0.8(the version the Javadoc names) and onmaster. It has never been UTC-only.TableSessionPoolBuilder.zoneId(...)even defaults toZoneId.systemDefault(), so UTC is not the default either.The design decision the paragraph justifies does not change: this path still has to walk calendar boundaries in Java. But the accurate reason is different, and it is a stronger one — the zone is session-scoped, fixed when the session pool is built, so a pooled session cannot rebind it per query, whereas each
ReadTsKvQuerycarries its owntzId. The day-of-month anchoring half of the original sentence stands unchanged.Comment-only change; no behaviour is affected. Verified
mvn -P with-thingsboard compileand appliedspotless:apply(which reflowed the surrounding paragraph, hence the slightly larger diff).