diff --git a/plugin-jdbc-arrow-flight/src/main/java/io/kestra/plugin/jdbc/arrowflight/Query.java b/plugin-jdbc-arrow-flight/src/main/java/io/kestra/plugin/jdbc/arrowflight/Query.java index a313f2b9..aae79bab 100644 --- a/plugin-jdbc-arrow-flight/src/main/java/io/kestra/plugin/jdbc/arrowflight/Query.java +++ b/plugin-jdbc-arrow-flight/src/main/java/io/kestra/plugin/jdbc/arrowflight/Query.java @@ -29,21 +29,21 @@ @Plugin( examples = { @Example( - title = "Send a SQL query to a database and fetch a row as outputs using Apache Arrow Flight SQL driver", + title = "Send a SQL query to a database and fetch row(s) using Apache Arrow Flight SQL driver", code = { "url: jdbc:arrow-flight-sql://localhost:31010/?useEncryption=false", - "username: dremio", - "password: dremio123", + "username: db_user", + "password: db_password", "sql: select * FROM departments", "fetch: true", } ), @Example( - title = "Send a sql query to a Dremio coordinator and fetch a row as outputs using Apache Arrow Flight SQL driver", + title = "Send a sql query to a Dremio coordinator and fetch rows as outputs using Apache Arrow Flight SQL driver", code = { "url: jdbc:arrow-flight-sql://dremio-coordinator:32010/?schema=postgres.public", - "username: $token", - "password: samplePersonalAccessToken", + "username: dremio_user", + "password: dremio_password", "sql: select * FROM departments", "fetch: true", } diff --git a/plugin-jdbc-arrow-flight/src/main/java/io/kestra/plugin/jdbc/arrowflight/Trigger.java b/plugin-jdbc-arrow-flight/src/main/java/io/kestra/plugin/jdbc/arrowflight/Trigger.java index fe54c148..70bfa530 100644 --- a/plugin-jdbc-arrow-flight/src/main/java/io/kestra/plugin/jdbc/arrowflight/Trigger.java +++ b/plugin-jdbc-arrow-flight/src/main/java/io/kestra/plugin/jdbc/arrowflight/Trigger.java @@ -22,7 +22,7 @@ @Getter @NoArgsConstructor @Schema( - title = "Wait for query on a Arrow Flight database." + title = "Wait for query to a database through Arrow Flight SQL driver." ) @Plugin( examples = { @@ -45,9 +45,12 @@ "triggers:", " - id: watch", " type: io.kestra.plugin.jdbc.arrowflight.Trigger", + " username: dremio_user", + " password: dremio_password", " url: jdbc:arrow-flight-sql://dremio-coordinator:32010/?schema=postgres.public", " interval: \"PT5M\"", - " sql: \"SELECT * FROM my_table\"" + " sql: \"SELECT * FROM my_table\"", + " fetch: true" } ) } diff --git a/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/AbstractJdbcBatch.java b/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/AbstractJdbcBatch.java index b46f29e4..38d79be1 100644 --- a/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/AbstractJdbcBatch.java +++ b/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/AbstractJdbcBatch.java @@ -48,17 +48,17 @@ public abstract class AbstractJdbcBatch extends Task implements JdbcStatementInt @NotNull @io.swagger.v3.oas.annotations.media.Schema( - title = "Insert query to be executed", - description = "The query must have as much question mark as column in the files." + - "\nExample: 'insert into database values( ? , ? , ? )' for 3 columns" + - "\nIn case you do not want all columns, you need to precise it in the query and in the columns property" + - "\nExample: 'insert into(id,name) database values( ? , ? )' to select 2 columns" + title = "Insert query to be executed.", + description = "The query must have as many question marks as the number of columns in the table." + + "\nExample: 'insert into values( ? , ? , ? )' for 3 columns." + + "\nIn case you do not want all columns, you need to specify it in the query in the columns property" + + "\nExample: 'insert into (id, name) values( ? , ? )' for inserting data into 2 columns: 'id' and 'name'." ) @PluginProperty(dynamic = true) private String sql; @Schema( - title = "The size of chunk for every bulk request" + title = "The size of chunk for every bulk request." ) @PluginProperty(dynamic = true) @Builder.Default @@ -66,8 +66,8 @@ public abstract class AbstractJdbcBatch extends Task implements JdbcStatementInt private Integer chunk = 1000; @Schema( - title = "The columns to be insert", - description = "If not provided, `?` count need to match the `from` number of cols" + title = "The columns to be inserted.", + description = "If not provided, `?` count need to match the `from` number of columns." ) @PluginProperty(dynamic = true) private List columns; @@ -120,7 +120,7 @@ public Output run(RunContext runContext) throws Exception { runContext.metric(Counter.of("records", count.get())); runContext.metric(Counter.of("updated", updated == null ? 0 : updated)); - logger.info("Successfully bulk {} queries with {} updated rows", count.get(), updated); + logger.info("Successfully executed {} bulk queries and updated {} rows", count.get(), updated); return Output .builder() @@ -163,10 +163,10 @@ private PreparedStatement addRows( @Builder @Getter public static class Output implements io.kestra.core.models.tasks.Output { - @Schema(title = "The rows count") + @Schema(title = "The rows count.") private final Long rowCount; - @Schema(title = "The updated rows count") + @Schema(title = "The updated rows count.") private final Integer updatedCount; } diff --git a/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/AbstractJdbcQuery.java b/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/AbstractJdbcQuery.java index 4bd7bc50..96a34ff4 100644 --- a/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/AbstractJdbcQuery.java +++ b/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/AbstractJdbcQuery.java @@ -193,26 +193,26 @@ private Object convertCell(int columnIndex, ResultSet rs, AbstractCellConverter @Getter public static class Output implements io.kestra.core.models.tasks.Output { @Schema( - title = "Map containing the first row of fetched data", + title = "Map containing the first row of fetched data.", description = "Only populated if 'fetchOne' parameter is set to true." ) @JsonInclude private final Map row; @Schema( - title = "Lit of map containing rows of fetched data", + title = "List of map containing rows of fetched data.", description = "Only populated if 'fetch' parameter is set to true." ) private final List> rows; @Schema( - title = "The url of the result file on kestra storage (.ion file / Amazon Ion text format)", + title = "The URI of the result file on Kestra's internal storage (.ion file / Amazon Ion formatted text file).", description = "Only populated if 'store' is set to true." ) private final URI uri; @Schema( - title = "The size of the fetched rows", + title = "The size of the fetched rows.", description = "Only populated if 'store' or 'fetch' parameter is set to true." ) private final Long size; diff --git a/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/AutoCommitInterface.java b/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/AutoCommitInterface.java index d3e8a7ad..fed16f2f 100644 --- a/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/AutoCommitInterface.java +++ b/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/AutoCommitInterface.java @@ -5,12 +5,12 @@ public interface AutoCommitInterface { @Schema( - title = "If autocommit is enabled", + title = "Whether autocommit is enabled.", description = "Sets this connection's auto-commit mode to the given state. If a connection is in auto-commit " + "mode, then all its SQL statements will be executed and committed as individual transactions. Otherwise, " + - "its SQL statements are grouped into transactions that are terminated by a call to either the method commit" + - "or the method rollback. By default, new connections are in auto-commit mode except if you are using a " + - "`store` properties that will disabled autocommit whenever this properties values." + "its SQL statements are grouped into transactions that are terminated by a call to either the method commit " + + "or the method rollback. By default, new connections are in auto-commit mode except when you are using " + + "`store` property in which case the auto-commit will be disabled." ) @PluginProperty(dynamic = false) Boolean getAutoCommit(); diff --git a/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/JdbcConnectionInterface.java b/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/JdbcConnectionInterface.java index 78a7ac1a..d44c6b4e 100644 --- a/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/JdbcConnectionInterface.java +++ b/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/JdbcConnectionInterface.java @@ -13,20 +13,20 @@ 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 String getUrl(); @Schema( - title = "The database user" + title = "The database user." ) @PluginProperty(dynamic = true) String getUsername(); @Schema( - title = "The database user's password" + title = "The database user's password." ) @PluginProperty(dynamic = true) String getPassword(); diff --git a/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/JdbcQueryInterface.java b/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/JdbcQueryInterface.java index 6b631881..2bf3d22e 100644 --- a/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/JdbcQueryInterface.java +++ b/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/JdbcQueryInterface.java @@ -6,20 +6,20 @@ public interface JdbcQueryInterface extends JdbcStatementInterface { @Schema( - title = "The sql query to run" + title = "The sql query to run." ) @PluginProperty(dynamic = true) String getSql(); @Schema( - title = "Whether to fetch the data from the query result to the task output" + + title = "Whether to fetch the data from the query result to the task output." + " This parameter is evaluated after 'fetchOne' and 'store'." ) @PluginProperty(dynamic = false) boolean isFetch(); @Schema( - title = "Whether to fetch data row from the query result to a file in internal storage." + + title = "Whether to fetch data row(s) from the query result to a file in internal storage." + " File will be saved as Amazon Ion (text format)." + " \n" + " See Amazon Ion documentation" + @@ -36,7 +36,7 @@ public interface JdbcQueryInterface extends JdbcStatementInterface { boolean isFetchOne(); @Schema( - title = "Number of rows that should be fetched", + title = "Number of rows that should be fetched.", description = "Gives the JDBC driver a hint as to the number of rows that should be fetched from the database " + "when more rows are needed for this ResultSet object. If the fetch size specified is zero, the JDBC driver " + "ignores the value and is free to make its own best guess as to what the fetch size should be. Ignored if " + diff --git a/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/JdbcStatementInterface.java b/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/JdbcStatementInterface.java index 48cf7b48..b9d74814 100644 --- a/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/JdbcStatementInterface.java +++ b/plugin-jdbc/src/main/java/io/kestra/plugin/jdbc/JdbcStatementInterface.java @@ -8,7 +8,7 @@ public interface JdbcStatementInterface extends JdbcConnectionInterface { @Schema( - title = "The time zone id to use for date/time manipulation. Default value is the worker default zone id." + title = "The time zone id to use for date/time manipulation. Default value is the worker's default time zone id." ) @PluginProperty(dynamic = false) String getTimeZoneId();