Skip to content

Commit

Permalink
Removing release schedule, removing unnecessary portions to DSL for q…
Browse files Browse the repository at this point in the history
…uery examples, minor clarifications on descriptions.

Signed-off-by: forestmvey <[email protected]>
  • Loading branch information
forestmvey committed May 9, 2023
1 parent 8866a1b commit e55992d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 99 deletions.
108 changes: 17 additions & 91 deletions docs/dev/sql-nested-function-select-clause.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Dot notation is used to show nesting level for fields and paths. For example `ne

### 1.2 Changes To Core
- **NestedOperator:** Responsible for post-processing and flattening of OpenSearch response.
- **LogicalNested:** Stores data required for push down.
- **NestedAnalyzer:** Visitor for LogicalNested instantiation.
- **LogicalNested:** Stores data required for OpenSearch DSL push down.
- **NestedAnalyzer:** Identifies nested functions used in `SELECT` clause for `LogicalNested` creation.
- **Analyzer:** Added ownership of NestedAnalyzer.


Expand Down Expand Up @@ -85,9 +85,6 @@ A basic nested function in the SELECT clause and output DSL pushed to OpenSearch
- `SELECT nested(message.info, message) FROM nested_objects;`
```json
{
"from": 0,
"size": 200,
"timeout": "1m",
"query": {
"bool": {
"filter": [
Expand All @@ -102,17 +99,10 @@ A basic nested function in the SELECT clause and output DSL pushed to OpenSearch
}
},
"path": "message",
"ignore_unmapped": false,
"score_mode": "none",
...
"boost": 1.0,
"inner_hits": {
"ignore_unmapped": false,
"from": 0,
"size": 3,
"version": false,
"seq_no_primary_term": false,
"explain": false,
"track_scores": false,
...
"_source": {
"includes": [
"message.info"
Expand All @@ -122,32 +112,20 @@ A basic nested function in the SELECT clause and output DSL pushed to OpenSearch
}
}
}
],
"adjust_pure_negative": true,
"boost": 1.0
]
}
}
],
"adjust_pure_negative": true,
"boost": 1.0
]
}
},
"_source": {
"includes": [
"message.info"
],
"excludes": []
}
...
}
```

Example with multiple SELECT clause function calls sharing same path. These two queries share the same path and will be added to the same inner hits query for pushing DSL to OpenSearch.
- `SELECT nested(message.info, message), nested(message.author, message) FROM nested_objects;`
```json
{
"from": 0,
"size": 200,
"timeout": "1m",
"query": {
"bool": {
"filter": [
Expand All @@ -162,17 +140,9 @@ Example with multiple SELECT clause function calls sharing same path. These two
}
},
"path": "message",
"ignore_unmapped": false,
"score_mode": "none",
"boost": 1.0,
...
"inner_hits": {
"ignore_unmapped": false,
"from": 0,
"size": 3,
"version": false,
"seq_no_primary_term": false,
"explain": false,
"track_scores": false,
...
"_source": {
"includes": [
"message.info",
Expand All @@ -184,33 +154,19 @@ Example with multiple SELECT clause function calls sharing same path. These two
}
}
],
"adjust_pure_negative": true,
"boost": 1.0
}
}
],
"adjust_pure_negative": true,
"boost": 1.0
}
},
"_source": {
"includes": [
"message.info",
"message.author",
"message"
],
"excludes": []
}
...
}
```

An example with multiple nested function calls in the SELECT clause having differing path values. This shows the separate nested query being created for each path used within the SQL query.
- `SELECT nested(message.info, message), nested(comment.data, comment) FROM nested_objects;`
```json
{
"from": 0,
"size": 200,
"timeout": "1m",
"query": {
"bool": {
"filter": [
Expand All @@ -225,17 +181,9 @@ An example with multiple nested function calls in the SELECT clause having diffe
}
},
"path": "comment",
"ignore_unmapped": false,
"score_mode": "none",
"boost": 1.0,
...
"inner_hits": {
"ignore_unmapped": false,
"from": 0,
"size": 3,
"version": false,
"seq_no_primary_term": false,
"explain": false,
"track_scores": false,
...
"_source": {
"includes": [
"comment.data"
Expand All @@ -253,17 +201,9 @@ An example with multiple nested function calls in the SELECT clause having diffe
}
},
"path": "message",
"ignore_unmapped": false,
"score_mode": "none",
"boost": 1.0,
...
"inner_hits": {
"ignore_unmapped": false,
"from": 0,
"size": 3,
"version": false,
"seq_no_primary_term": false,
"explain": false,
"track_scores": false,
...
"_source": {
"includes": [
"message.info"
Expand All @@ -274,24 +214,12 @@ An example with multiple nested function calls in the SELECT clause having diffe
}
}
],
"adjust_pure_negative": true,
"boost": 1.0
}
}
],
"adjust_pure_negative": true,
"boost": 1.0
}
},
"_source": {
"includes": [
"message.info",
"comment",
"comment.data",
"message"
],
"excludes": []
}
...
}
```

Expand Down Expand Up @@ -478,7 +406,5 @@ classDiagram
[SELECT Clause Demo](https://user-images.githubusercontent.com/36905077/234634885-d28b3a9a-fc5f-41fb-938a-764b60a775a6.mp4)

### Release Schedule
See Issues Tracked under [Issue 1111](https://github.com/opensearch-project/sql/issues/1111) for related PR's and information:
- [x] **Phase 1:** Add support for nested function used in SELECT clause.
- [ ] **Phase 2:** Add support for `*` at ending level of field parameter in SELECT clause nested function.
- Example: `nestedField.innerFields.*`
See Issues Tracked under [Issue 1111](https://github.com/opensearch-project/sql/issues/1111) for related PR's and information.

10 changes: 2 additions & 8 deletions docs/dev/sql-nested-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ Both options serve the same functionality in querying an expression of a `nested
## Additional Info

### Release Schedule
- **P[0] Nested used in `SELECT` clause:** [SELECT Clause Design and Release Schedule](sql-nested-function-select-clause.md)
- **P[0] Nested used in `WHERE` clause:** TBD
- **P[0] Nested used in `GROUP BY` clause:** TBD
- **P[0] Nested used in `HAVING` clause:** TBD
- **P[0] Nested used in `ORDER BY` clause:** TBD
- **P[1] Nested Added to `PPL` query language:** TBD
- **P[2] Nested function support in `JDBC` connector:** TBD
- **P[2] Nested function support in `ODBC` connector:** TBD
See Issues Tracked under [Issue 1111](https://github.com/opensearch-project/sql/issues/1111) for related PR's and information.


0 comments on commit e55992d

Please sign in to comment.