mccheah commented on a change in pull request #6: Support customizing the location where data is written in Spark URL: https://github.com/apache/incubator-iceberg/pull/6#discussion_r237681875
########## File path: spark/src/test/java/com/netflix/iceberg/spark/source/TestDataFrameWrites.java ########## @@ -91,23 +98,55 @@ public static void stopSpark() { @Override protected void writeAndValidate(Schema schema) throws IOException { + writeAndValidateWithLocations(schema, false, false); + } + + @Test + public void testWrite_overridingDataLocation_tablePropertyOnly() throws IOException { + writeAndValidateWithLocations(BASIC_SCHEMA, true, false); + } + + @Test + public void testWrite_overridingDataLocation_sourceOptionOnly() throws IOException { + writeAndValidateWithLocations(BASIC_SCHEMA, false, true); + } + + @Test + public void testWrite_overridingDataLocation_sourceOptionTakesPrecedence() throws IOException { + writeAndValidateWithLocations(BASIC_SCHEMA, true, true); + } + + private void writeAndValidateWithLocations( + Schema schema, + boolean setTablePropertyDataLocation, Review comment: Hm, rereading this I think it tries too hard to reuse code in exchange for the antipattern of using boolean switches. This can be written more idiomatically. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services