【问题标题】:How to get name of tableid of an existing Dataset in Cloud Bigquery如何在 Cloud Bigquery 中获取现有数据集的 tableid 名称
【发布时间】:2014-06-19 04:48:01
【问题描述】:

目前,我正在实施将数据从云存储插入 Bigquery 的项目。关于插入方式。请参考下面的链接是我做的方式 How to load data from Cloud Storage into BigQuery using Java 但是,我想在将数据插入 bigquery 之前检查 Bigquery 数据集中的现有表名称。 如果您能分享您解决此案的想法,我将非常高兴?

谢谢,

【问题讨论】:

    标签: java google-bigquery google-cloud-storage


    【解决方案1】:
    private static void listTables(Bigquery service, String projectNumber, String datasetId) throws IOException {
    
        Bigquery.Tables.List listTablesReply = service.tables().list(projectNumber, datasetId);
        TableList tableList = listTablesReply.execute();
    
        if (tableList.getTables() != null) {
    
          List tables = tableList.getTables();
    
          System.out.println("Tables list:");
    
          for (TableList.Tables table : tables) {
             System.out.format("%s\n", table.getId());
          }
        }
    }    
    

    我认为在这种情况下它会对我们有所帮助:)

    【讨论】:

    猜你喜欢
    • 2019-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-27
    • 2022-11-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多