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

Test: Lua Hive Partition pager #6691

Merged
merged 3 commits into from
Oct 9, 2023
Merged

Test: Lua Hive Partition pager #6691

merged 3 commits into from
Oct 9, 2023

Conversation

Isan-Rivkin
Copy link
Contributor

@Isan-Rivkin Isan-Rivkin commented Oct 3, 2023

Closes #6720
This is a sunny day test to check that partitions pager works as expected.

@Isan-Rivkin Isan-Rivkin self-assigned this Oct 3, 2023
@Isan-Rivkin Isan-Rivkin added area/testing Improvements or additions to tests exclude-changelog PR description should not be included in next release changelog labels Oct 3, 2023
@Isan-Rivkin Isan-Rivkin changed the title Test: Hooks Glue Exporter WIP: Test: Hooks Glue Exporter Oct 3, 2023
@Isan-Rivkin Isan-Rivkin changed the title WIP: Test: Hooks Glue Exporter Test: Lua Hive Partition Iterator Oct 8, 2023
@Isan-Rivkin Isan-Rivkin changed the title Test: Lua Hive Partition Iterator Test: Lua Hive Partition pager Oct 8, 2023
Copy link
Contributor

@arielshaqed arielshaqed left a comment

Choose a reason for hiding this comment

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

Thanks, neat and useful stuff! Only minor changes requested, but they are blocking.

local hive = require("lakefs/catalogexport/hive")

-- helper function to slice table array
function table.slice(tbl, first, last, step)
Copy link
Contributor

Choose a reason for hiding this comment

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

AFAICT this implementation doesn't really slice a table array. For instance if the table is sparse, it is still an array -- but its table_slice will be a dense array "table".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed name

local hive = require("lakefs/catalogexport/hive")

-- helper function to slice table array
function table.slice(tbl, first, last, step)
Copy link
Contributor

Choose a reason for hiding this comment

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

"table.slice" conflicts with standard Lua table methods. Perhaps pretend that these live in "xtable"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the link is wrong and I couldn't find any reference to what you're saying, can you link the source that shows it's a conflict with standard lua methods?

Either way, I didn't like that fact that it's global table it's just a helper function for very specific use case that can't be shared outside this code anyway, so I changed the name and the scope.

end
}

local page = 2
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
local page = 2
local page_size = 2

Not sure why we're using a different name than the parameter.

Also: can we check with multiple page_size arguments? I would gladly check every page size from 1 to the entire size of the list, or even the entire size of the list plus 2. Each should give the same output.

Otherwise some pager bugs are just too easy to miss.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both points done, thanks!

@Isan-Rivkin
Copy link
Contributor Author

Thanks for the review @arielshaqed ! Please look again.

Copy link
Contributor

@arielshaqed arielshaqed left a comment

Choose a reason for hiding this comment

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

Yay, thanks!

@Isan-Rivkin Isan-Rivkin merged commit 1ab19fc into master Oct 9, 2023
32 checks passed
@Isan-Rivkin Isan-Rivkin deleted the 6686-lua-export-tests branch October 9, 2023 07:01
@Isan-Rivkin Isan-Rivkin restored the 6686-lua-export-tests branch October 23, 2023 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Improvements or additions to tests exclude-changelog PR description should not be included in next release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test: Hooks Hive Partition Pager
2 participants