Skip to content

Commit 70521a5

Browse files
committed
Improve docs for flatten
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
1 parent c475eda commit 70521a5

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

docs/user/ppl/cmd/appendcol.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ appendcol
1111

1212
Description
1313
============
14-
(Experimental)
15-
(From 3.1.0)
1614

1715
Use ``appendcol`` command to append the result of a sub-search and attach it alongside with the input search results (The main search).
1816

docs/user/ppl/cmd/flatten.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ flatten <field> [as (<alias-list>)]
3535
``country, state, city`` and ``(country, state, city)`` are supported,
3636
but the latter is advised. Its length must match the number of keys in the
3737
struct field. Please note that the provided alias names **must** follow
38-
the alphabetical order of the corresponding original keys in the struct.
38+
the lexicographical order of the corresponding original keys in the struct.
3939

4040
Example: flatten a struct field with aliases
4141
============================================
@@ -98,3 +98,16 @@ PPL query::
9898
| {"info":"b","author":"f","dayOfWeek":2} | 2 | f | 2 | b |
9999
+-----------------------------------------+--------+---------+-----+------+
100100

101+
Limitations
102+
===========
103+
* The command works only with Calcite enabled. This can be set with the
104+
following command:
105+
106+
.. code-block::
107+
108+
PUT /_cluster/settings
109+
{
110+
"persistent":{
111+
"plugins.calcite.enabled": true
112+
}
113+
}

ppl/src/test/java/org/opensearch/sql/ppl/calcite/CalcitePPLFlattenTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
import org.junit.Assert;
3333
import org.junit.Test;
3434

35+
/**
36+
* Unit tests for {@code flatten} command in PPL.
37+
*/
3538
public class CalcitePPLFlattenTest extends CalcitePPLAbstractTest {
3639
public CalcitePPLFlattenTest() {
3740
super(CalciteAssert.SchemaSpec.SCOTT_WITH_TEMPORAL);

0 commit comments

Comments
 (0)