Customer reported using writeConcern.w: "Majority" causes the following error.
Caused by: com.mongodb.spark.sql.connector.exceptions.ConfigException: writeConcern.w did not contain a valid int, got: MAJORITY
Reviewing the Spark document for 10.0.4, setting "spark.mongodb.write.writeConcern.w=" you can use {}majority|0|1|2+{} values.
I can see the code is checking for an integer however, the catch should cover the use of Majority. Is this an expected behavior?
if (containsKey(WRITE_CONCERN_W_CONFIG)) { try { writeConcern = writeConcern.withW(getInt(WRITE_CONCERN_W_CONFIG, -1)); } catch (NumberFormatException e) { // ignore writeConcern = writeConcern.withW(get(WRITE_CONCERN_W_CONFIG)); } }
- is cloned by
-
SPARK-391 Spark connector writeConcern with MAJORITY value not properly supported
- Closed