-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an example of the new Presto task (#9)
* Presto task * flesh out * feedback * feedback2 * match flytekit example * bump version
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from __future__ import absolute_import | ||
|
||
from flytekit.sdk.tasks import inputs | ||
from flytekit.sdk.types import Types | ||
from flytekit.sdk.workflow import workflow_class, Input, Output | ||
from flytekit.common.tasks.presto_task import SdkPrestoTask | ||
|
||
schema = Types.Schema([("a", Types.String), ("b", Types.Integer)]) | ||
|
||
presto_task = SdkPrestoTask( | ||
task_inputs=inputs(ds=Types.String, rg=Types.String), | ||
statement="SELECT * FROM hive.city.fact_airport_sessions WHERE ds = '{{ .Inputs.ds}}' LIMIT 10", | ||
output_schema=schema, | ||
routing_group="{{ .Inputs.rg }}", | ||
# catalog="hive", | ||
# schema="city", | ||
) | ||
|
||
|
||
@workflow_class() | ||
class PrestoWorkflow(object): | ||
ds = Input(Types.String, required=True, help="Test string with no default") | ||
# routing_group = Input(Types.String, required=True, help="Test string with no default") | ||
|
||
p_task = presto_task(ds=ds, rg='etl') | ||
|
||
output_a = Output(p_task.outputs.results, sdk_type=schema) |
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,4 +1,4 @@ | ||
flytekit[sidecar,schema]==0.6.0b1 | ||
flytekit[sidecar,schema]==0.6.0b6 | ||
statsd | ||
opencv-python==3.4.4.19 | ||
k8s-proto>=0.0.2 |