There are two way to write dataset on postgresql through the spark api or through the postgresql copy function
dataset..mode(SaveMode.Append)
.jdbc(connectionString,
,auroraProperties);
- Append, will append the new records to existent table
- Overwrite, will DROP the table and replace it with these new values.
- Ignore, will the table exist or in case of error will skip the operation
new DatasetPostgresqlCopy().save(new AuroraPropertiesSupplier(),"tableName",dataset);
url=jdbc:postgresql://addressDatabase:5432/schemaname
user=username
password=password
driver=org.postgresql.Driver