Skip to content

[query] Allow seeks more than MAX_INT bytes away - #12164

Merged
danking merged 7 commits into
hail-is:mainfrom
daniel-goldstein:allow-seek-further-than-max-int
Sep 16, 2022
Merged

danking merged 7 commits into
hail-is:mainfrom
daniel-goldstein:allow-seek-further-than-max-int

Conversation

@daniel-goldstein

@daniel-goldstein daniel-goldstein commented Sep 8, 2022 •

Copy link
Copy Markdown
Contributor

This assert is here because the buffer we use in the FS is a Java array and can't be longer than MAX_INT, but clearly the position in the blob can be more than that. This currently breaks range reads into indexes on data that's more than 2GiB.

@daniel-goldstein
daniel-goldstein marked this pull request as ready for review September 8, 2022 18:36
// 256 * 8MiB = 2GiB
while (i < 256) {
os.write(eight_mib, 0, Int.MaxValue)
i += 1

@daniel-goldstein daniel-goldstein Sep 8, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I clearly can't write scala 🤦

danking
danking previously requested changes Sep 8, 2022
val f = t()
using (fs.create(f)) { os =>
val eight_mib = Array.fill(8 * 1024 * 1024){0.toByte}
val i = 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
val i = 0
var i = 0

@danking
danking merged commit dbfd257 into hail-is:main Sep 16, 2022
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