Google BigQuery 公开数据集网站:

  • https://cloud.google.com/bigquery/public-data/

java 客户端下载

https://cloud.google.com/bigquery/docs/quickstarts/quickstart-client-libraries

  • 开启 bigquery API,默认是开启的

  • IAM 中创建角色,添加权限,直接搜 BigQuery 管理员,把所有能加的权限都加进来

https://console.cloud.google.com/iam-admin/iam

  • 创建身份验证json

https://cloud.google.com/docs/authentication/getting-started

https://console.cloud.google.com/apis/credentials/serviceaccountkey?_ga=2.123224587.-124782506.1551416872&project=download-dataset&folder&organizationId

在服务账号中填一个拥有 bigquery 权限的服务账号,下载json,就是“credentialFileName.json”

  • 添加依赖
 <dependency><groupId>com.google.cloud</groupId><artifactId>google-cloud-bigquery</artifactId><version>1.38.0</version></dependency>
  • 查询表数据
package mypackage;import com.google.auth.oauth2.GoogleCredentials;
import com.google.cloud.bigquery.BigQuery;
import com.google.cloud.bigquery.BigQueryOptions;
import com.google.cloud.bigquery.FieldValueList;
import com.google.cloud.bigquery.Job;
import com.google.cloud.bigquery.JobId;
import com.google.cloud.bigquery.JobInfo;
import com.google.cloud.bigquery.QueryJobConfiguration;
import com.google.cloud.bigquery.QueryResponse;
import com.google.cloud.bigquery.TableResult;import java.io.FileInputStream;
import java.util.UUID;public class App {public static void main(String... args) throws Exception {String jsonPath = "/credentialFileName.json";GoogleCredentials credentials = GoogleCredentials.fromStream(new FileInputStream(jsonPath));BigQuery bigquery = BigQueryOptions.newBuilder().setCredentials(credentials).build().getService();QueryJobConfiguration queryConfig =QueryJobConfiguration.newBuilder("SELECT * FROM `bigquery-public-data.noaa_gsod.gsod2019` limit 1000")// Use standard SQL syntax for queries.// See: https://cloud.google.com/bigquery/sql-reference/.setUseLegacySql(false).build();// Create a job ID so that we can safely retry.JobId jobId = JobId.of(UUID.randomUUID().toString());Job queryJob = bigquery.create(JobInfo.newBuilder(queryConfig).setJobId(jobId).build());// Wait for the query to complete.queryJob = queryJob.waitFor();// Check for errorsif (queryJob == null) {throw new RuntimeException("Job no longer exists");} else if (queryJob.getStatus().getError() != null) {// You can also look at queryJob.getStatus().getExecutionErrors() for all// errors, not just the latest one.throw new RuntimeException(queryJob.getStatus().getError().toString());}// Get the results.QueryResponse response = bigquery.getQueryResults(jobId);TableResult result = queryJob.getQueryResults();// Print all pages of the results.for (FieldValueList row : result.iterateAll()) {System.out.println(row.toString());
//            String url = row.get("url").getStringValue();
//            long viewCount = row.get("view_count").getLongValue();
//            System.out.printf("url: %s views: %d%n", url, viewCount);}}
}

网页版下载

  • 描述

    A public dataset collected by National Climatic Data Center, which contains the daily climatic data collected at their climatic stations around the globe since 1929. We define the schema of the raw table as {metric, station-name, time, value}. The data we use has 350 million rows in total, with three metrics: temperature, wind speed, and dew point.

  • 网页界面

  • Try the new UI

  • 浏览公共数据集

可能需要先创建一个项目

  • 天气与气候 -> GHCN Daily

  • ghcn_d.ghcnd_1763
  • 查询表,生成示例查询语句

  • 运行,保存查询结果

FTP 下载

  • https://cloud.google.com/bigquery/public-data/noaa-gsod

  • 描述

    The NOAA dataset (∼800GB) contains global sur- face weather data from the USAF Climatology Center col- lected daily from over 9000 stations between 1929 and 2016.

可以直接从 FTP 下载:ftp://ftp.ncdc.noaa.gov/pub/data/gsod/

每一年里的 gz 文件是一个一个观测站的,最后的tar是每一年的合集,只下载 tar 就可以。

#! /bin/bash
for i in $(seq 1929 2016)
dowget --execute robots=off ?accept=tar -r -np -nH --cut-dirs=4 -R index.html* ftp://ftp.ncdc.noaa.gov/pub/data/gsod/$i/gsod_$i.tar
done

Google BigQuery 数据集下载示例相关推荐

  1. bigquery使用教程_如何使用Python和Google BigQuery构建机器人以自动执行您的笨拙任务...

    bigquery使用教程 Do you have repetitive tasks? Something that you do regularly, every week or even every ...

  2. bigquery_到Google bigquery的sql查询模板,它将您的报告提升到另一个层次

    bigquery In this post, we're sharing report templates that you can build with SQL queries to Google ...

  3. 国内外深度学习开放数据集下载集合(值得收藏,不断更新)

    国内外深度学习开放数据集下载集合(值得收藏,不断更新) 一.Image processing data set 1.MNIST ,是最流行的深度学习数据集之一.这是一个手写数字数据集,包含一个有着 6 ...

  4. Google推出数据集搜索!百度,你怎么看?

    作者 | 非主流 出品 | AI科技大本营(公众号ID:rgznai100) 继 Google Scholar(Google 学术搜索)之后,Google 又为科研工作者推出了一款重磅产品-- Goo ...

  5. Google 推出数据集搜索!百度怎么看?

    作者 | 非主流 出品 | AI科技大本营(公众号ID:rgznai100) 继 Google Scholar(Google 学术搜索)之后,Google 又为科研工作者推出了一款重磅产品-- Goo ...

  6. 视线估计14个常见数据集下载

    数据集1:Columbia Gaze 在网页填写一下自己的邮箱就可以获得下载地址(2.2G) wget 下载地址 unzip columbia_gaze_data_set.zip 数据集2:UTMul ...

  7. 常见目标跟踪数据集下载链接整理(更新中)

    搜罗一下,感觉没人把常见的目标跟踪数据集下载链接汇总整理的,这里就整理一下,因为有些网址很难打开,这里也是想方便之后大家获取,来看看吧!我就从大佬图中来找几个吧!因为不是全接触过,有些链接不是很好,有 ...

  8. 行人检测-Caltech Pedestrian Dataset 数据集下载及格式转换

    Caltech Pedestrian Dataset 数据集 加理工(caltech)提供的数据集, 该数据集主要包括 训练集+测试集:seq格式的数据: 行人标签数据:vbb(video bound ...

  9. 各领域公开数据集下载 | 资源

    金融 交通 商业 推荐系统 医疗健康 图像数据 视频数据 音频数据 自然语言处理 社会数据 处理后的科研和竞赛数据 1 金融 **美国劳工部统计局官方发布数据:**http://dataju.cn/D ...

最新文章

  1. AI:2020年6月24日北京智源大会演讲分享之机器学习前沿青年科学家专题论坛——10:40-11:10金驰《Near-Optimal Reinforcement Learning with Sel》
  2. 微信接口请求次数_接口签名验证常用方案
  3. Whitted光线追踪实现
  4. linux操作系统巡检报告,linux服务器巡检报告
  5. 3.mysql的主从原理是什么_mysql 的主从实现原理
  6. 数据结构C++ 复旦大学
  7. java电影购票系统_java swing实现电影购票系统
  8. SU插件情报局 | SUBD(细分曲面)详细中文介绍
  9. JAVA之MySQL数据库增删改查【Java入门练手】
  10. 推荐几本励志及修心方面的书籍
  11. mysql.sock 是什么_mysql.sock到底存了什么信息?
  12. 数独解法/n皇后的回溯算法
  13. QT在状态栏添加label
  14. 计算机无法安装操作系统的原因,关于电脑无法安装IE浏览器的原因有哪些
  15. Mediapipe+OpenCV与Unity引擎实现动作捕捉
  16. Linux串口通信之termios结构体
  17. 面部微雕做了以后有危害吗,自体脂肪填充苹果肌硬块多久消,姐姐聚会那些事
  18. JTAG的TAP状态机介绍
  19. 灰色马尔科夫链matlab,基于灰色-马尔科夫模型的电力功率预测
  20. java开源验证框架OVAL帮助文档

热门文章

  1. 可变参数传递与不可变参数传递
  2. SpringBoot 创建使用阿里云代理地址
  3. 汽车专场 | 新能源汽车动力电池PACK CAE分析实例解读
  4. Linux GCC 常用命令
  5. android arcgis定位,arcgis android之定位功能的示例代码
  6. 探究音节bo、po、 mo、 fo韵母的实际发音
  7. 沁阳市计算机硬件市场主要分布地,太行山石种分类及太行奇石资源产地分布(图)...
  8. Hamming distance - 汉明距离
  9. ubuntu下putty的安装及使用
  10. 使用Data URL将图片嵌入到网页中