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

Feat/add humanizeBytes and showDeltaFileSizes functions #82

Merged

Conversation

sebastian2296
Copy link
Contributor

No description provided.

Copy link
Collaborator

@brayanjuls brayanjuls left a comment

Choose a reason for hiding this comment

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

Good effort! I added some comments and I will finish the review for the unit test later today.

Comment on lines 540 to 543
val details: Row = deltaTable.detail().select("numFiles", "sizeInBytes").collect()(0)
val (sizeInBytes, numberOfFiles) =
(details.getAs[Long]("sizeInBytes"), details.getAs[Long]("numFiles"))
val avgFileSizeInBytes = if (numberOfFiles == 0) 0 else Math.round(sizeInBytes / numberOfFiles)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This code section seems equal to what deltaFileSizes function, could you try to reuse that other function in here?

Copy link
Contributor Author

@sebastian2296 sebastian2296 Dec 5, 2023

Choose a reason for hiding this comment

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

Just implemented the change to reuse deltaFileSizes function. In order to make it work properly I added a type annotation to its' signature (it was inferred as Map[String, AnyVal], which was incompatible with HumanizeBytes input type).

src/main/scala/mrpowers/jodie/DeltaHelpers.scala Outdated Show resolved Hide resolved
src/main/scala/mrpowers/jodie/DeltaHelpers.scala Outdated Show resolved Hide resolved
@brayanjuls
Copy link
Collaborator

LGTM

@brayanjuls brayanjuls merged commit 658e220 into mrpowers-io:main Jan 5, 2024
8 checks passed
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