jfz commented on code in PR #4760:
URL: https://github.com/apache/iceberg/pull/4760#discussion_r875095508
##########
api/src/main/java/org/apache/iceberg/io/LocationProvider.java:
##########
@@ -37,6 +38,17 @@ public interface LocationProvider extends Serializable {
*/
String newDataLocation(String filename);
+ /**
+ * Return a fully-qualified data file location for the given filename and
options.
+ *
+ * @param filename a file name
+ * @param options options for deciding the location
+ * @return a fully-qualified location URI for a data file
+ */
+ default String newDataLocation(String filename, Map<String, String> options)
{
Review Comment:
It's not particularly designed for well integrated engines, for the sample
case in unit test, data writer may want to created data files in local region
and add to table with iceberg api like `AppendFiles.appendFile`, with extra
options, we can avoid users hard-coding locations by implementing a custom
LocationProvider.
I expect user to get location like this for `region1`:
`table.locationProvider().newDataLocation(filename, {region: current_region})`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]