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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: 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?
    • None
    • None
    • None
    • None
    • None
    • None

      > 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 Lawley
              Reporter:
              Zack Sun
              None
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: