Skip to content

Commit

Permalink
docs(tasks): snowflake stage (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-geller authored Jul 3, 2023
1 parent a6e6193 commit cdab0f8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
@Getter
@NoArgsConstructor
@Schema(
title = "Wait for query on a Snowflake database."
title = "Wait for a query on a Snowflake database."
)
@Plugin(
examples = {
@Example(
title = "Wait for a sql query to return results and iterate through rows",
title = "Wait for a SQL query to return results and iterate through rows",
full = true,
code = {
"id: jdbc-trigger",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@
@Getter
@NoArgsConstructor
@Schema(
title = "Upload data to an internal stage"
title = "Upload data to an internal stage. Make sure that the `stageName` follows the naming convention of `@databaseName.schemaName.%stageOrTableName`. For usage examples, check the Blueprints tagged with `Snowflake`."
)
@Plugin(
examples = {
@Example(
code = {
"stageName: MYSTAGE",
"prefix: testUploadStream",
"fileName: destFile.csv"
"from: '{{outputs.extract.uri}}'",
"fileName: data.csv",
"prefix: raw",
"stageName: @demo_db.public.%mytable",
"url: jdbc:snowflake://myAccountID.snowflakecomputing.com?warehouse=COMPUTE_WH&db=DEMO_DB&schema=PUBLIC&role=SYSADMIN",
"username: yourUsername",
"password: 'yourSnowflakePassword'",
}
)
}
Expand All @@ -43,36 +47,36 @@ public class Upload extends AbstractSnowflakeConnection implements RunnableTask<
private String role;

@Schema(
title = "The file to copy"
title = "Path to the file to load to internal stage in Snowflake"
)
@PluginProperty(dynamic = true)
@NotNull
private String from;

@Schema(
title = "The stage name",
description = "~ or table name or stage name"
description = "This can either be a stage name or a table name"
)
@PluginProperty(dynamic = true)
@NotNull
private String stageName;

@Schema(
title = "path / prefix under which the data should be uploaded on the stage"
title = "The prefix under which the file will be uploaded to the internal stage"
)
@PluginProperty(dynamic = true)
@NotNull
private String prefix;

@Schema(
title = "destination file name to use"
title = "Destination file name to use"
)
@PluginProperty(dynamic = true)
@NotNull
private String fileName;

@Schema(
title = "compress data or not before uploading stream"
title = "Whether to compress the file or not before uploading it to the internal stage"
)
@PluginProperty(dynamic = false)
@NotNull
Expand Down Expand Up @@ -115,7 +119,7 @@ public Upload.Output run(RunContext runContext) throws Exception {
@Getter
public static class Output implements io.kestra.core.models.tasks.Output {
@Schema(
title = "The url of the staged files"
title = "The URL of the staged files"
)
private final URI uri;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

public interface JdbcConnectionInterface {
@Schema(
title = "The jdbc url to connect to the database"
title = "The JDBC URL to connect to the database"
)
@PluginProperty(dynamic = true)
@NotNull
Expand Down

0 comments on commit cdab0f8

Please sign in to comment.