From b4f423438e9726d9c5efdb295552e8e737e2ca8f Mon Sep 17 00:00:00 2001 From: Saad Rashid Date: Thu, 20 Feb 2014 16:21:06 +0000 Subject: Update Scalding and Cascading latest release and pom versions. Now SpyGlass supports scalding (0.9.0rc4) and cascading (2.2.1). Its a release candidate. --- src/main/scala/parallelai/spyglass/jdbc/JDBCSource.scala | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/main/scala/parallelai/spyglass/jdbc') diff --git a/src/main/scala/parallelai/spyglass/jdbc/JDBCSource.scala b/src/main/scala/parallelai/spyglass/jdbc/JDBCSource.scala index beb66be..09f4579 100644 --- a/src/main/scala/parallelai/spyglass/jdbc/JDBCSource.scala +++ b/src/main/scala/parallelai/spyglass/jdbc/JDBCSource.scala @@ -28,11 +28,11 @@ case class JDBCSource( updateByFields: Fields = null ) extends Source { - override val hdfsScheme = new JDBCScheme(fields, columnNames.toArray, orderBy.toArray, updateByFields, updateBy.toArray) + val hdfsScheme = new JDBCScheme(fields, columnNames.toArray, orderBy.toArray, updateByFields, updateBy.toArray) .asInstanceOf[Scheme[JobConf, RecordReader[_, _], OutputCollector[_, _], _, _]] // To enable local mode testing - override def localScheme = new NullScheme(fields, fields) + def localScheme = new NullScheme(fields, fields) override def createTap(readOrWrite: AccessMode)(implicit mode: Mode): Tap[_, _, _] = { val jdbcScheme = hdfsScheme match { @@ -53,7 +53,15 @@ case class JDBCSource( jdbcTap.asInstanceOf[Tap[_,_,_]] } } - case _ => super.createTap(readOrWrite)(mode) + case _ => createEmptyTap(readOrWrite)(mode) } } + + def createEmptyTap(readOrWrite : AccessMode)(mode : Mode) : Tap[_,_,_] = { + mode match { + case _ => { + throw new RuntimeException("Source: (" + toString + ") doesn't support mode: " + mode.toString) + } + } + } } -- cgit v1.2.3