Repository navigation
Conversation
Current coverage is
|
There was a problem hiding this comment.
The only change in this block was to wrap the actual COPY statement itself in this foreach block in order to skip the copy if no non-empty Avro partitions were written.
|
I will run this patch with the same queries that were causing issues tonight; specifically I know of a query that actually causes 0 rows to be returned (something from last Thanksgiving) which would be a decent full coverage test. |
|
@cfeduke, did you end up getting a chance to try this out? I'm fairly confident that this should fix the issue, given the regression tests that I added, but more evidence from a real use-case never hurts. |
|
LGTM |
|
Alright, going to merge this now (given that it has integration tests). |
This patch addresses an issue where `spark-redshift` would run into "Mandatory url is not present in manifest file" errors when saving data back to Redshift if a pre-2.0.0 version of `spark-avro` was used at runtime. This problem should not arise for most users of `spark-redshift`, since the proper version of `spark-avro` should automatically be pulled in via Maven or Ivy; the goal of this patch is to provide compatibility for users who cannot upgrade `spark-avro` for other compatibility-related reasons. **Cause of the write path bug**: In order to fix a crash that could occur when writing tables containing empty partitions, #99 modified the write path to use manifest files that instruct Redshift to load only the non-empty partitions' Avro files. The code that handled processing of filenames when generating the manifest made assumptions about filenames that hold for spark-avro 2.0.0+ but not for spark-avro 1.0.0. **Solution**: use a different method to build the correct list of part file names when constructing the manifest. Fixes #111. Author: Josh Rosen <joshrosen@databricks.com> Closes #114 from JoshRosen/compatibility-with-spark-avro-1.0.
This WIP patch fixes #96, an issue where Redshift's COPY command did not cope well with empty Avro partitions.
The fix implemented here is to use a manifest to instruct Redshift to load only the non-empty partitions' Avro files.