apache / apache/iotdb

set ttl support Multiple time units

Open
#7,690 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.4k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
115

Description

**Is your feature request related to a problem? Please describe.**
大佬您好,当前例如:"set ttl to root.ln 360000",只支持毫米级别的单位,对于设置过期时间长的很不方便,希望可以增加例如:"set ttl to root.ln 180d"这种形式,语法解析和处理应该不是很困难

**Describe the solution you'd like**
希望可以增加多种时间单位,例如:"set ttl to root.ln 180d"这种形式

**Describe alternatives you've considered**
修改 org.apache.iotdb.db.qp.sql.IoTDBSqlVisitor#visitSetTTLStatement逻辑,解析最后一个text,按照时间单位转化后赋值给org.apache.iotdb.db.qp.logical.sys.SetTTLOperator#dataTTL就可以解决,SetTTLOperator多加一个字段用来保存set时候的时间,SHOW ALL TTL的时候可以查询这个字段,不知道是否可行

Contributor guide

Open the contributing guide

Research direction

Start with org.apache.iotdb.db.qp.sql.IoTDBSqlVisitor#visitSetTTLStatement and org.apache.iotdb.db.qp.logical.sys.SetTTLOperator#dataTTL to trace how SET TTL values are parsed and stored. Review the existing SHOW ALL TTL handling; done means TTL expressions such as 180d support multiple units and the stored value is reported as intended.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.