Skip to content

Configuration

Options go on .option("name", "value") in Scala/Python or inside OPTIONS (...) in SQL. Names are matched case-insensitively. Any option not listed below is forwarded to the PostgreSQL JDBC driver, which is how you pass through standard JDBC parameters like loginTimeout or socketTimeout.

Every write sets these four. Any missing option throws IllegalArgumentException before Spark starts a task.

OptionDefaultTierNotes
url—CommunityPostgreSQL JDBC URL
dbtable—CommunityTarget table name
user—CommunityDatabase user
password—CommunityDatabase password
driverorg.postgresql.DriverCommunityOverride only for a shaded driver class
OptionDefaultTierNotes
writeModeappendappend / overwrite Community; upsert Community with one key, Pro with composite keysInvalid values throw IllegalArgumentException
mergeKeys—Pro when more than one keyRequired for upsert; comma-separated, whitespace trimmed
batchSize1000CommunityRows per write batch
OptionDefaultTierNotes
schemaEvolutionstrictstrict Community; see notes for non-default modesstrict, addColumns, alignToTarget, warn
schemaEvolutionAllowTableRewritefalseProRequired for widenings that rewrite the whole table
columnCaseSensitivefalseCommunityWhen false, identifiers fold to lowercase
validationModeskipskip Community; other modes paidskip, strict, warnAndFilter
OptionDefaultTierNotes
maxRetries3CommunityTotal attempts including the first
retryBackoffMs1000CommunityInitial backoff in milliseconds
retryBackoffMultiplier2.0CommunityExponential factor between attempts
OptionDefaultTierNotes
maxPoolSizespark.executor.cores (fallback: 2)CommunityMaximum concurrent connections per active Spark process
minIdle0CommunityMinimum idle connections
connectionTimeout30000Communityms to wait for a connection
idleTimeout30000Communityms before idle connections close
maxLifetime1800000Communityms before a connection is retired

See Tuning and Metrics for connection-budget math and tuning guidance.

OptionDefaultTierNotes
sslfalsePro when trueEnables TLS
sslModerequireProdisable, allow, prefer, require, verify-ca, verify-full
sslCert—EnterpriseClient certificate path
sslKey—EnterpriseClient private key path (PKCS#8 DER)
sslRootCert—EnterpriseRoot CA certificate path

See SSL and Security for file placement and key-format requirements.

OptionDefaultTierNotes
streamingExactlyOncefalseEnterprise with streamingEnables replay protection for committed microbatches
commitLogTable—Enterprise with streamingOverride the bookkeeping table used by exactly-once mode
commitLogRetentionEpochs—Enterprise with streamingPositive integer; prunes old tracking rows after commit

checkpointLocation is still a Spark Structured Streaming option, not a PGStyx option. Use Streaming for delivery and checkpointing guidance.

OptionDefaultTierNotes
metricsEnabledtrueCommunityTracks built-in counters for Metrics.getReport()
licenseKey—CommunityRequired for any Pro or Enterprise capability

If any of the following is set, the job requires a matching licenseKey:

  • More than one mergeKeys value — Pro.
  • schemaEvolution=addColumns or schemaEvolution=alignToTarget — paid-plan schema-evolution modes.
  • schemaEvolutionAllowTableRewrite=true — Pro.
  • validationMode set to anything other than skip — Pro.
  • ssl=true — Pro.
  • Any of sslCert, sslKey, sslRootCert with ssl=true — Enterprise.
  • .writeStream.format("pgstyx") — Enterprise.
  • streamingExactlyOnce=true — Enterprise.

Missing or invalid license throws LicenseException at write-build time, naming the gated feature.