-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add type partition for bad row partition persistence (closes #16)
- Loading branch information
1 parent
488c77e
commit ff70ba2
Showing
7 changed files
with
311 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/scala/com/snowplowanalytics/storage/googlecloudstorage/loader/RowType.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.snowplowanalytics.storage.googlecloudstorage.loader | ||
|
||
import com.snowplowanalytics.iglu.core.SchemaKey | ||
|
||
/** Type of row which determined according to schema of self describing data */ | ||
sealed trait RowType extends Product with Serializable { | ||
def getName(): String | ||
} | ||
|
||
object RowType { | ||
|
||
/** Represents cases where row type could not be determined | ||
* since either row is not valid json or it is not self | ||
* describing json | ||
*/ | ||
case class PartitionError(errorDir: String) extends RowType { | ||
override def getName(): String = errorDir | ||
} | ||
|
||
/** Represents cases where type of row can be determined successfully | ||
* e.g. does have proper schema key | ||
*/ | ||
case class SelfDescribing(schemaKey: SchemaKey) extends RowType { | ||
override def getName(): String = s"${schemaKey.vendor}.${schemaKey.name}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.