-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a MappingFieldsTransformer #18
Comments
programarivm
changed the title
Adding a
Adding a MappingFieldsTransformer
Apr 22, 2018
MappingFieldsTransformer
Just added a |
I like the idea, posted my thoughts in #17 (comment). 👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there,
Thanks for sharing Extraload with the community. It would be great if some more examples and documentation could be added to the library.
Why would we need a
MappingFieldsTransformer?
I noticed that many times we'll go like this.
Source
books
:isbn
,title
,author
Destination
my_books
:foo
,bar
In this example we're loading the contents of
books.isbn
intomy_books.foo
; the same thing goes forbooks.author
(we load its content intomy_books.bar
). And note thebooks.title
field is not used in the target table.The example above shows a
3 -> 2
mapping between the tablesbooks
andmy_books
because we want to (1) change the names of the fields in the target table and (2) be able to choose which source table fields are actually loaded into the destination table.More specifically, this
3 -> 2
mapping in particular could be described like this in theMappingFieldsTransformer
:I believe this is very common -- I'll soon share a
MappingFieldTransformer
if all this makes sense. In fact it would be good to have a bunch of common transformers:MappingFieldsTransfomer
TrimTransformer
...
And write a few more examples on using them.
The text was updated successfully, but these errors were encountered: