Skip to content

Commit 5ea6d60

Browse files
committed
Add a limitation section in expand doc & link a issue tracker for a workaround
Signed-off-by: Yuanchun Shen <yuanchu@amazon.com>
1 parent f722ccd commit 5ea6d60

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

docs/user/ppl/cmd/expand.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,12 @@ PPL query::
6363
| chen | 32 | {"city":"Miami","state":"Florida","moveInDate":{"dateAndTime":"19010811T040333.000Z"}} |
6464
| chen | 32 | {"city":"los angeles","state":"CA","moveInDate":{"dateAndTime":"20230503T080742.000Z"}} |
6565
+-------+-----+-------------------------------------------------------------------------------------------+
66+
67+
Limitations
68+
============
69+
70+
* The ``expand`` command currently only supports nested arrays. Primitive
71+
fields storing arrays are not currently supported. E.g. a string field
72+
storing an array of strings cannot be expanded with the current
73+
implementation.
74+
* The ``expand`` command is only available since 3.1.0.

opensearch/src/main/java/org/opensearch/sql/opensearch/executor/OpenSearchExecutionEngine.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,9 @@ private void buildResultSet(
234234
for (int i = 1; i <= columnCount; ++i) {
235235
String columnName = metaData.getColumnName(i);
236236
RelDataType fieldType = fieldTypes.get(i - 1);
237-
// The element type of struct and array is currently set to ANY.
238-
// We set them using the runtime type as a workaround.
237+
// TODO: Correct this after fixing issue github.com/opensearch-project/sql/issues/3751
238+
// The element type of struct and array is currently set to ANY.
239+
// We set them using the runtime type as a workaround.
239240
ExprType exprType;
240241
if (fieldType.getSqlTypeName() == SqlTypeName.ANY) {
241242
if (!values.isEmpty()) {

0 commit comments

Comments
 (0)