-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[IOTDB-1407] Filtering time series based on tags query fails Occasion… #3292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e9c7184
[IOTDB-1407] Filtering time series based on tags query fails Occasion…
wangchao316 d2c141e
[IOTDB-1407] Filtering time series based on tags query fails Occasion…
wangchao316 eb2ba43
[IOTDB-1407] Filtering time series based on tags query fails Occasion…
wangchao316 278978d
add testcontainer IT
wangchao316 ec6c0f2
add test and alter exception
wangchao316 db3751f
Merge branch 'master' of github.com:apache/iotdb into IOTDB-1407
wangchao316 6764b75
alter test
wangchao316 bc8035b
alter exception
wangchao316 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -323,4 +323,87 @@ private void insertRecords() throws IoTDBConnectionException, StatementExecution | |
|
|
||
| session.insertRecords(deviceIds, timestamps, measurementsList, typesList, valuesList); | ||
| } | ||
|
|
||
| // test https://issues.apache.org/jira/browse/IOTDB-1407 | ||
| @Test | ||
| public void showTimeseriesTagsTest() throws SQLException { | ||
| String createTimeSeries1 = | ||
| "create timeseries root.ln.wf01.wt1 WITH DATATYPE=DOUBLE, ENCODING=RLE, compression=SNAPPY tags(tag1=v1, tag2=v2)"; | ||
| String createTimeSeries2 = | ||
| "create timeseries root.ln.wf01.wt2 WITH DATATYPE=DOUBLE, ENCODING=RLE, compression=SNAPPY tags(tag1=v1, tag2=v2)"; | ||
| writeStatement.execute(createTimeSeries1); | ||
| writeStatement.execute(createTimeSeries2); | ||
| // try to read data on each node. select .* | ||
| for (Statement readStatement : readStatements) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what about adding some corner cases,such as
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, done. |
||
| ResultSet resultSet = | ||
| readStatement.executeQuery("SHOW TIMESERIES root.ln.wf01.* where tag1=v1"); | ||
| int cnt = 0; | ||
| while (resultSet.next()) { | ||
| cnt++; | ||
| } | ||
| Assert.assertEquals(2, cnt); | ||
| resultSet.close(); | ||
| } | ||
|
|
||
| // try to read data on each node. select from parent series | ||
| for (Statement readStatement : readStatements) { | ||
| ResultSet resultSet = | ||
| readStatement.executeQuery("SHOW TIMESERIES root.ln.wf01 where tag1=v1"); | ||
| int cnt = 0; | ||
| while (resultSet.next()) { | ||
| cnt++; | ||
| } | ||
| Assert.assertEquals(2, cnt); | ||
| resultSet.close(); | ||
| } | ||
|
|
||
| // try to read data on each node. select from one series | ||
| for (Statement readStatement : readStatements) { | ||
| ResultSet resultSet = | ||
| readStatement.executeQuery("SHOW TIMESERIES root.ln.wf01.wt1 where tag1=v1"); | ||
| int cnt = 0; | ||
| while (resultSet.next()) { | ||
| cnt++; | ||
| } | ||
| Assert.assertEquals(1, cnt); | ||
| resultSet.close(); | ||
| } | ||
|
|
||
| // try to read data on each node. select from root | ||
| for (Statement readStatement : readStatements) { | ||
| ResultSet resultSet = readStatement.executeQuery("SHOW TIMESERIES root where tag1=v1"); | ||
| int cnt = 0; | ||
| while (resultSet.next()) { | ||
| cnt++; | ||
| } | ||
| Assert.assertEquals(2, cnt); | ||
| resultSet.close(); | ||
| } | ||
|
|
||
| // try to read data on each node. SHOW TIMESERIES root.ln.wf01.* where tag1=v3" | ||
| for (Statement readStatement : readStatements) { | ||
| ResultSet resultSet = | ||
| readStatement.executeQuery("SHOW TIMESERIES root.ln.wf01.* where tag1=v3"); | ||
| int cnt = 0; | ||
| while (resultSet.next()) { | ||
| cnt++; | ||
| } | ||
| Assert.assertEquals(0, cnt); | ||
| resultSet.close(); | ||
| } | ||
|
|
||
| // try to read data on each node. SHOW TIMESERIES root.ln.wf01.* where tag3=v1" | ||
| for (Statement readStatement : readStatements) { | ||
| ResultSet resultSet = null; | ||
| try { | ||
| resultSet = readStatement.executeQuery("SHOW TIMESERIES root.ln.wf01.* where tag3=v1"); | ||
| } catch (Exception e) { | ||
| Assert.assertTrue(e.getMessage().contains("The key tag3 is not a tag")); | ||
| } finally { | ||
| if (resultSet != null) { | ||
| resultSet.close(); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
show timeseries root.* is not right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mychaow . this is have a situation, root.a.*
I will alter this.