Skip to content

Conversation

@ahkcs
Copy link
Contributor

@ahkcs ahkcs commented Oct 31, 2025

Description


Summary

This PR adds clear error handling and documentation for the known limitation that the bins parameter on timestamp fields requires pushdown to be enabled.

Related Issues

@ahkcs ahkcs force-pushed the bins_time branch 3 times, most recently from 4977779 to 3a75657 Compare November 5, 2025 18:46
@ahkcs ahkcs marked this pull request as ready for review November 5, 2025 19:43
@ahkcs ahkcs changed the title Fix bins on time-related fields Enhance doc and error message handling for bins on time-related fields Nov 5, 2025
@ahkcs
Copy link
Contributor Author

ahkcs commented Nov 5, 2025

unit tests in CI seems flaky

noCharger
noCharger previously approved these changes Nov 6, 2025

// Create validated binnable field (validates that field is numeric or time-based)
// Note: bins parameter works with both numeric and time-based fields
// Note: bins parameter on time-based fields requires pushdown to be enabled
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Describe the default behavior and the configuration that controls pushdown.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated comments and documentation

@yuancu yuancu added the enhancement New feature or request label Nov 6, 2025
"Expected clear error message about bins parameter not supported on timestamp fields when "
+ "pushdown is disabled, but got: "
+ errorMessage,
errorMessage.contains(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although we enabled push down, we still don't support query like source=events_null | bin @timestamp bins=3.

Shall we call out that it's also required to be used as the aggregation bucket field?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated comments and documentation

Signed-off-by: Kai Huang <[email protected]>
Swiddis
Swiddis previously approved these changes Nov 7, 2025
&& errorMsg.contains("Error while preparing plan")
&& errorMsg.contains("WIDTH_BUCKET")) {
throw new UnsupportedOperationException(
"The 'bins' parameter on timestamp fields is not supported when pushdown is"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should change error message as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated error message

Signed-off-by: Kai Huang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants