Repository navigation
Conversation
andygrove
left a comment
There was a problem hiding this comment.
The PR backlog is huge and the maintainers don't have the bandwidth to review them all, so here is an automated review. Feel free to ignore it.
I built the native crate at the current head and ran the two new tests, and both pass. I also fed extra inputs through SparkFilePath::new and the output was credential-free for all of the realistic ones: an encoded / in a password, an empty username with a password, hdfs with a password and a query, abfss with a container and a password, https userinfo, and the explicit-authority and opaque s3a forms. Paths with no credentials come back as Spark spelled them, so the error text for ordinary paths does not change.
One input still leaks. In SparkFilePath::new, the early return trusts url.username() and url.password() on the normalized URL. For a hostless alias with a dot segment after the first segment, such as s3a:///u:p@bucket/../x/y or s3a:///u:p@bucket/%2e%2e/x, Url collapses the path to /x/y, rewrite_alias_to_s3 promotes x to the bucket, and the normalized URL carries no userinfo. The function then returns the raw path, and the diagnostic reads s3a:///u:p@bucket/../x/y. Spark would not normally hand the native side a hostless URL with userinfo and dot segments, so this is far from the common case. Since the PR is meant as defense in depth, could the early return also require that the raw path has no @ in its first authority-or-segment position, rather than relying only on the parsed userinfo? Alternatively, could the authority_matches check run before the early return, so both paths go through the same rule? A table row for this input would pin it.
andygrove
left a comment
There was a problem hiding this comment.
This is an automated re-review of the changes pushed since my earlier automated review. Feel free to ignore it.
The earlier ask is addressed. SparkFilePath::new no longer trusts the parsed userinfo for a hostless s3a alias, and hostless_alias strips userinfo from every segment that can still become the bucket, including ones a later .. or %2e%2e discards. I ran the new head on s3a:///u:p@bucket/../x/y, s3a:///u:p@bucket/%2e%2e/x, the one-slash and four-slash spellings, mixed-case dot segments, and a drive-letter segment, and none of them show the password. A randomized check of about 600,000 hostless paths built from dot segments, empty segments, drive letters, and one credential-bearing segment found no case where that segment was printed while it could still become the bucket. I found nothing else in the delta to raise.
comphead
left a comment
There was a problem hiding this comment.
I read the redaction paths at the PR head and found no remaining credential leak in the scan error or the S3 setup log. The planner is the only place that builds the diagnostic path, s3.rs now logs only config keys, and the other URL-bearing messages already go through url_redaction.rs from #7127. My one concern is that this PR adds a second, hand-written redaction implementation instead of using that one.
viirya
left a comment
There was a problem hiding this comment.
Thanks @sunchao. I found no remaining leak in the new code.
One gap outside the diff: the CannotReadFile fallback in SparkErrorConverter fills filePath from taskFilePaths, which CometNativeScanExec builds from _.filePath.toString without redaction. That puts every file of the task, unredacted, into the same FAILED_READ_FILE error. Could the description scope the claim to the overflow path, or should that fallback get the same treatment?
Which issue does this PR close?
Part of #7128. This covers two diagnostics alongside #7556, #7561, #7562 and #7565.
Rationale for this change
The native Parquet reader reports the failing file when a millisecond timestamp overflows during conversion to microseconds. The planner saves Spark's file URL for that error. S3 setup also logs the resolved Hadoop settings, including the endpoint. Either URL can carry credentials.
The scan change is specific to
ParquetTimestampOverflow. The separate JVMCannotReadFilefallback builds a list fromtaskFilePathsand is outside this PR. SparkErrorConverterWhat changes are included in this PR?
How are these changes tested?
A planner regression checks the per-file path saved for the overflow error. It covers encoded filename characters, Azure containers and S3 alias normalization, including a discarded bucket segment. Existing Spark scan tests exercise overflow reporting across files and batches.
An S3 regression checks the logged settings for a per-bucket endpoint, verifies that the builder retains the original value and covers malformed endpoints. Hosted CI runs the tests.