diff --git a/client-v2/src/main/java/com/clickhouse/client/api/Client.java b/client-v2/src/main/java/com/clickhouse/client/api/Client.java index da6ab010b..621f88efb 100644 --- a/client-v2/src/main/java/com/clickhouse/client/api/Client.java +++ b/client-v2/src/main/java/com/clickhouse/client/api/Client.java @@ -2290,6 +2290,9 @@ record = allocator == null ? clazz.getDeclaredConstructor().newInstance() : allo /** *
Fetches schema of a table and returns complete information about each column. * Information includes column name, type, default value, etc.
+ *Important: table name should be properly escaped + * (see @link com.clickhouse.client.api.sql.SQLUtils#enquoteIdentifier(java.lang.String, boolean)). + * This method uses table name as is because method is not aware if database name also present and cannot properly escape it.
* *See {@link #register(Class, TableSchema)}
* @@ -2304,6 +2307,9 @@ public TableSchema getTableSchema(String table) { *Fetches schema of a table and returns complete information about each column. * Information includes column name, type, default value, etc.
*See {@link #register(Class, TableSchema)}
+ *Important: table name should be properly escaped + * (see @link com.clickhouse.client.api.sql.SQLUtils#enquoteIdentifier(java.lang.String, boolean)) + * and should not contain database name
* * @param table - table name * @param database - database name @@ -2316,6 +2322,9 @@ public TableSchema getTableSchema(String table, String database) { /** *Creates table schema from a query.
+ *Important: table name should be properly escaped + * (see @link com.clickhouse.client.api.sql.SQLUtils#enquoteIdentifier(java.lang.String, boolean)). + * This method doesn't validate or parse the SQL query
* @param sql - SQL query which schema to return * @return table schema for the query */ @@ -2323,6 +2332,15 @@ public TableSchema getTableSchemaFromQuery(String sql) { return getTableSchemaFromQuery(sql, null); } + /** + *Creates table schema from a query.
+ *Important: table name should be properly escaped + * (see @link com.clickhouse.client.api.sql.SQLUtils#enquoteIdentifier(java.lang.String, boolean)). + * This method doesn't validate or parse the SQL query
+ * @param sql - SQL query which schema to return + * @param params - server bound parameters + * @return table schema for the query + */ public TableSchema getTableSchemaFromQuery(String sql, Map