Skip to content
This repository was archived by the owner on Apr 15, 2022. It is now read-only.

Commit 6736776

Browse files
authored
Merge pull request #1 from splicemachine/DBAAS-1837
DBAAS-1837: adding upsert to pysplice
2 parents 2867d9d + 15c20f2 commit 6736776

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

splicemachine/spark/context.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ def insert(self, dataframe, schema_table_name):
9090
"""
9191
return self.context.insert(dataframe._jdf, schema_table_name)
9292

93+
def upsert(self, dataframe, schema_table_name):
94+
"""
95+
Upsert the data from a dataframe into a table (schema.table).
96+
97+
:param dataframe: (DF) The dataframe you would like to upsert
98+
:param schema_table_name: (string) The table in which you would like to upsert the RDD
99+
"""
100+
return self.context.upsert(dataframe._jdf, schema_table_name)
101+
93102
def delete(self, dataframe, schema_table_name):
94103
"""
95104
Delete records in a dataframe based on joining by primary keys from the data frame.

0 commit comments

Comments
 (0)