Open LantaoJin opened 5 months ago
What is the bug? When user queries with SQL in OpenSearch-Dashboard, OpenSearch-Dashboard adds pretty=true in query parameter by default. We can check it from logs:
pretty=true
[2024-06-06T11:12:39,965][INFO ][o.o.s.l.p.RestSqlAction ] [integTest-0] [6d22cbf7-9125-4940-9d9b-227f08ab9894] Incoming request /_plugins/_sql?pretty=true [2024-06-06T10:58:23,798][INFO ][o.o.s.l.p.RestSqlAction ] [integTest-0] [ee4fd81d-1af6-4298-ac28-e10009755472] Incoming request /_plugins/_sql?format=raw&pretty=true
But the parameter pretty doesn't work on the raw format.
pretty
raw
How can one reproduce the bug? Steps to reproduce the behavior:
POST /_plugins/_sql?format=raw { "query" : """ SELECT type, manufacturer, customer_last_name, day_of_week, total_quantity, currency, taxless_total_price FROM opensearch_dashboards_sample_data_ecommerce LIMIT 5 """ }
type|manufacturer|customer_last_name|day_of_week|total_quantity|currency|taxless_total_price order|Elitelligence|Underwood|Monday|2|EUR|36.98 order|Champion Arts|Bailey|Sunday|2|EUR|53.98 order|Low Tide Media|Butler|Sunday|2|EUR|199.98 order|Primemaster|Chandler|Sunday|2|EUR|174.98 order|Elitelligence|Weber|Monday|2|EUR|80.98
What is the expected behavior? When the query parameter contains pretty=true, the response should be pretty formatted as follow
type |manufacturer |customer_last_name|day_of_week|total_quantity|currency|taxless_total_price order|Elitelligence |Underwood |Monday |2 |EUR |36.98 order|Champion Arts |Bailey |Sunday |2 |EUR |53.98 order|Low Tide Media |Butler |Sunday |2 |EUR |199.98 order|Primemaster |Chandler |Sunday |2 |EUR |174.98 order|Elitelligence |Weber |Monday |2 |EUR |80.98
When the query parameter contains pretty=false or without pretty parameter, the response will be kept current output formatting.
pretty=false
What is your host/environment?
Do you have any screenshots? If applicable, add screenshots to help explain your problem.
Do you have any additional context? Add any other context about the problem.
[Catch All Triage - Attendees 1, 2, 3, 4, 5]
Thanks for reporting this issue.
What is the bug? When user queries with SQL in OpenSearch-Dashboard, OpenSearch-Dashboard adds
pretty=true
in query parameter by default. We can check it from logs:But the parameter
pretty
doesn't work on theraw
format.How can one reproduce the bug? Steps to reproduce the behavior:
What is the expected behavior? When the query parameter contains
pretty=true
, the response should be pretty formatted as followWhen the query parameter contains
pretty=false
or without pretty parameter, the response will be kept current output formatting.What is your host/environment?
Do you have any screenshots? If applicable, add screenshots to help explain your problem.
Do you have any additional context? Add any other context about the problem.