Skip to content

Commit 90b6309

Browse files
committed
Fix doctest
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
1 parent d9b1453 commit 90b6309

5 files changed

Lines changed: 26 additions & 24 deletions

File tree

docs/user/ppl/cmd/bin.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,11 @@ fetched rows / total rows = 3/3
450450
+-----------+----------------+
451451
```
452452

453-
## Example 20: Binning with string fields
454-
455-
```ppl
453+
## Example 20: Binning with string fields
454+
455+
<!-- TODO: Enable after fixing https://github.com/opensearch-project/sql/issues/4973 -->
456+
457+
```ppl ignore
456458
source=accounts
457459
| eval age_str = CAST(age AS STRING)
458460
| bin age_str bins=3

docs/user/ppl/cmd/patterns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ fetched rows / total rows = 4/4
214214
## Brain Example 3: Return log patterns aggregation result
215215

216216
This example shows how to get aggregated results from a raw log field using the brain algorithm.
217-
218-
```ppl
217+
<!-- TODO: Enbale after fixing https://github.com/opensearch-project/sql/issues/4968 -->
218+
```ppl ignore
219219
source=apache
220220
| patterns message method=brain mode=aggregation variable_count_threshold=2
221221
| fields patterns_field, pattern_count, sample_logs

docs/user/ppl/functions/collection.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ Usage: `transform(array, function)` transform the element of array one by one us
162162
Argument type: array:ARRAY, function:LAMBDA
163163
Return type: ARRAY
164164
Example
165-
166-
```ppl
165+
<!-- TODO: To be fixed with https://github.com/opensearch-project/sql/issues/4972 -->
166+
```ppl ignore
167167
source=people
168168
| eval array = array(1, -2, 3), result = transform(array, x -> x + 2)
169169
| fields result
@@ -180,8 +180,8 @@ fetched rows / total rows = 1/1
180180
| [3,0,5] |
181181
+---------+
182182
```
183-
184-
```ppl
183+
<!-- TODO: To be fixed with https://github.com/opensearch-project/sql/issues/4972 -->
184+
```ppl ignore
185185
source=people
186186
| eval array = array(1, -2, 3), result = transform(array, (x, i) -> x + i)
187187
| fields result
@@ -814,8 +814,8 @@ Usage: mvmap(array, expression) iterates over each element of a multivalue array
814814
Argument type: array: ARRAY, expression: EXPRESSION
815815
Return type: ARRAY
816816
Example
817-
818-
```ppl
817+
<!-- TODO: To be fixed with https://github.com/opensearch-project/sql/issues/4972 -->
818+
```ppl ignore
819819
source=people
820820
| eval array = array(1, 2, 3), result = mvmap(array, array * 10)
821821
| fields result
@@ -832,8 +832,8 @@ fetched rows / total rows = 1/1
832832
| [10,20,30] |
833833
+------------+
834834
```
835-
836-
```ppl
835+
<!-- TODO: To be fixed with https://github.com/opensearch-project/sql/issues/4972 -->
836+
```ppl ignore
837837
source=people
838838
| eval array = array(1, 2, 3), result = mvmap(array, array + 5)
839839
| fields result
@@ -854,8 +854,8 @@ fetched rows / total rows = 1/1
854854
Note: For nested expressions like ``mvmap(mvindex(arr, 1, 3), arr * 2)``, the field name (``arr``) is extracted from the first argument and must match the field referenced in the expression.
855855

856856
The expression can also reference other single-value fields:
857-
858-
```ppl
857+
<!-- TODO: To be fixed with https://github.com/opensearch-project/sql/issues/4972 -->
858+
```ppl ignore
859859
source=people
860860
| eval array = array(1, 2, 3), multiplier = 10, result = mvmap(array, array * multiplier)
861861
| fields result

docs/user/ppl/functions/conversion.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@ Expected output:
120120

121121
```text
122122
fetched rows / total rows = 1/1
123-
+--------+----------+------+-------+--------+
124-
| divide | multiply | add | minus | concat |
125-
|--------+----------+------+-------+--------|
126-
| 0.5 | 50.0 | 15.0 | -5.0 | 55 |
127-
+--------+----------+------+-------+--------+
123+
+--------+----------+-----+-------+--------+
124+
| divide | multiply | add | minus | concat |
125+
|--------+----------+-----+-------+--------|
126+
| 0.5 | 50 | 15 | -5 | 55 |
127+
+--------+----------+-----+-------+--------+
128128
```
129129

130130
Use string in comparison operator example
131-
131+
132132
```ppl
133133
source=people
134134
| eval e="1000"==1000, en="1000"!=1000, ed="1000"==1000.0, edn="1000"!=1000.0, l="1000">999, ld="1000">999.9, i="malformed"==1000

