Class BigQueryClient

java.lang.Object
io.trino.plugin.bigquery.BigQueryClient

public class BigQueryClient extends Object
  • Constructor Details

  • 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

      public Optional<BigQueryClient.RemoteDatabaseObject> toRemoteTable(String projectId, String remoteDatasetName, String tableName, Iterable<com.google.cloud.bigquery.Table> tables)
    • 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

      public com.google.cloud.bigquery.TableInfo getCachedTable(io.airlift.units.Duration viewExpiration, com.google.cloud.bigquery.TableInfo remoteTableId, List<String> requiredColumns)
    • getParentProjectId

      public String 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

      public String getProjectId()
      The Google Cloud Project ID where the data resides.
    • listDatasets

      public Iterable<com.google.cloud.bigquery.Dataset> listDatasets(String projectId)
    • 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

      public com.google.cloud.bigquery.TableResult executeQuery(ConnectorSession session, String sql)
    • getSchema

      public com.google.cloud.bigquery.Schema getSchema(String sql)
    • selectSql

      public static String selectSql(com.google.cloud.bigquery.TableId table, List<String> requiredColumns, Optional<String> filter)
    • selectSql

      public String selectSql(com.google.cloud.bigquery.TableId table, String formattedColumns)
    • insert

      public void insert(com.google.cloud.bigquery.InsertAllRequest insertAllRequest)
    • getColumns

      public List<BigQueryColumnHandle> getColumns(BigQueryTableHandle tableHandle)
    • buildColumnHandles

      public static List<BigQueryColumnHandle> buildColumnHandles(com.google.cloud.bigquery.TableInfo tableInfo)