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

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

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 0.2
    • Affects Version/s: 0.1
    • Component/s: Configuration
    • 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 Unassigned
            Reporter:
            bryan.reinero Bryan Reinero
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: