mccheah commented on a change in pull request #7: Allow custom hadoop
properties to be loaded in the Spark data source
URL: https://github.com/apache/incubator-iceberg/pull/7#discussion_r240442927
##########
File path:
spark/src/main/java/com/netflix/iceberg/spark/source/IcebergSource.java
##########
@@ -109,10 +113,19 @@ protected SparkSession lazySparkSession() {
return lazySpark;
}
- protected Configuration lazyConf() {
+ protected Configuration lazyBaseConf() {
if (lazyConf == null) {
this.lazyConf = lazySparkSession().sparkContext().hadoopConfiguration();
}
return lazyConf;
}
+
+ protected Configuration mergeIcebergHadoopConfs(Configuration baseConf,
Map<String, String> options) {
+ Configuration resolvedConf = new Configuration(baseConf);
+ options.keySet().stream()
+ .filter(key -> key.startsWith("iceberg.hadoop"))
+ .filter(key -> baseConf.get(key) == null)
Review comment:
I rewrote some of this in my latest push to reflect the suggested order of
precedence given in [a few comments
up](https://github.com/apache/incubator-iceberg/pull/7#discussion_r239177508).
I think the precedence should have the Spark Context's and the write options
take higher precedence than what's specified in table properties. Given that,
merging hadoop configurations in the helper methods needs to have a flag
knowing whether or not to override. Thoughts on the new approach?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services