Skip to content

Fix fetch nested device with template will miss some devices#11597

Merged
Cpaulyz merged 2 commits intoapache:masterfrom
Cpaulyz:fix_fetch_nest_template
Nov 23, 2023
Merged

Fix fetch nested device with template will miss some devices#11597
Cpaulyz merged 2 commits intoapache:masterfrom
Cpaulyz:fix_fetch_nest_template

Conversation

@Cpaulyz
Copy link
Copy Markdown
Contributor

@Cpaulyz Cpaulyz commented Nov 22, 2023

Description

Reproduce

--1. CREATE TEMPLATE
create device template t1 (temperature FLOAT encoding=RLE, status BOOLEAN encoding=PLAIN compression=SNAPPY);
show schema templates;
show device templates;
create database root.sg1;

--2. SET TEMPLATE
set device template t1 to root.sg1.d1;
show paths set schema template t1;
show paths set device template t1;

--3. ACTIVATE TEMPLATE
create timeseries of device template on root.sg1.d1;
show paths using device template t1;
show devices root.sg1.**;
show timeseries;
show timeseries root.sg1.**;

--4. INSERT DATA
insert into root.sg1.d1(time, temperature, status) values(1, 1, 1);
insert into root.sg1.d1(time, temperature, status) values(2, 2, 0), (3, 3, 1);
select * from root.sg1.d1;

--5. QUERY
insert into root.sg1.d1.GPS(time, latitude, longitude) values(1, 1, 1);
show timeseries root.sg1.d1.**;
select * from root.sg1.**;
image

After fix

image

@Cpaulyz Cpaulyz merged commit 022bd45 into apache:master Nov 23, 2023
@Cpaulyz Cpaulyz deleted the fix_fetch_nest_template branch November 23, 2023 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants