Add slash at the end of the load path #1366
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jira ref: PDP-1569
Shredder puts together entities with the same schema model-revision-addition in the same batch under same folder. Let’s say you have events with
1-0-0
,1-0-1
and1-0-2
version of thecom.acme.test
in the same batch. In that case, resulting run folder will have following subfolders:Before the fix, Loader was using the s3 paths without slash (/) at the end in the created copy statements. This works fine in most cases. However, when same batch contains events with
1-0-1
and1-0-11
, then problem starts. In that case, run folder will have following subfolders:When entities in the
/model=1/revision=0/addition=1
are tried to be copied to respective table with copy statement, Redshift tries to copy the entities under/model=1/revision=0/addition=11
as well since they have same prefix and it gives error during the copy since data under/model=1/revision=0/addition=11
doesn’t have same structure with1-0-1
. Putting slash at the end of the path solved the problem. After that change, only entities undermodel=1/revision=0/addition=1
are copied as expected.