Skip to content

Commit c731713

Browse files
fernandomoramerlinrabens
authored andcommitted
Makes all feeds traits
1 parent 2e18750 commit c731713

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/main/scala/com/intenthq/action_processor/integrationsV2/feeds/HiveFeed.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import doobie.util.transactor.{Strategy, Transactor}
66

77
import scala.util.Properties
88

9-
abstract class HiveFeed[I, O] extends SQLFeed[I, O]("org.apache.hive.jdbc.HiveDriver") with TimeMeta with JavaLegacyTimeMeta {
9+
trait HiveFeed[I, O] extends SQLFeed[I, O] with TimeMeta with JavaLegacyTimeMeta {
10+
override protected val driver: String = "org.apache.hive.jdbc.HiveDriver"
1011
override protected lazy val transactor: Transactor[IO] = Transactor.strategy.set(createTransactor, Strategy.void)
1112
override protected val jdbcUrl: String = Properties.envOrElse("HIVE_JDBC_URL", "jdbc:hive2://localhost:10000")
1213
}

src/main/scala/com/intenthq/action_processor/integrationsV2/feeds/SQLFeed.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ import doobie.util.query.Query0
66
import doobie.util.transactor.Transactor
77
import doobie.util.transactor.Transactor.Aux
88

9-
abstract class SQLFeed[I, O](driver: String) extends Feed[I, O] with DoobieImplicits {
9+
trait SQLFeed[I, O] extends Feed[I, O] with DoobieImplicits {
1010

11+
protected val driver: String
1112
protected val jdbcUrl: String
1213
protected def query(sourceContext: SourceContext[IO]): Query0[I]
1314

src/test/scala/com/intenthq/action_processor/integrations/SQLFeedSpec.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ case class ExampleCsvFeedRow(integer: Int,
105105
timestamp: Instant
106106
)
107107

108-
abstract class H2Source[I, O] extends SQLFeed[I, O]("org.h2.Driver") with TimeMeta with JavaTimeMeta {
108+
abstract class H2Source[I, O] extends SQLFeed[I, O] with TimeMeta with JavaTimeMeta {
109+
override protected val driver: String = "org.h2.Driver"
109110
override protected val jdbcUrl: String = "jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;USER=sa;PASSWORD="
110111
}
111112

0 commit comments

Comments
 (0)