feat: null params return last record #919
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adjusts the behavior of stream query actions (
get_record_primitive
,get_index_primitive
,get_record_composed
,get_record_composed_index
) to return only the latest record/index when both thefrom
andto
time parameters are omitted. This aligns the behavior with historical expectations. It also includes improvements to composed query logic and enhances test coverage and debugging for query functions.get_record_primitive
,get_index_primitive
,get_record_composed
, andget_record_composed_index
to return the latest entry iffrom
andto
are NULL.get_record_composed_index
into a new private helper actioninternal_get_base_value
.@data_provider
to$data_provider
) inlist_streams
.query_test.go
):test_GetLatestRecord
,test_GetLatestIndex
,test_GetLatestIndexChange
,test_GetRecordFromSpecificTime
,test_GetRecordUntilSpecificTime
,test_GetIndexFromSpecificTime
,test_GetIndexUntilSpecificTime
,test_GetIndexChangeFromSpecificTime
,test_GetIndexChangeUntilSpecificTime
) to cover scenarios wherefrom_time
and/orto_time
are omitted in query procedures.validateTableResult
to output the actual result table in case of test failure, facilitating easier debugging.FormatResultRows
.Related Problem
How Has This Been Tested?
tests/streams/query/query_test.go
to cover the new logic for handling omitted time ranges in query procedures (get_record
,get_index
,get_index_change
).