Comments (1)
Digging a bit further, I think it's probably better to not calculate the offset in the constructor of the filter, but to get it from the dates being used.
So removing the zoneOffset from the base class and doing things like this also made the test return to green.
public class MonthIntervalUSFillFilter extends AbstractMonthIntervalFillFilter {
public MonthIntervalUSFillFilter(int monthDuration, long nonMonthDuration, ZoneId zone) {
super(monthDuration, nonMonthDuration, zone);
}
@Override
public boolean needFill(long time, long previousTime) {
long smaller = Math.min(time, previousTime);
long greater = Math.max(time, previousTime);
Instant smallerInstant = Instant.ofEpochSecond(smaller / 1_000_000L, smaller % 1_000_000L);
LocalDateTime smallerDateTime = LocalDateTime.ofInstant(smallerInstant, zone);
ZoneOffset smallerOffset = zone.getRules().getStandardOffset(smallerInstant);
Instant upper =
smallerDateTime
.plusMonths(monthDuration)
.plus(nonMonthDuration, MICROS)
.toInstant(smallerOffset);
long timeInUs =
upper.getLong(ChronoField.MICRO_OF_SECOND) + upper.getEpochSecond() * 1_000_000L;
return timeInUs >= greater;
}
}
from iotdb.
Related Issues (20)
- [Bug] 写UDAF的时候,如果不加group by level就能正常接收参数,如果加了group by level就报301 HOT 1
- [Feature request] 支持单机版简化部署 HOT 1
- WARN o.a.ratis.util.LogUtils:124 - 3: Failed requestVote 1->3#0
- [Bug] Time-Zone problems in TimeRangeIteratorTest
- [Bug] the 'ALTER timeseries {ts} DROP {tag1 .. tagN}' clause is confusing (no tags/attributes discrimination) HOT 1
- mybaits mapper.xml insert SQLException:Does not support prepareStatement HOT 2
- [Bug] 为什么我的压缩比很低,而且越来越低,现在差不多2.5 HOT 15
- Where are the remaining two storage strategies? HOT 1
- [Feature request] Byte array data type HOT 4
- [Feature request] Allow Pandas >= 2 HOT 6
- sharding in iotdb HOT 1
- [Bug] device路径中包含关键字root, show devices 语句返回该device时,root未使用反引号引用 HOT 1
- [Bug] Error WALBuffer....WAL-Recover Fail to allocate wal node....OutOfMemoryError: Cannot reserve 16777216 bytes of direct buffer memory (allocated: 469771426, limit: 471859200) HOT 7
- 是否有mysql类似的max_execution_time 参数可以限制执行的最大时间以保护数据库 HOT 2
- 1.3.1版本能否提供一个arm64架构的docker镜像版本? HOT 3
- [Bug] A large number of error logs are output every minute. HOT 9
- [Bug] 1.3.1升级到1.3.2后报错 HOT 13
- AttributeError: module 'iotdb.thrift.common.ttypes' has no attribute 'TShowConfigurationTemplateResp' HOT 4
- [Bug] The built-in function MAX_BY cannot be used 无法使用内置函数MAX_BY HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iotdb.