Repository navigation
HadoopGeoTiffRDD and S3GeoTiffRDD add overloads to use file names in keys - #2050
Conversation
Signed-off-by: Grigory Pomadchin <[email protected]>
50f42c3 to
80ffe05
Compare
|
This breaks API - I'd want to think through this in a way that won't break the API if possible... Is this the only way to accomplish this? |
|
Maybe if we just create the necessary overloads of public methods to maintain the signatures that existed before, this will work. |
lossyrob
left a comment
There was a problem hiding this comment.
Needs overloads to not break public API.
| * @tparam K | ||
| * @return | ||
| */ | ||
| def keyTransformId[K] = (_: URI, key: K) => key |
There was a problem hiding this comment.
Unclear that this is necessary, if the overloads are properly aligned.
|
@lossyrob sure: first approach to create smth like spark did: ~ P.P.S. I wrote it before comments above, didn't notice; |
|
We can just overload apply to pass through the same sort of default keyTransform as the other methods. |
Signed-off-by: Grigory Pomadchin <[email protected]>
Signed-off-by: Grigory Pomadchin <[email protected]>
ece8450 to
fb01b0b
Compare
Signed-off-by: Grigory Pomadchin <[email protected]>
|
Usage example are in tests and here. |
|
Is there a good spot in docs for noting this? |
|
What needs to be noted, exactly? If there was a deprecation, it should be explained in a I don't think deprecation notices need to go into ReadTheDocs, other than in the CHANGELOG. |
| rr.readWindow(reader, pixelWindow, options) | ||
| val (k, v) = rr.readWindow(reader, pixelWindow, options) | ||
|
|
||
| keyTransform(new URI(objectRequest.getKey), k) -> v |
There was a problem hiding this comment.
getKey will only give you the path without the s3://bucket/ prefix
| * @param bucket Name of the bucket on S3 where the files are kept. | ||
| * @param prefix Prefix of all of the keys on S3 that are to be read in. | ||
| * @param keyTransform function to transform input key basing on the URI information. | ||
| */ |
There was a problem hiding this comment.
keyTransform is a little overloaded with the way we use it for SFC. This should be renamed to uriToKey or something similar.
| * @param options An instance of [[Options]] that contains any user defined or default settings. | ||
| */ | ||
| def apply[K, V](path: Path, options: Options = Options.DEFAULT)(implicit sc: SparkContext, rr: RasterReader[Options, (K, V)]): RDD[(K, V)] = { | ||
| def apply[I, K, V](path: Path, keyTransform: (URI, I) => K, options: Options)(implicit sc: SparkContext, rr: RasterReader[Options, (I, V)]): RDD[(K, V)] = { |
There was a problem hiding this comment.
Not certain if use of URI here provides opportunity to use a more general function. We should probably just use Path here.
ec71d1f to
004d984
Compare
Fixes #1958 without a significant API change. This PR introduces a
keyTransform: (URI, I) => Kfunction to have ability to read necessary metadata from files paths, and to modifyInput key.