Skip to content

WIP: issue #255 - start handling even more datetimes as ranges#430

Closed
lmsurpre wants to merge 1 commit intomasterfrom
issue-255-lee
Closed

WIP: issue #255 - start handling even more datetimes as ranges#430
lmsurpre wants to merge 1 commit intomasterfrom
issue-255-lee

Conversation

@lmsurpre
Copy link
Copy Markdown
Member

on call with Paul and John, we identified about 7 other related things
that need to get done, but hopefully these changes are a step in the right direcation

TODO:

  • remove DATE column and always use DATE_START and DATE_END (even for instants)
  • handle date search parameter query params as instants when prefixed by lt, gt, le, or ge
  • handle date search parameter query params as implicit ranges in all other cases (when no fractional seconds are passed)

Signed-off-by: Lee Surprenant lmsurpre@us.ibm.com

on call with Paul and John, we identified about 7 other related things
that need to get done, but hopefully these changes are a step in the right direcation

TODO:
* remove DATE column and always use DATE_START and DATE_END (even for instants)
* handle date search parameter query params as instants when prefixed by lt, gt, le, or ge
* handle date search parameter query params as implicit ranges in all other cases (when no fractional seconds are passed)

Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
@lmsurpre lmsurpre requested a review from prb112 November 19, 2019 17:44
Comment on lines +778 to 786
if (!value.getValueDate().isPartial() && QueryBuilderUtil.hasSubSeconds(value.getValueDate().getValue()) && isInstantSearch) {
whereClauseSegment.append(LEFT_PAREN);
whereClauseSegment.append(tableAlias + DOT).append(DATE_VALUE)
.append(operator.value())
.append(BIND_VAR);
bindVariables.add(Timestamp.from(datetime));
whereClauseSegment.append(RIGHT_PAREN);
whereClauseSegment.append(RIGHT_PAREN);
} else {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i think this whole logic branch can get deleted if we add that "inclusive" boolean into the db and handle all datetime searches (except _lastUpdated) through DATE_START and DATE_END

Comment on lines +158 to +160
private static ZonedDateTime minusOneMicroSecond(ZonedDateTime dateTime) {
return dateTime.minusNanos(1000);
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this goes away if we can either normalize the end times to always be inclusive or exclusive OR make schema edits to know the difference.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

on our call today, we decided to attempt the latter.

@prb112
Copy link
Copy Markdown
Contributor

prb112 commented Dec 20, 2019

I believe I've captured all the changes in the PR in PR #506
Leaving open for Lee to confirm

@prb112 prb112 closed this Dec 20, 2019
@prb112 prb112 deleted the issue-255-lee branch July 29, 2020 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants