[FEATURE] Improve Doctest framework to sort result rows consistently #1096
Labels
enhancement
New feature or request
infrastructure
Changes to infrastructure, testing, CI/CD, pipelines, etc.
Is your feature request related to a problem?
Currently, Doctest module depends on backend and use the result set for comparison directly. Specifically, whenever there is filtering operation (SQL
WHERE
clause or PPLwhere
command), sorting by_doc
field is added automatically. This is supposed to be special case and moved to client side.What solution would you like?
Sort the result rows in consistent way before formatting and comparison. This is similar as what our comparison test framework does. This approach may be favored over the alternative as follows.
What alternatives have you considered?
ORDER BY
clause orsort
command to each SQL/PPL query to make sure consistent order in result set. This may complicate the sample query and thus make it unclear to users.Do you have any additional context?
Code: https://github.com/opensearch-project/sql/blob/2.x/opensearch/src/main/java/org/opensearch/sql/opensearch/request/OpenSearchRequestBuilder.java#L138
Doctest depends on the logic above:
The text was updated successfully, but these errors were encountered: