title: Specifying "basePath" option in Spark Structured Streaming
body: <p>Is it possible to set the <code>basePath</code> option when reading partitioned data in Spark Structured Streaming (in Java)? I want to load only the data in a specific partition, such as <code>basepath/x=1/</code>, but I also want <code>x</code> to be loaded as a column. Setting <code>basePath</code> the way I would for a non-streaming dataframe doesn't seem to work.</p>
  
  <p>Here's a minimal example. I have a dataframe containing the following data:</p>
  
  <pre><code>+---+---+
  |  a|  b|
  +---+---+
  |  1|  2|
  |  3|  4|
  +---+---+
  </code></pre>
  
  <p>I wrote this as a Parquet file to a subdirectory named <code>x=1</code>.</p>
  
  <p>The following code (with a regular non-streaming dataframe) works fine:</p>
  
  <pre><code>Dataset&lt;Row&gt; data = sparkSession.read()
    .option("basePath", basePath)
    .parquet(basePath + "/x=1");
  
  data.show();
  </code></pre>
  
  <p>This produces the expected result:</p>
  
  <pre><code>+---+---+---+
  |  a|  b|  x|
  +---+---+---+
  |  1|  2|  1|
  |  3|  4|  1|
  +---+---+---+
  </code></pre>
  
  <p>However, the following (using the Structured Streaming API) doesn't work:</p>
  
  <pre><code>StructType schema = data.schema(); // data as defined above
  
  Dataset&lt;Row&gt; streamingData = sparkSession.readStream()
    .schema(schema)
    .option("basePath", basePath)
    .parquet(basePath + "/x=1");
  
  streamingData.writeStream()
    .trigger(Trigger.Once())
    .format("console")
    .start().awaitTermination();
  </code></pre>
  
  <p>The dataframe, in this case, doesn't contain any rows:</p>
  
  <pre><code>+---+---+---+
  |  a|  b|  x|
  +---+---+---+
  +---+---+---+
  </code></pre>