spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vanzin <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-14288][SQL] Memory Sink for streaming
Date Wed, 06 Apr 2016 00:13:18 GMT
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12119#discussion_r58635261
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/DataFrameWriter.scala ---
    @@ -275,23 +279,64 @@ 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(),
    -      trigger)
    +    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: Option[String] =
    --- End diff --
    
    I see. This workaround looks fine for now (although you shouldn't need the `asInstanceOf`?),
and I can take a look at fixing optional handling in SQLConf separately. Sounds good?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message