Skip to content

Commit

Permalink
Merge pull request #207 from shrutimantri/doc_correection_4
Browse files Browse the repository at this point in the history
fix(docs): correct the docs for multiple jdbc plugins
  • Loading branch information
anna-geller authored Jan 3, 2024
2 parents 1c43c85 + 05fb2f0 commit 8e136ff
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public Query.Output run(RunContext runContext) throws Exception {
@Getter
public static class Output extends AbstractJdbcQuery.Output {
@Schema(
title = "The output files' URI in Kestra internal storage."
title = "The output files' URI in Kestra's internal storage."
)
@PluginProperty(additionalProperties = URI.class)
private final Map<String, URI> outputFiles;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class Query extends AbstractJdbcQuery implements RunnableTask<AbstractJdb

@Schema(
title = "Add input file to be loaded with `LOAD DATA LOCAL`.",
description = "The file must be from Kestra internal storage"
description = "The file must be from Kestra's internal storage"
)
@PluginProperty(dynamic = true)
protected String inputFile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
@Getter
@NoArgsConstructor
@Schema(
title = "Copy tabular data from a Postgres table to a file."
title = "Copy tabular data from a PostgreSQL table to a file."
)
@Plugin(
examples = {
@Example(
title = "Export a Postgres table or query to a CSV or TSV file.",
title = "Export a PostgreSQL table or query to a CSV or TSV file.",
code = {
"url: jdbc:postgresql://127.0.0.1:56982/",
"username: pg_user",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public Download.Output run(RunContext runContext) throws Exception {
@Getter
public static class Output implements io.kestra.core.models.tasks.Output {
@Schema(
title = "The URI of the file on Kestra internal storage."
title = "The URI of the file on Kestra's internal storage."
)
private final URI uri;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@
@Getter
@NoArgsConstructor
@Schema(
title = "Execute a batch query to a Microsoft SQL Server"
title = "Execute a batch query on a Microsoft SQL Server."
)
@Plugin(
examples = {
@Example(
title = "Fetch rows from a table and bulk insert to another one",
title = "Fetch rows from a table and bulk insert to another one.",
full = true,
code = {
"tasks:",
" - id: query",
" type: io.kestra.plugin.jdbc.sqlserver.Query",
" url: jdbc:sqlserver://dev:41433;trustServerCertificate=true",
" username: sa",
" password: Sqls3rv3r_Pa55word!",
" username: sql_server_user",
" password: sql_server_passwd",
" sql: |",
" SELECT *",
" FROM xref",
Expand All @@ -45,8 +45,8 @@
" type: io.kestra.plugin.jdbc.sqlserver.Batch",
" from: \"{{ outputs.query.uri }}\"",
" url: jdbc:sqlserver://prod:41433;trustServerCertificate=true",
" username: sa",
" password: Sqls3rv3r_Pa55word!",
" username: sql_server_user",
" password: sql_server_passwd",
" sql: |",
" insert into xref values( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )",
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,27 @@
@Getter
@NoArgsConstructor
@Schema(
title = "Query a Microsoft SQL Server"
title = "Query a Microsoft SQL Server."
)
@Plugin(
examples = {
@Example(
full = true,
title = "Execute a query and fetch results on another task to update another table",
title = "Execute a query and fetch results in a task, and update another table with fetched results in a different task.",
code = {
"tasks:",
"- id: select",
" type: io.kestra.plugin.jdbc.sqlserver.Query",
" url: jdbc:sqlserver://localhost:41433;trustServerCertificate=true",
" username: sa",
" password: Sqls3rv3r_Pa55word!",
" username: sql_server_user",
" password: sql_server_passwd",
" sql: select * from source",
" fetch: true",
"- id: generate-update",
" type: io.kestra.plugin.jdbc.sqlserver.Query",
" url: jdbc:sqlserver://localhost:41433;trustServerCertificate=true",
" username: sa",
" password: Sqls3rv3r_Pa55word!",
" username: sql_server_user",
" password: sql_server_passwd",
" sql: \"{% for row in outputs.update.rows %} INSERT INTO destination (year_month, store_code, update_date) values ({{row.year_month}}, {{row.store_code}}, '{{row.date}}'); {% endfor %}\""}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
@Getter
@NoArgsConstructor
@Schema(
title = "Wait for query on a SQLServer database."
title = "Wait for query on a Microsoft SQL Server 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 then iterate through rows.",
full = true,
code = {
"id: jdbc-trigger",
Expand All @@ -38,13 +38,16 @@
" tasks:",
" - id: return",
" type: io.kestra.core.tasks.debugs.Return",
" format: \"{{json(taskrun.value)}}\"",
" format: \"{{ json(taskrun.value) }}\"",
" value: \"{{ trigger.rows }}\"",
"",
"triggers:",
" - id: watch",
" type: io.kestra.plugin.jdbc.sqlserver.Trigger",
" interval: \"PT5M\"",
" url: jdbc:sqlserver://localhost:41433;trustServerCertificate=true",
" username: sql_server_user",
" password: sql_server_passwd",
" sql: \"SELECT * FROM my_table\""
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,18 @@
"- id: analyzeOrders",
" type: io.kestra.plugin.jdbc.trino.Query",
" url: jdbc:trino://localhost:8080/tpch",
" username: trino",
" username: trino_user",
" password: trino_passwd",
" sql: |",
" select orderpriority as priority, sum(totalprice) as total",
" from tpch.tiny.orders",
" group by orderpriority",
" order by orderpriority",
" fetch: true",
" store: true",
"- id: csvReport",
" type: io.kestra.plugin.serdes.csv.CsvWriter",
" from: \"{{outputs.analyzeOrders.uri}}\""}
" from: \"{{ outputs.analyzeOrders.uri }}\""}
)
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
@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 then iterate through rows.",
full = true,
code = {
"id: jdbc-trigger",
Expand All @@ -38,7 +38,7 @@
" tasks:",
" - id: return",
" type: io.kestra.core.tasks.debugs.Return",
" format: \"{{json(taskrun.value)}}\"",
" format: \"{{ json(taskrun.value) }}\"",
" value: \"{{ trigger.rows }}\"",
"",
"triggers:",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
@Getter
@NoArgsConstructor
@Schema(
title = "Execute a batch query to a Vertica server"
title = "Execute a batch query on a Vectorwise server."
)
@Plugin(
examples = {
@Example(
title = "Fetch rows from a table and bulk insert to another one",
title = "Fetch rows from a table and bulk insert to another one.",
full = true,
code = {
"tasks:",
Expand All @@ -47,8 +47,7 @@
" url: jdbc:vectorwise://prod:port/base",
" username: admin",
" password: admin_passwd",
" sql: |",
" insert into xref values( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )",
" sql: insert into xref values( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )",
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@Plugin(
examples = {
@Example(
title = "Send a sql query to a vectorwise database and fetch a row as outputs",
title = "Send a SQL query to a Vectorwise database and fetch a row as output.",
code = {
"url: jdbc:vectorwise://url:port/base",
"username: admin",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
@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 then iterate through rows.",
full = true,
code = {
"id: jdbc-trigger",
Expand All @@ -38,13 +38,16 @@
" tasks:",
" - id: return",
" type: io.kestra.core.tasks.debugs.Return",
" format: \"{{json(taskrun.value)}}\"",
" format: \"{{ json(taskrun.value) }}\"",
" value: \"{{ trigger.rows }}\"",
"",
"triggers:",
" - id: watch",
" type: io.kestra.plugin.jdbc.vectorwise.Trigger",
" interval: \"PT5M\"",
" url: jdbc:vectorwise://url:port/base",
" username: admin",
" password: admin_passwd",
" sql: \"SELECT * FROM my_table\""
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,33 @@
@Getter
@NoArgsConstructor
@Schema(
title = "Execute a batch query to a Vertica server"
title = "Execute a batch query on a Vertica server."
)
@Plugin(
examples = {
@Example(
title = "Fetch rows from a table and bulk insert to another one",
title = "Fetch rows from a table and bulk insert to another one.",
full = true,
code = {
"tasks:",
" - id: query",
" type: io.kestra.plugin.jdbc.vertica.Query",
" url: jdbc:vertica://dev:56982/db",
" username: dbadmin",
" username: vertica_user",
" password: vertica_passwd",
" sql: |",
" SELECT *",
" FROM xref",
" LIMIT 1500;",
" fetch: true",
" store: true",
" - id: update",
" type: io.kestra.plugin.jdbc.vertica.Batch",
" from: \"{{ outputs.query.uri }}\"",
" url: jdbc:vertica://prod:56982/db",
" username: dbadmin",
" username: vertica_user",
" password: vertica_passwd",
" sql: |",
" insert into xref values( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )",
" sql: insert into xref values( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )",
}
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
@Getter
@NoArgsConstructor
@Schema(
title = "Query a Vertica server"
title = "Query a Vertica server."
)
@Plugin(
examples = {
@Example(
title = "Request a Vertica database and fetch a row as outputs",
title = "Send a SQL query to a Vertica database, and fetch a row as output.",
code = {
"url: jdbc:vertica://127.0.0.1:56982/db",
"username: dbadmin",
"username: vertica_user",
"password: vertica_passwd",
"sql: select * from customer",
"fetchOne: true",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
@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 then iterate through rows.",
full = true,
code = {
"id: jdbc-trigger",
Expand All @@ -38,13 +38,16 @@
" tasks:",
" - id: return",
" type: io.kestra.core.tasks.debugs.Return",
" format: \"{{json(taskrun.value)}}\"",
" format: \"{{ json(taskrun.value) }}\"",
" value: \"{{ trigger.rows }}\"",
"",
"triggers:",
" - id: watch",
" type: io.kestra.plugin.jdbc.vertica",
" interval: \"PT5M\"",
" url: jdbc:vertica://127.0.0.1:56982/db",
" username: vertica_user",
" password: vertica_passwd",
" sql: \"SELECT * FROM my_table\""
}
)
Expand Down

0 comments on commit 8e136ff

Please sign in to comment.