-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[IOTDB-1026] Support wildcard ** in Path And Replace PrefixPath usage with PathPattern in IOTDB-SQL #3918
Merged
Conversation
This file contains 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
Yes, after this change, |
qiaojialin
reviewed
Sep 21, 2021
server/src/main/java/org/apache/iotdb/db/metadata/mtree/traverser/Traverser.java
Show resolved
Hide resolved
...rc/main/java/org/apache/iotdb/db/metadata/mtree/traverser/collector/EntityPathCollector.java
Show resolved
Hide resolved
...c/main/java/org/apache/iotdb/db/metadata/mtree/traverser/collector/MeasurementCollector.java
Outdated
Show resolved
Hide resolved
...c/main/java/org/apache/iotdb/db/metadata/mtree/traverser/collector/MeasurementCollector.java
Outdated
Show resolved
Hide resolved
...in/java/org/apache/iotdb/db/metadata/mtree/traverser/collector/StorageGroupDeterminator.java
Outdated
Show resolved
Hide resolved
# Conflicts: # cross-tests/src/test/java/org/apache/iotdb/cross/tests/tools/importCsv/ExportCsvTestIT.java
# Conflicts: # docs/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md # docs/zh/UserGuide/IoTDB-SQL-Language/DML-Data-Manipulation-Language.md
qiaojialin
approved these changes
Sep 26, 2021
# Conflicts: # session/src/test/java/org/apache/iotdb/session/IoTDBSessionVectorIT.java
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
0.13
will be released in 0.13
Module - QueryProcessing
Module - Schema
MManager
Module - Storage Engine
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.
Description
1. Motivation
For example, suppose we have timeseries root.sg.d.s1, root.sg.d.s2, and root.sg.d.t.s1, consider the following SQL statement:
show timeseries root.sg.d
show timeseries root.sg.d.*
select * from root.sg.d
If use want to process all the three timeseries, all the statements above will work.
However, if user only want to process root.sg.d.s1 and root.sg.d.s2, none of these will work and it's hard to come up with some other SQL statements besides enumerating the traget timeseries.
2. Feature
2.1. Define path pattern and Introduce wildcard **
** will match one or more level in path and * will only match one level.
By leveraging ** and *, users are enabled to construct a path pattern for target paths or nodes in MTree.
For example, suppose we have timeseries root.sg.d.s1, root.sg.d.s2, and root.sg.d.t.s1, consider the following pattern:
2.2. Replace all prefix path usage in SQL with path pattern
Most of the prefix path can be replaced by a path pattern end with **, and path pattern provides users a more precise way to process timeseries.
3. Implementation
Related implementation in MTree.java is refactored. A MTree traversal framework for path pattern is established. The methods for different kind of resultset can share the same traversal code and achieve target resultset by overriding the related result process method.
4. Docs and Discussion
docs
discussion
#3990