Skip to content

Fix previous value of EmptyCache map representation#14702

Merged
kokosing merged 2 commits intotrinodb:masterfrom
kokosing:origin/master/153_empty_cache
Oct 24, 2022
Merged

Fix previous value of EmptyCache map representation#14702
kokosing merged 2 commits intotrinodb:masterfrom
kokosing:origin/master/153_empty_cache

Conversation

@kokosing
Copy link
Copy Markdown
Member

Fix previous value of EmptyCache map representation

putIfAbsent returns previous value and since EmptyCache is not storing
anything there is no previous value, so null should be returned.

Copy link
Copy Markdown
Member

@findepi findepi left a comment

Choose a reason for hiding this comment

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

LGTM

Would it be possible to have a test for this?
for empty and non-empty caches?

@kokosing kokosing force-pushed the origin/master/153_empty_cache branch from 2a79241 to cf23167 Compare October 22, 2022 19:43
@kokosing
Copy link
Copy Markdown
Member Author

Added tests. PTAL

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the above comment looks weird now

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

fixed myself

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.

Thanks

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But you forced pushed.
Would you consider

// putIfAbsent returns the previous value

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.

Sorry about that 🤦

Notice that the put method has the old comment still, I find old comment still useful. It is more about empty cache, not the put method. I will leave both ones.

@findepi findepi force-pushed the origin/master/153_empty_cache branch from cf23167 to 8ad23f4 Compare October 24, 2022 07:24
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The cache constructed in this test looks to be empty.

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 wanted to stress that it is not EmptyCache implementation

@kokosing kokosing force-pushed the origin/master/153_empty_cache branch from 8ad23f4 to b7ac8d0 Compare October 24, 2022 11:20
@kokosing kokosing force-pushed the origin/master/153_empty_cache branch from b7ac8d0 to d8a631c Compare October 24, 2022 12:11
Copy link
Copy Markdown
Member

@findepi findepi left a comment

Choose a reason for hiding this comment

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

"Move DataProviders to trino-testing-services" LGTM

Comment on lines 57 to 59
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

still the case?

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.

Let me do it as follow up.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But you forced pushed.
Would you consider

// putIfAbsent returns the previous value

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The cache under test is empty.
Add a comment capturing #14702 (comment)

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 prefer to rename the test

putIfAbsent returns previous value and since EmptyCache is not storing
anything there is no previous value, so null should be returned.
@kokosing kokosing force-pushed the origin/master/153_empty_cache branch from d8a631c to 5d3202f Compare October 24, 2022 16:21
@github-actions github-actions bot added the jdbc Relates to Trino JDBC driver label Oct 24, 2022
@kokosing kokosing merged commit 4ba2126 into trinodb:master Oct 24, 2022
@kokosing kokosing deleted the origin/master/153_empty_cache branch October 24, 2022 18:02
@github-actions github-actions bot added this to the 401 milestone Oct 24, 2022
@colebow
Copy link
Copy Markdown
Member

colebow commented Oct 25, 2022

Do we need a release note for this?

@kokosing
Copy link
Copy Markdown
Member Author

No. It is not changing anything from point of the view of user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed jdbc Relates to Trino JDBC driver

Development

Successfully merging this pull request may close these issues.

4 participants