Skip to content

Commit

Permalink
Better logging of Option[input]
Browse files Browse the repository at this point in the history
  • Loading branch information
seddonm1 committed Jul 18, 2019
1 parent cbe3127 commit caa9fbf
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 13 deletions.
5 changes: 4 additions & 1 deletion src/main/scala/ai/tripl/arc/extract/AvroExtract.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ class AvroExtract extends PipelineStagePlugin {
)

stage.stageDetail.put("contiguousIndex", java.lang.Boolean.valueOf(contiguousIndex))
stage.stageDetail.put("input", input)
input match {
case Left(inputView) => stage.stageDetail.put("inputView", inputView)
case Right(parsedGlob) =>stage.stageDetail.put("inputURI", parsedGlob)
}
stage.stageDetail.put("outputView", outputView)
stage.stageDetail.put("persist", java.lang.Boolean.valueOf(persist))
for (inputField <- inputField) {
Expand Down
5 changes: 4 additions & 1 deletion src/main/scala/ai/tripl/arc/extract/BytesExtract.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ class BytesExtract extends PipelineStagePlugin {
)

stage.stageDetail.put("failMode", stage.failMode.sparkString)
stage.stageDetail.put("input", if (c.hasPath("inputView")) inputView else parsedGlob)
input match {
case Left(inputView) => stage.stageDetail.put("inputView", inputView)
case Right(parsedGlob) =>stage.stageDetail.put("inputURI", parsedGlob)
}
stage.stageDetail.put("outputView", outputView)
stage.stageDetail.put("persist", java.lang.Boolean.valueOf(stage.persist))
stage.stageDetail.put("params", params.asJava)
Expand Down
7 changes: 3 additions & 4 deletions src/main/scala/ai/tripl/arc/extract/DelimitedExtract.scala
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,10 @@ class DelimitedExtract extends PipelineStagePlugin {
case Some(basePath) => Delimited.toSparkOptions(stage.settings) + ("basePath" -> basePath)
case None => Delimited.toSparkOptions(stage.settings)
}
val inputValue = stage.input match {
case Left(view) => view
case Right(glob) => glob
input match {
case Left(inputView) => stage.stageDetail.put("inputView", inputView)
case Right(parsedGlob) =>stage.stageDetail.put("inputURI", parsedGlob)
}
stage.stageDetail.put("input", inputValue)
stage.stageDetail.put("options", options.asJava)
for (inputField <- inputField) {
stage.stageDetail.put("inputField", inputField)
Expand Down
5 changes: 4 additions & 1 deletion src/main/scala/ai/tripl/arc/extract/HTTPExtract.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ class HTTPExtract extends PipelineStagePlugin {
)

stage.stageDetail.put("headers", HTTPUtils.maskHeaders("Authorization" :: Nil)(stage.headers).asJava)
stage.stageDetail.put("input", if(c.hasPath("inputView")) inputView else parsedURI)
input match {
case Left(inputView) => stage.stageDetail.put("inputView", inputView)
case Right(parsedGlob) =>stage.stageDetail.put("inputURI", parsedGlob)
}
stage.stageDetail.put("method", method)
stage.stageDetail.put("outputView", outputView)
stage.stageDetail.put("persist", java.lang.Boolean.valueOf(persist))
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/ai/tripl/arc/extract/ImageExtract.scala
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ImageExtract extends PipelineStagePlugin {
stage.stageDetail.put("basePath", basePath)
}
stage.stageDetail.put("dropInvalid", java.lang.Boolean.valueOf(dropInvalid))
stage.stageDetail.put("input", parsedGlob)
stage.stageDetail.put("inputURI", parsedGlob)
stage.stageDetail.put("outputView", outputView)
stage.stageDetail.put("persist", java.lang.Boolean.valueOf(persist))
stage.stageDetail.put("params", params.asJava)
Expand Down
5 changes: 4 additions & 1 deletion src/main/scala/ai/tripl/arc/extract/JSONExtract.scala
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ class JSONExtract extends PipelineStagePlugin {
)

stage.stageDetail.put("contiguousIndex", java.lang.Boolean.valueOf(contiguousIndex))
stage.stageDetail.put("input", input)
input match {
case Left(inputView) => stage.stageDetail.put("inputView", inputView)
case Right(parsedGlob) =>stage.stageDetail.put("inputURI", parsedGlob)
}
stage.stageDetail.put("outputView", outputView)
stage.stageDetail.put("persist", java.lang.Boolean.valueOf(persist))
stage.stageDetail.put("options", JSON.toSparkOptions(stage.settings).asJava)
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/ai/tripl/arc/extract/ORCExtract.scala
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ORCExtract extends PipelineStagePlugin {
)

stage.stageDetail.put("contiguousIndex", java.lang.Boolean.valueOf(contiguousIndex))
stage.stageDetail.put("input", parsedGlob)
stage.stageDetail.put("inputURI", parsedGlob)
stage.stageDetail.put("outputView", outputView)
stage.stageDetail.put("persist", java.lang.Boolean.valueOf(persist))
for (basePath <- basePath) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/ai/tripl/arc/extract/ParquetExtract.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ParquetExtract extends PipelineStagePlugin {
contiguousIndex=contiguousIndex
)

stage.stageDetail.put("input", parsedGlob)
stage.stageDetail.put("inputURI", parsedGlob)
stage.stageDetail.put("outputView", outputView)
stage.stageDetail.put("persist", java.lang.Boolean.valueOf(persist))
stage.stageDetail.put("contiguousIndex", java.lang.Boolean.valueOf(contiguousIndex))
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/ai/tripl/arc/extract/TextExtract.scala
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class TextExtract extends PipelineStagePlugin {
)

stage.stageDetail.put("contiguousIndex", java.lang.Boolean.valueOf(contiguousIndex))
stage.stageDetail.put("input", parsedGlob)
stage.stageDetail.put("inputURI", parsedGlob)
stage.stageDetail.put("multiLine", java.lang.Boolean.valueOf(multiLine))
stage.stageDetail.put("outputView", outputView)
stage.stageDetail.put("persist", java.lang.Boolean.valueOf(persist))
Expand Down
5 changes: 4 additions & 1 deletion src/main/scala/ai/tripl/arc/extract/XMLExtract.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ class XMLExtract extends PipelineStagePlugin {
contiguousIndex=contiguousIndex
)

stage.stageDetail.put("input", input)
input match {
case Left(inputView) => stage.stageDetail.put("inputView", inputView)
case Right(parsedGlob) =>stage.stageDetail.put("inputURI", parsedGlob)
}
stage.stageDetail.put("outputView", outputView)
stage.stageDetail.put("persist", java.lang.Boolean.valueOf(persist))
stage.stageDetail.put("contiguousIndex", java.lang.Boolean.valueOf(contiguousIndex))
Expand Down

0 comments on commit caa9fbf

Please sign in to comment.