Class BigQuerySqlUtils
- java.lang.Object
-
- com.amazonaws.athena.connectors.google.bigquery.BigQuerySqlUtils
-
public class BigQuerySqlUtils extends Object
Utilities that help with Sql operations using StringTemplate.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringbuildSql(TableName tableName, org.apache.arrow.vector.types.pojo.Schema schema, Constraints constraints, List<com.google.cloud.bigquery.QueryParameterValue> parameterValues)Builds an SQL statement from the schema, table name, split and constraints that can be executable by BigQuery using StringTemplate approach.static StringrenderTemplate(String templateName, Map<String,Object> params)Generic method to render any string template with parameters
-
-
-
Method Detail
-
buildSql
public static String buildSql(TableName tableName, org.apache.arrow.vector.types.pojo.Schema schema, Constraints constraints, List<com.google.cloud.bigquery.QueryParameterValue> parameterValues)
Builds an SQL statement from the schema, table name, split and constraints that can be executable by BigQuery using StringTemplate approach.- Parameters:
tableName- The table name of the table we are querying.schema- The schema of the table that we are querying.constraints- The constraints that we want to apply to the query.parameterValues- Query parameter values for parameterized query.- Returns:
- SQL Statement that represents the table, columns, split, and constraints.
-
renderTemplate
public static String renderTemplate(String templateName, Map<String,Object> params)
Generic method to render any string template with parameters- Parameters:
templateName- The name of the template to renderparams- Map of parameter key-value pairs- Returns:
- The rendered template string
-
-