• The code for the sampling method based on minimal areal difference and other baselines compared in the experiments are available in the org.apache.iotdb.db.query.eBUG repository.
  • The README of Apache IoTDB itself is in README_IOTDB.md. To build this repository, run mvn clean package -DskipTests -pl -distribution.

A python usage example of performing online sampling based on minimal areal difference:

m=100000
sql_online="select EBUG(s1,'m'='{}','e'='3373465') from root.sg.d5".format(m)
sql=sql_online

ip = "127.0.0.1"
port_ = "6667"
username_ = "root"
password_ = "root"
fetchsize = 100000
session = Session(ip, port_, username_, password_, fetchsize)
session.open(False)

# query:
result = session.execute_query_statement(sql)
df = result.todf()
print(df)

t_online=df.iloc[:,0]
v_online=df.iloc[:,1]

# interactive visualization:
fig = go.Figure()
fig.add_trace(go.Scatter(x=t_online, y=v_online))
fig.update_layout(
    autosize=False,
    width=850,
    height=650,
)
fig.show()

A python usage example of querying the first m rows of the precomputed time series $T_{pre}$:

m=100000
sql_pre="select pre_t,pre_v from root.sg.d6 limit {}".format(m)
sql=sql_pre

ip = "127.0.0.1"
port_ = "6667"
username_ = "root"
password_ = "root"
fetchsize = 100000
session = Session(ip, port_, username_, password_, fetchsize)
session.open(False)

# query:
result = session.execute_query_statement(sql)
df = result.todf() 
print(df)

df = df.rename(columns={'root.sg.d6.pre_t': 't', 'root.sg.d6.pre_v': 'v'})
df = df.sort_values(by='t')
t_pre=df['t']
v_pre=df['v']

# interactive visualization:
fig = go.Figure()
fig.add_trace(go.Scatter(x=t_pre, y=v_pre))
fig.update_layout(
    autosize=False,
    width=850,
    height=650,
)
fig.show()