Uploaded image for project: 'Spark Connector'
  1. Spark Connector
  2. SPARK-435

Unsupported conf `spark.mongodb.read.readPreference.name`

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: 10.4.0
    • Component/s: Configuration
    • None
    • Java Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      > https://www.mongodb.com/docs/spark-connector/upcoming/batch-mode/batch-read-config/#specifying-properties-in-connection.uri

      According to the documentation, mongo spark supports setting readPreference.name via `spark.mongodb.read.readPreference.name` instead of on `spark.mongodb.read.connection.uri`.

      But actually only the options in `spark.mongodb.read.connection.uri` take effect. See the code https://github.com/mongodb/mongo-spark/blob/757229db71e7173ea81fc0b355756f8ea3932460/src/main/java/com/mongodb/spark/sql/connector/connection/DefaultMongoClientFactory.java#L49

      Should we update the documentation or modify the code to support `spark.mongodb.read.readPreference.name`?

            Assignee:
            ross@mongodb.com Ross Lawley
            Reporter:
            szy917@outlook.com Zack Sun
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: