Package io.trino.plugin.bigquery
Class BigQueryClient
java.lang.Object
io.trino.plugin.bigquery.BigQueryClient
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionBigQueryClient(com.google.cloud.bigquery.BigQuery bigQuery, BigQueryLabelFactory labelFactory, boolean caseInsensitiveNameMatching, ViewMaterializationCache materializationCache, io.airlift.units.Duration metadataCacheTtl, Optional<String> configProjectId) -
Method Summary
Modifier and TypeMethodDescriptionstatic List<BigQueryColumnHandle>buildColumnHandles(com.google.cloud.bigquery.TableInfo tableInfo) voidcreateSchema(com.google.cloud.bigquery.DatasetInfo datasetInfo) voidcreateTable(com.google.cloud.bigquery.TableInfo tableInfo) voiddropSchema(com.google.cloud.bigquery.DatasetId datasetId) voiddropTable(com.google.cloud.bigquery.TableId tableId) com.google.cloud.bigquery.TableResultexecuteQuery(ConnectorSession session, String sql) voidexecuteUpdate(ConnectorSession session, com.google.cloud.bigquery.QueryJobConfiguration job) com.google.cloud.bigquery.TableInfogetCachedTable(io.airlift.units.Duration viewExpiration, com.google.cloud.bigquery.TableInfo remoteTableId, List<String> requiredColumns) getColumns(BigQueryTableHandle tableHandle) com.google.cloud.bigquery.DatasetInfogetDataset(com.google.cloud.bigquery.DatasetId datasetId) The Google Cloud Project ID that will be used to create the underlying BigQuery read session.The Google Cloud Project ID where the data resides.com.google.cloud.bigquery.SchemaOptional<com.google.cloud.bigquery.TableInfo>getTable(com.google.cloud.bigquery.TableId remoteTableId) voidinsert(com.google.cloud.bigquery.InsertAllRequest insertAllRequest) Iterable<com.google.cloud.bigquery.Dataset>listDatasets(String projectId) Iterable<com.google.cloud.bigquery.Table>listTables(com.google.cloud.bigquery.DatasetId remoteDatasetId) static StringselectSql(com.google.cloud.bigquery.TableId table, List<String> requiredColumns, Optional<String> filter) toRemoteDataset(String projectId, String datasetName) toRemoteTable(String projectId, String remoteDatasetName, String tableName) toRemoteTable(String projectId, String remoteDatasetName, String tableName, Iterable<com.google.cloud.bigquery.Table> tables)
-
Constructor Details
-
BigQueryClient
public BigQueryClient(com.google.cloud.bigquery.BigQuery bigQuery, BigQueryLabelFactory labelFactory, boolean caseInsensitiveNameMatching, ViewMaterializationCache materializationCache, io.airlift.units.Duration metadataCacheTtl, Optional<String> configProjectId)
-
-
Method Details
-
toRemoteDataset
public Optional<BigQueryClient.RemoteDatabaseObject> toRemoteDataset(String projectId, String datasetName) -
toRemoteTable
public Optional<BigQueryClient.RemoteDatabaseObject> toRemoteTable(String projectId, String remoteDatasetName, String tableName) -
toRemoteTable
-
getDataset
public com.google.cloud.bigquery.DatasetInfo getDataset(com.google.cloud.bigquery.DatasetId datasetId) -
getTable
public Optional<com.google.cloud.bigquery.TableInfo> getTable(com.google.cloud.bigquery.TableId remoteTableId) -
getCachedTable
-
getParentProjectId
The Google Cloud Project ID that will be used to create the underlying BigQuery read session. Effectively, this is the project that will be used for billing attribution. -
getProjectId
The Google Cloud Project ID where the data resides. -
listDatasets
-
listTables
public Iterable<com.google.cloud.bigquery.Table> listTables(com.google.cloud.bigquery.DatasetId remoteDatasetId) -
createSchema
public void createSchema(com.google.cloud.bigquery.DatasetInfo datasetInfo) -
dropSchema
public void dropSchema(com.google.cloud.bigquery.DatasetId datasetId) -
createTable
public void createTable(com.google.cloud.bigquery.TableInfo tableInfo) -
dropTable
public void dropTable(com.google.cloud.bigquery.TableId tableId) -
executeUpdate
public void executeUpdate(ConnectorSession session, com.google.cloud.bigquery.QueryJobConfiguration job) -
executeQuery
-
getSchema
-
selectSql
-
selectSql
-
insert
public void insert(com.google.cloud.bigquery.InsertAllRequest insertAllRequest) -
getColumns
-
buildColumnHandles
public static List<BigQueryColumnHandle> buildColumnHandles(com.google.cloud.bigquery.TableInfo tableInfo)
-