-
Notifications
You must be signed in to change notification settings - Fork 367
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
557 import tool usability #800
Conversation
Codecov Report
@@ Coverage Diff @@
## master #800 +/- ##
==========================================
+ Coverage 41.78% 41.95% +0.17%
==========================================
Files 133 133
Lines 10332 10442 +110
==========================================
+ Hits 4317 4381 +64
- Misses 5433 5480 +47
+ Partials 582 581 -1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Very nice, much cleaner. Please go over comments but this is good and approved (almost) any way you handle comments
@@ -94,8 +94,7 @@ func (it *InventoryIterator) fillBuffer() bool { | |||
it.logger.Errorf("failed to close manifest file reader. file=%s, err=%w", it.Manifest.Files[it.inventoryFileIndex].Key, err) | |||
} | |||
}() | |||
it.buffer = make([]s3inventory.InventoryObject, rdr.GetNumRows()) | |||
err = rdr.Read(&it.buffer) | |||
it.buffer, err = rdr.Read(int(rdr.GetNumRows())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe Read
should take an int64
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will cause worse casting mess
var checksum string | ||
checksum, err = cast.ToStringE(v) | ||
o.Checksum = swag.String(checksum) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a default
. This is Go, there are no enums and no compile-time switch cover test for fake enums.
if err != nil { | ||
errChan <- fmt.Errorf("failed to read parquet column %s: %w", fieldName, err) | ||
return | ||
} | ||
for i, v := range columnRes { | ||
if dls[i] == 0 && fieldName != "key" && fieldName != "bucket" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand. What is dls
?
case lastModifiedDateFieldName: | ||
var lastModifiedMillis int64 | ||
lastModifiedMillis, err = cast.ToInt64E(v) | ||
o.LastModifiedMillis = swag.Int64(lastModifiedMillis) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As before, would still be happier to have a proper time.Time
here.
cloud/aws/s3inventory/reader_test.go
Outdated
ObjectNum: 12500, | ||
ExpectedReadObjects: 12500, | ||
ExpectedMinValue: "f00000", | ||
ExpectedMaxValue: "f12499", | ||
Format: "ORC", | ||
}, | ||
"orc with 100 objects": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we just run each of the test cases twice, once with each Format
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool; thanks! StilLGTM...
var checksum string | ||
checksum, err = cast.ToStringE(v) | ||
o.Checksum = swag.String(checksum) | ||
o.LastModified = swag.Time(time.Unix(lastModifiedMillis/int64(time.Second/time.Millisecond), 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we care about losing the subsecond resolution?
o.LastModified = swag.Time(time.Unix(lastModifiedMillis/int64(time.Second/time.Millisecond), 0)) | |
o.LastModified = swag.Time(time.Unix(lastModifiedMillis/int64(1000), (lastModifiedMillis % 1000) * int64(1_000_000)) |
(also you can see that I'm not a fan of pretending that the number of milliseconds per second may change, and I'm trying to sneak that change by you...).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our linter would never allow it !
Implements #557