Validate the ConnectionString when its used to create Read and Write Configurations

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Major - P3
    • 0.2
    • Affects Version/s: 0.1
    • Component/s: Configuration
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently invalid URI's will throw an error but it can be unclear as to what the cause of the error is.

      ====
      Was: Trim Empty / White Space From MongoDB URI Parameters

      Trailing whitespace on MongoURI parameter causes an IllegalArgumentException. Example follows.

      vagrant@vagrant-ubuntu-trusty-64:~/spark-1.6.1$ ./bin/spark-shell  --packages org.mongodb.spark:mongo-spark-connector_2.10:0.1 --conf "spark.mongodb.input.uri=mongodb://127.0.0.1/test.coll?readPreference=primaryPreferred
      > "
      
      ...
      
      scala> val rdd = sc.loadFromMongoDB()
      java.lang.IllegalArgumentException: No match for read preference of primaryPreferred
      
              at com.mongodb.ReadPreference.valueOf(ReadPreference.java:237)
      

              Assignee:
              Unassigned
              Reporter:
              Bryan Reinero (Inactive)
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: