bahir-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lresende <...@git.apache.org>
Subject [GitHub] bahir pull request #38: [BAHIR-97] Akka as a streaming source for SQL Stream...
Date Wed, 05 Apr 2017 20:53:03 GMT
Github user lresende commented on a diff in the pull request:

    https://github.com/apache/bahir/pull/38#discussion_r110021854
  
    --- Diff: sql-streaming-akka/src/test/scala/org/apache/bahir/sql/streaming/akka/AkkaStreamSourceSuite.scala
---
    @@ -0,0 +1,188 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.bahir.sql.streaming.akka
    +
    +import java.io.File
    +
    +import scala.collection.JavaConverters._
    +import scala.collection.mutable
    +
    +import org.scalatest.BeforeAndAfter
    +
    +import org.apache.spark.{SharedSparkContext, SparkFunSuite}
    +import org.apache.spark.sql.{DataFrame, SQLContext}
    +import org.apache.spark.sql.execution.streaming.FileStreamSource.Timestamp
    +import org.apache.spark.sql.execution.streaming.LongOffset
    +
    +import org.apache.bahir.utils.BahirUtils
    +
    +class AkkaStreamSourceSuite extends SparkFunSuite with SharedSparkContext with BeforeAndAfter
{
    +
    +  protected var akkaTestUtils: AkkaTestUtils = _
    +  protected val tempDir: File =
    +    new File(System.getProperty("java.io.tmpdir") + "/spark-akka-persistence")
    +
    +  akkaTestUtils = new AkkaTestUtils
    +  akkaTestUtils.setup()
    +
    +  before {
    +    tempDir.mkdirs()
    +  }
    +
    +  after {
    +    Persistence.close()
    +    BahirUtils.recursiveDeleteDir(tempDir)
    +  }
    +
    +  protected val tmpDir: String = tempDir.getAbsolutePath
    +
    +  protected def createStreamingDataframe(dir: String = tmpDir): (SQLContext, DataFrame)
= {
    +
    +    val sqlContext: SQLContext = new SQLContext(sc)
    +
    --- End diff --
    
    Would you please change to use Sparksession instead of directly instantiating a SQLContext.


---
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.
---

Mime
View raw message