forked from Acxiom/metalus
-
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.
Acxiom#345 Added FlowUtils.readStream step to allow windowing data fr…
…om a source to a pipeline.
- Loading branch information
Showing
7 changed files
with
174 additions
and
8 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
22 changes: 22 additions & 0 deletions
22
metalus-core/src/test/resources/metadata/pipelines/in-memory-fail-flow.json
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,22 @@ | ||
{ | ||
"id": "in-memory-flow", | ||
"name": "InMemory Test Pipeline", | ||
"steps": [ | ||
{ | ||
"id": "VALIDATE_DATA", | ||
"type": "Pipeline", | ||
"params": [ | ||
{ | ||
"type": "object", | ||
"name": "dataRef", | ||
"required": true, | ||
"value": "!streamedDataReference" | ||
} | ||
], | ||
"engineMeta": { | ||
"command": "MockStepObject.mockExceptionStepFunction", | ||
"pkg": "com.acxiom.metalus" | ||
} | ||
} | ||
] | ||
} |
28 changes: 28 additions & 0 deletions
28
metalus-core/src/test/resources/metadata/pipelines/in-memory-flow.json
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,28 @@ | ||
{ | ||
"id": "in-memory-flow", | ||
"name": "InMemory Test Pipeline", | ||
"steps": [ | ||
{ | ||
"id": "VALIDATE_DATA", | ||
"type": "Pipeline", | ||
"params": [ | ||
{ | ||
"type": "object", | ||
"name": "dataRef", | ||
"required": true, | ||
"value": "!streamedDataReference" | ||
}, | ||
{ | ||
"type": "object", | ||
"name": "results", | ||
"required": true, | ||
"value": "!rowBuffer" | ||
} | ||
], | ||
"engineMeta": { | ||
"command": "MockStepObject.validateDataReference", | ||
"pkg": "com.acxiom.metalus.steps" | ||
} | ||
} | ||
] | ||
} |
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
9 changes: 9 additions & 0 deletions
9
metalus-core/src/test/scala/com/acxiom/metalus/steps/MockStepObject.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 |
---|---|---|
@@ -1,9 +1,18 @@ | ||
package com.acxiom.metalus.steps | ||
|
||
import com.acxiom.metalus.sql.{DataReference, InMemoryDataReference, Row} | ||
|
||
import scala.collection.mutable.ListBuffer | ||
|
||
object MockStepObject { | ||
|
||
def mockStepFunctionAnyResponse(string: String): String = { | ||
string | ||
} | ||
|
||
def validateDataReference(dataRef: DataReference[_], results: ListBuffer[Row]): Unit = { | ||
assert(dataRef.isInstanceOf[InMemoryDataReference]) | ||
val table = dataRef.asInstanceOf[InMemoryDataReference].execute | ||
table.data.foreach(r => results += Row(r, Some(table.schema), None)) | ||
} | ||
} |