Skip to content

[BUG] Query with nested field type does not fall back to legacy #1277

@GumpacG

Description

@GumpacG

What is the bug?
SELECT message.info FROM nested_simple; is being run on the new engine instead of Legacy. It is not supported by the new engine yet and should fall back to Legacy.

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Checkout upstream opensearch-sql branch 2.x
  2. Install the plugin to your local server
  3. Run opensearch
  4. Run the query SELECT message.info FROM nested_simple;
  5. See results as NULL and the Logs shows that it is being run on the new engine

What is the expected behavior?
Since this is not supported in the new engine, it should fall back to Legacy

What is your host/environment?
opensearch-sql 2.4.0

Do you have any screenshots?
Screenshot 2023-01-12 at 11 02 31 AM
[2023-01-12T11:01:49,953][ERROR][o.o.s.l.p.RestSQLQueryAction] [Unused26-MacBook.local] [c7c6efae-d236-4093-9516-37c94896ceb3] Request is handled by new SQL query engine

Test data mappings

  "mappings": {
    "properties": {
      "message": {
        "type": "nested",
        "properties": {
          "info": {
            "type": "keyword",
            "index": "true"
          },
          "author": {
            "type": "keyword",
            "fields": {
              "keyword": {
                "type": "keyword",
                "ignore_above": 256
              }
            },
            "index": "true"
          },
          "dayOfWeek": {
            "type": "long"
          }
        }
      },
      "comment": {
        "type": "nested",
        "properties": {
          "data": {
            "type": "keyword",
            "index": "true"
          },
          "likes": {
            "type": "long"
          }
        }
      },
      "myNum": {
        "type": "long"
      },
      "someField": {
        "type": "keyword",
        "index": "true"
      }
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions