---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
---
Translate SQL:
- do:
    bulk:
      refresh: true
      body:
      - index:
          _index: "test"
          _id: "1"
      - str: "test1"
        int: 1
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - ".*rollup functionality will be removed in Elasticsearch.*"
    - "Index \\[\\.profiling-.*\\] name begins with a dot.* and will not be allowed\
      \ in a future Elasticsearch version."
    - "Parameter \\[default_metric\\] is deprecated and will be removed in a future\
      \ version"
- do:
    sql.translate:
      body:
        query: "SELECT * FROM test ORDER BY int asc"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - ".*rollup functionality will be removed in Elasticsearch.*"
    - "Index \\[\\.profiling-.*\\] name begins with a dot.* and will not be allowed\
      \ in a future Elasticsearch version."
    - "Parameter \\[default_metric\\] is deprecated and will be removed in a future\
      \ version"
- match:
    $body:
      size: 1000
      _source: false
      fields:
      - field: "int"
      - field: "str"
      sort:
      - int:
          order: "asc"
          missing: "_last"
          unmapped_type: "long"
      track_total_hits: -1
