sql icon indicating copy to clipboard operation
sql copied to clipboard

[BUG] Dashboard filters issue with Quicksight

Open rupal-bq opened this issue 2 years ago • 10 comments

What is the bug? While adding filters (as controls or otherwise), it gives an SQL exception/fails to populate any option in the dropdown, for both single-option and multi-option dropdown.

While selecting the filter as a raw text field, it accepts single as well multiple values, and works as expected.

rupal-bq avatar Jul 11 '23 23:07 rupal-bq

@rupal-bq, is it a JDBC driver issue or Dashboards issue?

Yury-Fridlyand avatar Jul 12 '23 00:07 Yury-Fridlyand

@rupal-bq, is it a JDBC driver issue or Dashboards issue?

Seems to be a JDBC driver issue. While applying filters, getting below error.

image

rupal-bq avatar Jul 17 '23 17:07 rupal-bq

I don't have access to Quicksight now. Can you reproduce that issue? Can you send me anonymized query please (SQL plugin prints it into logs)? What is the data mapping?

Yury-Fridlyand avatar Jul 17 '23 19:07 Yury-Fridlyand

SQL query:

SELECT item_type AS abc123
FROM tmp_index
GROUP BY item_type
ORDER BY abc123 IS NOT NULL, abc123
LIMIT 10001

mapping:

{
  “tmp_index": {
    "mappings": {
      "properties": {
        “item”: {
          "type": "keyword"
        },
        "time": {
          "type": "date"
        },
        “item_type": {
          "type": "keyword"
        }
      }
    }
  }
}

rupal-bq avatar Jul 20 '23 20:07 rupal-bq

Thank you @rupal-bq!

What versions of OpenSearch and JDBC driver is this using?

MaxKsyunz avatar Jul 20 '23 23:07 MaxKsyunz

Probably it is V2 parser issue:

opensearchsql> select city as abc from bank group by city order by abc is not null, abc limit 100;
{'reason': 'Invalid SQL query', 'details': "can't resolve Symbol(namespace=FIELD_NAME, name=abc) in type env", 'type': 'SemanticCheckException'}
opensearchsql> select city as abc from bank group by city order by city is not null, abc limit 100;
fetched rows / total rows = 7/7
...

I see alias is not supported in expression in ORDER BY clause; meanwhile it is supported in ORDER BY without expression. UPD GROUP BY is also affected.

@rupal-bq, please, confirm that the query is correct. I want to ensure that we found the right bug.

Yury-Fridlyand avatar Jul 20 '23 23:07 Yury-Fridlyand

Probably it is V2 parser issue:

opensearchsql> select city as abc from bank group by city order by abc is not null, abc limit 100;
{'reason': 'Invalid SQL query', 'details': "can't resolve Symbol(namespace=FIELD_NAME, name=abc) in type env", 'type': 'SemanticCheckException'}
opensearchsql> select city as abc from bank group by city order by city is not null, abc limit 100;
fetched rows / total rows = 7/7
...

I see alias is not supported in expression in ORDER BY clause; meanwhile it is supported in ORDER BY without expression. UPD GROUP BY is also affected.

@rupal-bq, please, confirm that the query is correct. I want to ensure that we found the right bug.

Hi @Yury-Fridlyand, the query is correct. Didn't find much information in quicksight logs, it only had generic sql exception.

rupal-bq avatar Jul 25 '23 21:07 rupal-bq

Seems like this is related to:

  • https://github.com/opensearch-project/sql/issues/798
  • https://github.com/opensearch-project/sql/issues/292

acarbonetto avatar Jul 27 '23 18:07 acarbonetto

Thank you @rupal-bq!

What versions of OpenSearch and JDBC driver is this using?

OpenSearch version is 2.5 but not sure what JDBC version (using Quicksight connector)

rupal-bq avatar Aug 01 '23 16:08 rupal-bq

Hi @rupal-bq , is there any progress on this?

gamebusterz avatar Aug 24 '23 07:08 gamebusterz