-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Core: Add length arg to FileIO.newInputFile #5207
Conversation
@@ -67,6 +67,6 @@ public PositionOutputStream createOrOverwrite() { | |||
|
|||
@Override | |||
public InputFile toInputFile() { | |||
return new GCSInputFile(storage(), blobId(), gcpProperties(), metrics()); | |||
return new GCSInputFile(storage(), blobId(), null, gcpProperties(), metrics()); |
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 use GCSInputFile.fromLocation(...)
to avoid calling the constructor with null?
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.
I just didn't want to change very much here. We probably could.
@@ -70,7 +70,7 @@ public PositionOutputStream createOrOverwrite() { | |||
|
|||
@Override | |||
public InputFile toInputFile() { | |||
return new S3InputFile(client(), uri(), awsProperties(), metrics()); | |||
return new S3InputFile(client(), uri(), null, awsProperties(), metrics()); |
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.
Similar to GCS, could we just call S3InputFile.fromLocation(...)
to avoid calling the constructor with null?
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.
+1 Minor comment/suggestion. Looks good either way.
While investigating #5206, I found that a lot of time is spent in
InputFile#getLength()
for manifest files during job planning. This isn't necessary becauseManifestFile
stored in a manifest list has the manifest file length. This PR avoids round-trip calls to get object lengths by passing the length intoFileIO.newInputFile
. This implements the improvement for S3, GCP, and Hadoop.