Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] PPL Sort with num, str, or ip #963

Open
currantw opened this issue Dec 2, 2024 · 1 comment
Open

[FEATURE] PPL Sort with num, str, or ip #963

currantw opened this issue Dec 2, 2024 · 1 comment
Labels
0.7 backport 0.6 bug Something isn't working Lang:PPL Pipe Processing Language support

Comments

@currantw
Copy link
Contributor

currantw commented Dec 2, 2024

Is your feature request related to a problem?

PPL has unimplemented sorting syntax:

  • sort auto(field_name)
  • sort num(field_name)
  • sort str(field_name)
  • sort ip(field_name)

While this syntax is currently valid, it has no effect on the resulting sort order - sorting is always performed according to the field's data type.

Based on the discussion below, it seems like this would be a useful feature that would both easier to use, and consistent with sorting in Splunk.

What solution would you like?

  • Implement sorting with num, str, and ip keywords.
  • Remove auto keyword from sorting syntax (consensus seems to be that this isn't particularly useful).

What alternatives have you considered?

Variety of alternatives, including deprecating this syntax completely, were discussed below.

Do you have any additional context?

Related to opensearch-project/sql#3180 (same issue for SQL).

@currantw currantw added bug Something isn't working untriaged labels Dec 2, 2024
@YANG-DB YANG-DB added Lang:PPL Pipe Processing Language support backport 0.6 0.7 labels Dec 2, 2024
@currantw currantw changed the title [BUG] Outdated PPL Sorting Syntax [BUG] Unimplemented PPL Sorting Syntax Dec 19, 2024
@currantw currantw changed the title [BUG] Unimplemented PPL Sorting Syntax [BUG] Unimplemented PPL Sort Syntax Dec 19, 2024
YANG-DB pushed a commit that referenced this issue Jan 9, 2025
* Initial implementation

Signed-off-by: currantw <[email protected]>

* Revert `cast` changes.

Signed-off-by: currantw <[email protected]>

* Revert changes, and update to mark syntax as deprecated and add TODOs.

Signed-off-by: currantw <[email protected]>

* Revert some unintended changes, minor doc change.

Signed-off-by: currantw <[email protected]>

* Address review comments, including reverting some changes.

Signed-off-by: currantw <[email protected]>

* Update sample queries for correctness

Signed-off-by: currantw <[email protected]>

* Update to use `eval` for casting

Signed-off-by: currantw <[email protected]>

* Update to mark sort syntax as "unimplemented" rather than "deprecated".

Signed-off-by: currantw <[email protected]>

* Update integration test, clarify TODO comments.

Signed-off-by: currantw <[email protected]>

* Clarify test name, use multi-line string.

Signed-off-by: currantw <[email protected]>

* Fix failing `FlintSparkPPLParseITSuite`

Signed-off-by: currantw <[email protected]>

* Remove note completely

Signed-off-by: currantw <[email protected]>

---------

Signed-off-by: currantw <[email protected]>
@currantw currantw changed the title [BUG] Unimplemented PPL Sort Syntax [FEATURE] PPL Sort with num, str, or ip Jan 9, 2025
@currantw
Copy link
Contributor Author

currantw commented Jan 9, 2025

Updated for consistency with corresponding SQL issue: opensearch-project/sql#3180

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.7 backport 0.6 bug Something isn't working Lang:PPL Pipe Processing Language support
Projects
None yet
Development

No branches or pull requests

3 participants