Skip to content
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

add 'create_table_if_not_exist' params #352

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Joongho
Copy link

@Joongho Joongho commented Jun 6, 2017

This is useful when merge operation.

  1. create temp table A (like schema.A) -> run by preactions
  2. load into table A ( dbtable = A )
  3. update/insert -> run by postactions

Above scenario, table A(=dbtable) should not be created

@kyrozetera
Copy link

How is this different than setting a SaveMode?

@Joongho
Copy link
Author

Joongho commented Aug 11, 2017

It's upsert(=merge) operation.

schema.A is final target table, A is temp table.

  1. update schema.A set ... where schema.A.pk1 = A.pk1 and schema.A.pk2 = A.pk2 ...
  2. insert int schema.A
    select * from A s
    left join schema.A t
    on t.pk1=s.pk1 and t.pk2=s.pk2
    where t.pk1 is null and t.pk2 is null ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants