Commit aa7fcf5
committed
trie: supporting nested value list queries
Value list (i.e. curl braces) in go-carbon queries is a tricky business. filepath.Glob, trigram, and
trie index all have to work around the issue one way or the other.
Currently, all the three query paths depends on `*CarbonserverListener.expandGlobBraces` to to perform
the expansion. However, it currently does not support nested value lists like `{a,b,c,x.{a,b,c}}`.
Unlike filepath.Glob and trigram, trie index does not need full expansion, it only needs expansion if
a query contains nested values that are hierarchical (i.e. containing a dir node, another i.e., a dot).
This is also partially due to the current implementation of how trie index handles hierarchical queries.
To be more specific, trieIndex.query does not support queries like x.y.z.{a,nested.subquery}`, therefore,
a query like that would be expanded by `*CarbonserverListener.expandGlobBraces` as `x.y.z.a` and
`x.y.z.nested.subquery`.
However, the current implementation does not support nested value lists like `x.y.z.{a,nested.subquery.{a,b,c}}`.
This patch introduces a more through and proper (TM) value list query parser and rewriter for supporting
all expansion cases (hopefully). Like most of the other improvements, only the trie index is supported for now.
Unlike `*CarbonserverListener.expandGlobBraces`, *CarbonserverListener.expandGlobBracesForTrieIndex would only expand
value list that contains dir/hierarchical nodes. For example, `x.y.z.{a,b,nested.subquery.{a,b,c}}` is rewritten as
`x.y.z.{a,b}` and `x.y.z.nested.subquery.{a,b,c}`, because trie index can handle non-hierarchical value lists
natively.
We should also try to introduce a new expand function that can do full expansion to replace `*CarbonserverListener.expandGlobBraces`.1 parent 1182c9c commit aa7fcf5
File tree
4 files changed
+1827
-3
lines changed- carbonserver
4 files changed
+1827
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1407 | 1407 | | |
1408 | 1408 | | |
1409 | 1409 | | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
1410 | 1416 | | |
1411 | 1417 | | |
1412 | 1418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1490 | 1490 | | |
1491 | 1491 | | |
1492 | 1492 | | |
1493 | | - | |
| 1493 | + | |
1494 | 1494 | | |
1495 | 1495 | | |
1496 | 1496 | | |
| |||
1500 | 1500 | | |
1501 | 1501 | | |
1502 | 1502 | | |
1503 | | - | |
| 1503 | + | |
1504 | 1504 | | |
1505 | 1505 | | |
1506 | 1506 | | |
1507 | 1507 | | |
1508 | 1508 | | |
1509 | 1509 | | |
1510 | | - | |
| 1510 | + | |
1511 | 1511 | | |
1512 | 1512 | | |
1513 | 1513 | | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
1514 | 1521 | | |
1515 | 1522 | | |
1516 | 1523 | | |
| |||
0 commit comments