docs/user/ppl/interfaces/endpoint.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Expected output:
7777
```json
7878
{
7979
"calcite": {
80-
"logical": "LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])\n LogicalProject(name=[$0], country=[$1], state=[$2], month=[$3], year=[$4], age=[$5])\n LogicalFilter(condition=[>($5, 30)])\n CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])\n",
80+
"logical": "LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])\n LogicalProject(name=[$0], country=[$1], state=[$2], month=[$3], year=[$4], age=[$5])\n LogicalFilter(condition=[>($5, SAFE_CAST(30:BIGINT))])\n CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])\n",
8181
"physical": "CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[PROJECT->[name, country, state, month, year, age], FILTER->>($5, 30), LIMIT->10000], OpenSearchRequestBuilder(sourceBuilder={\"from\":0,\"size\":10000,\"timeout\":\"1m\",\"query\":{\"range\":{\"age\":{\"from\":30,\"to\":null,\"include_lower\":false,\"include_upper\":true,\"boost\":1.0}}},\"_source\":{\"includes\":[\"name\",\"country\",\"state\",\"month\",\"year\",\"age\"],\"excludes\":[]}}, requestedTotalSize=10000, pageSize=null, startFrom=0)])\n"
8282
}
8383
}
@@ -119,7 +119,7 @@ Expected output:
119119
```json
120120
{
121121
"calcite": {
122-
"logical": "LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])\n LogicalProject(name=[$0], country=[$1], state=[$2], month=[$3], year=[$4], age=[$5])\n LogicalFilter(condition=[>($5, 30)])\n CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])\n",
122+
"logical": "LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])\n LogicalProject(name=[$0], country=[$1], state=[$2], month=[$3], year=[$4], age=[$5])\n LogicalFilter(condition=[>($5, SAFE_CAST(30:BIGINT))])\n CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])\n",
123123
"physical": "CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[PROJECT->[name, country, state, month, year, age], FILTER->>($5, 30), LIMIT->10000], OpenSearchRequestBuilder(sourceBuilder={\"from\":0,\"size\":10000,\"timeout\":\"1m\",\"query\":{\"range\":{\"age\":{\"from\":30,\"to\":null,\"include_lower\":false,\"include_upper\":true,\"boost\":1.0}}},\"_source\":{\"includes\":[\"name\",\"country\",\"state\",\"month\",\"year\",\"age\"],\"excludes\":[]}}, requestedTotalSize=10000, pageSize=null, startFrom=0)])\n",
124124
"extended": "public org.apache.calcite.linq4j.Enumerable bind(final org.apache.calcite.DataContext root) {\n final org.opensearch.sql.opensearch.storage.scan.CalciteEnumerableIndexScan v1stashed = (org.opensearch.sql.opensearch.storage.scan.CalciteEnumerableIndexScan) root.get(\"v1stashed\");\n return v1stashed.scan();\n}\n\n\npublic Class getElementType() {\n return java.lang.Object[].class;\n}\n\n\n"
125125
}
@@ -146,7 +146,7 @@ calcite:
146146
logical: |
147147
LogicalSystemLimit(fetch=[10000], type=[QUERY_SIZE_LIMIT])
148148
LogicalProject(name=[$0], country=[$1], state=[$2], month=[$3], year=[$4], age=[$5])
149-
LogicalFilter(condition=[>($5, 30)])
149+
LogicalFilter(condition=[>($5, SAFE_CAST(30:BIGINT))])
150150
CalciteLogicalIndexScan(table=[[OpenSearch, state_country]])
151151
physical: |
152152
CalciteEnumerableIndexScan(table=[[OpenSearch, state_country]], PushDownContext=[[PROJECT->[name, country, state, month, year, age], FILTER->>($5, 30), LIMIT->10000], OpenSearchRequestBuilder(sourceBuilder={"from":0,"size":10000,"timeout":"1m","query":{"range":{"age":{"from":30,"to":null,"include_lower":false,"include_upper":true,"boost":1.0}}},"_source":{"includes":["name","country","state","month","year","age"],"excludes":[]}}, requestedTotalSize=10000, pageSize=null, startFrom=0)])

0 commit comments

Comments
 (0)