Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12119#discussion_r58281660
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala ---
    @@ -246,22 +248,58 @@ final class DataFrameWriter private[sql](df: 
DataFrame) {
        * @since 2.0.0
        */
       def startStream(): ContinuousQuery = {
    -    val dataSource =
    -      DataSource(
    -        df.sqlContext,
    -        className = source,
    -        options = extraOptions.toMap,
    -        partitionColumns = normalizedParCols.getOrElse(Nil))
    -
    -    val queryName = extraOptions.getOrElse("queryName", 
StreamExecution.nextName)
    -    val checkpointLocation = extraOptions.getOrElse("checkpointLocation", {
    -      new Path(df.sqlContext.conf.checkpointLocation, 
queryName).toUri.toString
    -    })
    -    df.sqlContext.sessionState.continuousQueryManager.startQuery(
    -      queryName,
    -      checkpointLocation,
    -      df,
    -      dataSource.createSink())
    +    if (source == "memory") {
    +      val queryName =
    +        extraOptions.getOrElse(
    +          "queryName", throw new AnalysisException("queryName must be 
specified for memory sink"))
    +      val checkpointLocation = extraOptions.get("checkpointLocation").map 
{ userSpecified =>
    +        new Path(userSpecified).toUri.toString
    +      }.orElse {
    +        val checkpointConfig = 
df.sqlContext.conf.getConfOption(SQLConf.CHECKPOINT_LOCATION)
    +        checkpointConfig.map { location =>
    +          new Path(location, queryName).toUri.toString
    +        }
    +      }.getOrElse {
    +        Utils.createTempDir("memory.stream").getCanonicalPath
    --- End diff --
    
    Use `Utils.createTempDir(namePrefix = "memory.stream")` so that the folder 
comes to `java.io.tmpdir`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to