SlideShare a Scribd company logo
Google BigQuery
- Command line and Tips -
2016/06/08
Mulodo Vietnam Co., Ltd.
What’s BigQuery
Official site : https://cloud.google.com/bigquery/docs/
BigQuery is Google's fully managed, petabyte scale, low
cost analytics data warehouse.
BigQuery is NoOps—there is no infrastructure to manage
and you don't need a database administrator—so you can
focus on analyzing data to find meaningful insights, use
familiar SQL, and take advantage of our pay-as-you-go
model.
→ DWH: SQL like (easy to use), Petabyte scale(for Huge data)
Previous study
“BigQuery - The First Step -“ (2016/05/26)
• Just try to start for Google Big Query
• Using query on the Google Cloud Platform console.
• Create your own Dataset and Table
• Using query for your table GPC console.
http://www.meetup.com/Open-Study-Group-Saigon/events/231233151/
http://www.slideshare.net/nemo-mulodo/big-query-the-first-step-mosg
c.f. “Big Data - Overview - “
http://www.slide http://www.meetup.com/Open-Study-Group-Saigon/events/229243903/
share.net/nemo-mulodo/big-data-overview-mosg
Command line tools and Tips
1. Preparation (install SDK and settings)
2. Try command line tools
create datasets, tables and insert data.
3. Tips for business use.
How to charge?
Tips to reduce cost.
1. Preparation steps
Preparation steps
1. Create “Google Cloud Platform(GCP)” account, and
BigQuery.
See) previous paper.
2. Install GCP SKD to your PC. (Using Ubuntu on Vagrant)
1. Installation
2. Activate your account
3. Set accounts for GCP SDK.
2. Install GCP SKD
1. Installation
Install SKD to your PC. (1)
nemo@ubuntu-14:~$ curl https://sdk.cloud.google.com | bash
:
Installation directory (this will create a google-cloud-sdk subdirectory)
(/home/nemo): <-- Just type Enter (or you want)
:
Do you want to help improve the Google Cloud SDK (Y/n)? y
:
! BigQuery Command Line Tool ! 2.0.24 ! < 1 MiB !
! BigQuery Command Line Tool (Platform Specific)! 2.0.24 ! < 1 MiB !
:
Modify profile to update your $PATH and enable shell command
completion? (Y/n)? y (or you want)
:
For more information on how to get started, please visit:
https://cloud.google.com/sdk/#Getting_Started
nemo@ubuntu-14:~$ . ~/.bashrc <-- reload your bash environment
nemo@ubuntu-14:~$
Install SKD to your PC. (2)
// check the commands
nemo@ubuntu-14:~$ which bq
/home/nemo/google-cloud-sdk/bin/bq
nemo@ubuntu-14:~$ which gcloud
/Users/nemo/google-cloud-sdk/bin/gcloud
2. Install GCP SKD
2. Activate your account
Activate your GPC account (1)
1. Preparation (create account)
2. Go to Google Cloud platform (has no account)
3. “Try IT Free”
https://cloud.google.com
nemo@ubuntu-14:~$ gcloud init
Welcome! This command will take you through the configuration of gcloud.
Your current configuration has been set to: [default]
To continue, you must log in. Would you like to log in (Y/n)?
Go to the following link in your browser:
https://accounts.google.com/o/oauth2/auth?redirect_uri=ur&xxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
access_type=offline
Enter verification code: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
You are now logged in as: [xxxx@example.com]
This account has no projects. Please create one in developers console (https://
console.developers.google.com/project) before running this command.
nemo@ubuntu-14:~$
nemo@ubuntu-14:~$ gcloud init
Welcome! This command will take you through the configuration of gcloud.
Your current configuration has been set to: [default]
To continue, you must log in. Would you like to log in (Y/n)?
Go to the following link in your browser:
https://accounts.google.com/o/oauth2/auth?redirect_uri=ur&xxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
access_type=offline
Enter verification code: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
You are now logged in as: [xxxx@example.com]
This account has no projects. Please create one in developers console (https://
console.developers.google.com/project) before running this command.
nemo@ubuntu-14:~$
Activate your GPC account (2)
https://accounts.google.com/o/oauth2/auth?redirect_uri=ur&xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
access_type=offline
Launch
Browser
Select accounts
(if you already login with
multiple accounts)
Activate your GPC account (3)
https://accounts.google.com/o/oauth2/auth?redirect_uri=ur&xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
access_type=offline
Accept
permission
Activate your GPC account (4)
https://accounts.google.com/o/oauth2/auth?redirect_uri=ur&xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
access_type=offline
get
verification code
Activate your GPC account (5)
https://accounts.google.com/o/oauth2/auth?redirect_uri=ur&xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
access_type=offline
Enter verification code: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
You are now logged in as: [xxxx@example.com]
set the code
Activate your GPC account (6)
https://accounts.google.com/o/oauth2/auth?redirect_uri=ur&xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
access_type=offline
Enter verification code: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
You are now logged in as: [xxxx@example.com]
check the accounts
Activate your GPC account (7)
Activate your GPC account (8)
// set Project ID
nemo@ubuntu-14:~$ gcloud config set project {{PROJECT_ID}}
nemo@ubuntu-14:~$
// check the accounts
nemo@ubuntu-14:~$ gcloud auth list
- xxx@example.com (active)
To set the active account, run:
$ gcloud config set account ``ACCOUNT''
nemo@ubuntu-14:~$
What a pain!
AWS is much easiler...
2. Try command line tools
Try Public data (1)
nemonemo@ubuntu-14:~$ bq show publicdata:samples.shakespeare
Table publicdata:samples.shakespeare
Last modified Schema Total
Rows Total Bytes Expiration
----------------- ------------------------------------
------------ ------------- ------------
26 Aug 21:43:49 |- word: string (required) 164656
6432064
|- word_count: integer (required)
|- corpus: string (required)
|- corpus_date: integer (required)
	publicdata		:		samples		.	shakespeare	
{PROJECT_ID}	:	{DATASET}	.			{TABLE}
Try Public data (2)
nemo@ubuntu-14:~$ bq query "SELECT word, COUNT(word) as count FROM
publicdata:samples.shakespeare WHERE word CONTAINS 'raisin' GROUP BY word"
Waiting on bqjob_r5e78fd2c80d5923c_000001554d1c4acc_1 ... (0s) Current
status: DONE
+---------------+-------+
| word | count |
+---------------+-------+
| raising | 5 |
| dispraising | 2 |
| Praising | 4 |
| praising | 7 |
| dispraisingly | 1 |
| raisins | 1 |
+---------------+-------+
nemo@ubuntu-14:~$
Create Dataset (1)
nemo@ubuntu-14:~$ bq ls
<--- no dataset
nemo@ubuntu-14:~$ bq mk saigon_engineers
Dataset 'open-study-group-saigon:saigon_engineers' successfully created.
nemo@ubuntu-14:~$ bq ls
datasetId
------------------ <-- created!!
saigon_engineers
nemo@ubuntu-14:~$
Create Dataset (2)
nemo@ubuntu-14:~$ bq ls
<--- no dataset
nemo@ubuntu-14:~$ bq mk saigon_engineers
Dataset 'open-study-group-saigon:saigon_engineers' successfully created.
nemo@ubuntu-14:~$ bq ls
datasetId
------------------ <-- created!!
saigon_engineers
nemo@ubuntu-14:~$
Added!! -->
Create table and import data (1)
name type
ID INTEGER
name STRING
engineer_type INTEGER
ID name type
1 nemo 1
2 miki 1
Schema
Data
Create table and import data (2)
Schema (schema.json)
[
{
"name":"id",
"type":"INTEGER"
},
{
"name":"name",
"type":"STRING"
},
{
"name":"engineer_type",
"type":"INTEGER"
}
]
Create table and import data (3)
Data (data.json)
{"id":1,"name":"nemo","engineer_type":1}
{"id":2,"name":"miki","engineer_type":1}
Create table and import data (4)
nemo@ubuntu-14:~$ bq load --source_format=NEWLINE_DELIMITED_JSON
saigon_engineers.engineer_list data.json schema.json
Upload complete.
Waiting on bqjob_r23b898932d75d49a_000001554e5cae2f_1 ... (1s)
Current status: DONE
nemo@ubuntu-14:~$
bk load {PROJECT_ID}:{DATASET}.{TABLE} {data} {schema}
Create table and import data
https://cloud.google.com/bigquery/loading-data
Create table and import data (5)
nemo@ubuntu-14:~$ bq load --source_format=NEWLINE_DELIMITED_JSON
saigon_engineers.engineer_list data.json 
id:integer,
name:string,
engineer_type:integer
Upload complete.
Waiting on bqjob_r33b7802ea96b2c5d_000001554e4d21d5_1 ... (2s)
Current status: DONE
nemo@ubuntu-14:~$
Create table and import data : Another way
Create table and import data (6)
nemo@ubuntu-14:~$ bq mk open-study-group-
saigon:saigon_engineers.engineer_list schema.json
nemo@ubuntu-14:~$
Create table
bk mk {PROJECT_ID}:{DATASET}.{TABLE} {schema}
Create table and import data (7)
nemo@ubuntu-14:~$ bq load --source_format=NEWLINE_DELIMITED_JSON
saigon_engineers.engineer_list data.json
Upload complete.
Waiting on bqjob_r13717485c2c472e3_000001554e5b3ca3_1 ... (2s)
Current status: DONE
nemo@ubuntu-14:~$
Import data to database
bk load {PROJECT_ID}:{DATASET}.{TABLE} {data}
Query (1)
nemo@ubuntu-14:~$ bq show saigon_engineers.engineer_list
Last modified Schema Total Rows
Total Bytes Expiration
----------------- --------------------------- ------------
------------- ------------
14 Jun 10:02:35 |- id: integer 2 44
|- name: string
|- engineer_type: integer
nemo@ubuntu-14:~$
Query (2)
nemo@ubuntu-14:~$ bq query "SELECT name FROM
saigon_engineers.engineer_list"
Waiting on bqjob_r12185d1aa88d92c8_0000015552d709d2_1 ... (0s)
Current status: DONE
+------+
| name |
+------+
| nemo |
| miki |
+------+
nemo@ubuntu-14:~$
Query (3)
nemo@ubuntu-14:~$ bq query --dry_run "SELECT name FROM
saigon_engineers.engineer_list"
Query successfully validated. Assuming the tables are not
modified, running this query will process 12 bytes of data.
nemo@ubuntu-14:~$
bk query --dry_run “QUERY”
- get size of using memory before execution.
Hmm.
(finished??)
A bit more
3. Tips for business use
Pricing
Storage															$0.02	per	GB,	per	month		
Long	Term	Storage					$0.01	per	GB,	per	month	
Streaming	Inserts					$0.01	per	200	MB	
Queries															$5	per	TB	(First	1	TB	per	month	is	free)	
																						subject	to	query	pricing	details.	
Loading	data										Free	
Copying	data										Free	
Exporting	data									Free	
Metadata	operations			Free	
																						List,	get,	patch,	update	and	delete	calls.
It seems very cheap !!?
Pricing
Storage															$0.02	per	GB,	per	month		
Long	Term	Storage					$0.01	per	GB,	per	month	
Streaming	Inserts					$0.01	per	200	MB	
Queries															$5	per	TB	(First	1	TB	per	month	is	free)	
																						subject	to	query	pricing	details.	
Loading	data										Free	
Copying	data										Free	
Exporting	data									Free	
Metadata	operations			Free	
																						List,	get,	patch,	update	and	delete	calls.
BigQuery is for BIG DATA
Column oriented (1)
Sample case : database of Books
ID	
(indexed)
title	
(indexed)
contents
1 The	Cat
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	1.2MB)
2 Cats	are	love
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	1.5MB)
3 Littul	Kittons
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	0.8MB)
select	id,	title	from	books	where	name	=	‘The	Cat’
Column oriented (2)
ID	
(indexed)
title	
(indexed)
contents
1 The	Cat
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	1.2MB)
2 Cats	are	love
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	1.5MB)
3 Littul	Kittons
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	0.8MB)
select	*	from	books	where	title	=	‘The	Cat’	
@RDBMS
index	(name)
hash	data
hash	data
hash	data
data in databaseIndexes
scanned data
Column oriented (3)
ID	
(indexed)
title	
(indexed)
contents
1 The	Cat
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	1.2MB)
2 Cats	are	love
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	1.5MB)
3 Littul	Kittons
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	0.8MB)
select	*	from	books	where	title	=	‘The	Cat’	
@BigQuery
data in database
scanned data
Column oriented (3)
ID	
(indexed)
title	
(indexed)
contents
1 The	Cat
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	1.2MB)
2 Cats	are	love
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	1.5MB)
3 Littul	Kittons
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	0.8MB)
select	*	from	books	where	title	=	‘The	Cat’	
@BigQuery
data in database
scanned data
Full-scan

ANYTIME!!
Column oriented (4)
ID	
(indexed)
title	
(indexed)
contents
1 The	Cat
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	1.2MB)
2 Cats	are	love
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	1.5MB)
3 Littul	Kittons
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	0.8MB)
select	*	from	books	where	title	=	‘The	Cat’	
@BigQuery
data in database
If your database is Tera-byte scale,
$5 per query !!!!
Column oriented (5)
ID	
(indexed)
title	
(indexed)
contents
1 The	Cat
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	1.2MB)
2 Cats	are	love
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	1.5MB)
3 Littul	Kittons
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	0.8MB)
select	id,	title	from	books	where	title	=	‘The	Cat’	
@RDBMS
index	(name)
hash	data
hash	data
hash	data
data in databaseIndexes
scanned data
Column oriented (6)
ID	
(indexed)
title	
(indexed)
contents
1 The	Cat
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	1.2MB)
2 Cats	are	love
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	1.5MB)
3 Littul	Kittons
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	0.8MB)
select	id,	title	from	books	where	title	=	‘The	Cat’	
@BigQuery
data in database
scanned data
Column oriented (6)
ID	
(indexed)
title	
(indexed)
contents
1 The	Cat
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	1.2MB)
2 Cats	are	love
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	1.5MB)
3 Littul	Kittons
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	0.8MB)
select	id,	title	from	books	where	title	=	‘The	Cat’	
@BigQuery
data in database
scanned data
Column
Oriented
It's really
dangerous!
Please,	Please	set	columns	in	queries.
Table division
Sample case : database of Books
select	id,	title	from	books	where	time	in	‘2016/06/17’
: : : :
ID	
(indexed)
title	
(indexed)
contents
time	
(indexed)
1 The	Cat
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	1.2MB)
2016/01/01	
00:00:00
2 Cats	are	love
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	1.5MB)
2016/01/01	
00:01:23
353485397 Littul	Kittons
Lorem	ipsum	dolor	sit	amet,	
consectetur	(...	0.8MB)
2016/06/17	
00:01:46
Table division (1)
index	(time)
hash	data
hash	data
hash	data
data in databaseIndexes
scanned data
: : : :
ID	
(indexed)
title	
(indexed)
contents
time	
(indexed)
1 The	Cat
Lorem	ipsum	dolor	sit	
amet,	consectetur	(...	
2016/01/01	
00:00:00
2
Cats	are	
love
Lorem	ipsum	dolor	sit	
amet,	consectetur	(...	
2016/01/01	
00:01:23
353485397
Littul	
Kittons
Lorem	ipsum	dolor	sit	
amet,	consectetur	(...	
0.8MB)
2016/06/17	
00:01:46
select	id,	title	from	books	where	time	in	‘2016/06/17’	
@RDBMS
Table division (2)
data in database
scanned data
: : : :
ID	
(indexed)
title	
(indexed)
contents
time	
(indexed)
1 The	Cat
Lorem	ipsum	dolor	sit	
amet,	consectetur	(...	
1.2MB)
2016/01/01	
00:00:00
2 Cats	are	love
Lorem	ipsum	dolor	sit	
amet,	consectetur	(...	
1.5MB)
2016/01/01	
00:01:23
353485397
Littul	
Kittons
Lorem	ipsum	dolor	sit	
amet,	consectetur	(...	
0.8MB)
2016/06/17	
00:01:46
select	id,	title	from	books	where	time	in	‘2016/06/17’	
@BigQuery
Huge size
Table division (2)
data in database
scanned data
: : : :
ID	
(indexed)
title	
(indexed)
contents
time	
(indexed)
1 The	Cat
Lorem	ipsum	dolor	sit	
amet,	consectetur	(...	
1.2MB)
2016/01/01	
00:00:00
2 Cats	are	love
Lorem	ipsum	dolor	sit	
amet,	consectetur	(...	
1.5MB)
2016/01/01	
00:01:23
353485397
Littul	
Kittons
Lorem	ipsum	dolor	sit	
amet,	consectetur	(...	
0.8MB)
2016/06/17	
00:01:46
select	id,	title	from	books	where	time	in	‘2016/06/17’	
@BigQuery
Huge size
Table division (3)
ID	
(indexed)
title	
(indexed)
contents
time	
(indexed)
1 The	Cat
Lorem	ipsum	dolor	sit	
amet,	consectetur	(...	
1.2MB)
2016/01/01	
00:00:00
2 Cats	are	love
Lorem	ipsum	dolor	sit	
amet,	consectetur	(...	
1.5MB)
2016/01/01	
00:01:23
ID	
(indexed)
title	
(indexed)
contents
time	
(indexed)
353485397
Littul	
Kittons
Lorem	ipsum	dolor	sit	
amet,	consectetur	(...	
0.8MB)
2016/06/17	
00:01:46
:
Tables
books_20160101
:
books_20160617
Divide	tables	for	each	day.
Table division (4)
ID	
(indexed)
title	
(indexed)
contents
time	
(indexed)
1 The	Cat
Lorem	ipsum	dolor	sit	
amet,	consectetur	(...	
1.2MB)
2016/01/01	
00:00:00
2 Cats	are	love
Lorem	ipsum	dolor	sit	
amet,	consectetur	(...	
1.5MB)
2016/01/01	
00:01:23
ID	
(indexed)
title	
(indexed)
contents
time	
(indexed)
353485397
Littul	
Kittons
Lorem	ipsum	dolor	sit	
amet,	consectetur	(...	
0.8MB)
2016/06/17	
00:01:46
:
books_20160101
:
books_20160617
select	id,	title	from	books	where	time	in	‘2016/06/17’	
@BigQuery
Table division (5)
ID	
(indexed)
title	
(indexed)
contents
time	
(indexed)
1 The	Cat
Lorem	ipsum	dolor	sit	
amet,	consectetur	(...	
1.2MB)
2016/01/01	
00:00:00
books_20160101
::
ID	
(indexed)
title	
(indexed)
contents
time	
(indexed)
353485397
The	Great	
Catsby
Lorem	ipsum	dolor	sit	
amet,	consectetur	(...	
0.8MB)
2016/06/16	
00:01:46
books_20160616
select	id,	title	from	books		
where	time	in	‘2016/06/16	-	2016/06/17’	
@BigQuery
ID	
(indexed)
title	
(indexed)
contents
time	
(indexed)
353485397
Littul	
Kittons
Lorem	ipsum	dolor	sit	
amet,	consectetur	(...	
2016/06/17	
00:01:46
books_20160617
Table division (6)
select	id,	title	from	books		
where	time	in	‘2016/06/16	-	2016/06/17’	
@BigQuery
SELECT	id,	title	FROM		
			(	
									TABLE_DATE_RANGE(books_,		
																										TIMESTAMP(‘2016-06-16'),	
																										TIMESTAMP(‘2016-06-17')	
									)	
				)
Table division (7)
Other	ways	to	divide	tables.
Table	decorator	

		-	https://cloud.google.com/bigquery/table-decorators	
“TABLE_QUERY”	
		-	https://cloud.google.com/bigquery/query-reference
“Import	from	GCS	is	much	faster	than	from	local”	
		1.	put	data	into	GCS	(Google	Clould	Storage	≒	S3	??)	
		2.	import	the	data	from	GCS.
Other	tips.
BigQuery is
Fast
Easy
Cheap
if it is used properly.
BigQuery is
Fast
Easy
Cheap
if it is used properly.
Remember
“--dry_run”
Thank you!

More Related Content

What's hot (20)

PDF
[Pgday.Seoul 2018] 이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
PgDay.Seoul
 
PDF
[데이터야놀자2107] 강남 출근길에 판교/정자역에 내릴 사람 예측하기
choi kyumin
 
PDF
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
PgDay.Seoul
 
PDF
20명 규모의 팀에서 Vault 사용하기
Doyoon Kim
 
PDF
민첩하고 비용효율적인 Data Lake 구축 - 문종민 솔루션즈 아키텍트, AWS
Amazon Web Services Korea
 
PDF
Auto Scaling Groups
Peter Sankauskas
 
PDF
강성훈, 실버바인 대기열 서버 설계 리뷰, NDC2019
devCAT Studio, NEXON
 
PDF
BigQuery for Beginners
Better&Stronger
 
PPTX
Google cloud
Rounak Maheshwari
 
PDF
How to create aws s3 bucket using terraform
Katy Slemon
 
PDF
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
PgDay.Seoul
 
PDF
1.mysql disk io 모니터링 및 분석사례
I Goo Lee
 
PPTX
Mongo db
Akshay Mathur
 
PPT
Amazon quicksight
Sivakumar Ramar
 
PPTX
Secure Coding for NodeJS
Thang Chung
 
PDF
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017
Amazon Web Services Korea
 
PDF
Implementing Authorization
Torin Sandall
 
PDF
AWS Personalize 중심으로 살펴본 추천 시스템 원리와 구축
Sungmin Kim
 
PDF
DynamoDB의 안과밖 - 정민영 (비트패킹 컴퍼니)
AWSKRUG - AWS한국사용자모임
 
PDF
FIWARE Identity Management and Access Control
FIWARE
 
[Pgday.Seoul 2018] 이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
PgDay.Seoul
 
[데이터야놀자2107] 강남 출근길에 판교/정자역에 내릴 사람 예측하기
choi kyumin
 
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
PgDay.Seoul
 
20명 규모의 팀에서 Vault 사용하기
Doyoon Kim
 
민첩하고 비용효율적인 Data Lake 구축 - 문종민 솔루션즈 아키텍트, AWS
Amazon Web Services Korea
 
Auto Scaling Groups
Peter Sankauskas
 
강성훈, 실버바인 대기열 서버 설계 리뷰, NDC2019
devCAT Studio, NEXON
 
BigQuery for Beginners
Better&Stronger
 
Google cloud
Rounak Maheshwari
 
How to create aws s3 bucket using terraform
Katy Slemon
 
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
PgDay.Seoul
 
1.mysql disk io 모니터링 및 분석사례
I Goo Lee
 
Mongo db
Akshay Mathur
 
Amazon quicksight
Sivakumar Ramar
 
Secure Coding for NodeJS
Thang Chung
 
Amazon Aurora 성능 향상 및 마이그레이션 모범 사례 - AWS Summit Seoul 2017
Amazon Web Services Korea
 
Implementing Authorization
Torin Sandall
 
AWS Personalize 중심으로 살펴본 추천 시스템 원리와 구축
Sungmin Kim
 
DynamoDB의 안과밖 - 정민영 (비트패킹 컴퍼니)
AWSKRUG - AWS한국사용자모임
 
FIWARE Identity Management and Access Control
FIWARE
 

Similar to Big query - Command line tools and Tips - (MOSG) (20)

PDF
Acquia BLT for the Win, or How to speed up the project setup, development an...
DrupalCamp Kyiv
 
PDF
GCP - GCE, Cloud SQL, Cloud Storage, BigQuery Basic Training
Simon Su
 
PDF
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
MarcinStachniuk
 
PPTX
Python from zero to hero (Twitter Explorer)
Yuriy Senko
 
PDF
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Weaveworks
 
PDF
Exploring Google APIs with Python
wesley chun
 
PPTX
Serverless Data Architecture at scale on Google Cloud Platform
MeetupDataScienceRoma
 
DOCX
Git as version control for Analytics project
Nag Arvind Gudiseva
 
PDF
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
KAI CHU CHUNG
 
PDF
Continuous delivery w projekcie open source - Marcin Stachniuk
MarcinStachniuk
 
KEY
Release management with NuGet/Chocolatey/JIRA
Yaroslav Serhieiev
 
PDF
오픈 소스 프로그래밍 - NoSQL with Python
Ian Choi
 
PDF
Spark on Dataproc - Israel Spark Meetup at taboola
tsliwowicz
 
PDF
Image archive, analysis & report generation with Google Cloud
wesley chun
 
PDF
Creating Extensible Plugins for WordPress
Hristo Chakarov
 
PDF
Infinum Android Talks #04 - How to publish an Android archive (.aar) to Maven...
Denis_infinum
 
PDF
Infinum Android Talks #04 - How to publish an android archive (.aar) to Maven...
Infinum
 
PDF
Introduction to Cloud Computing with Google Cloud
wesley chun
 
PDF
Beyond Puppet
Kris Buytaert
 
PDF
A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024
Cloud Native NoVA
 
Acquia BLT for the Win, or How to speed up the project setup, development an...
DrupalCamp Kyiv
 
GCP - GCE, Cloud SQL, Cloud Storage, BigQuery Basic Training
Simon Su
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
MarcinStachniuk
 
Python from zero to hero (Twitter Explorer)
Yuriy Senko
 
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Weaveworks
 
Exploring Google APIs with Python
wesley chun
 
Serverless Data Architecture at scale on Google Cloud Platform
MeetupDataScienceRoma
 
Git as version control for Analytics project
Nag Arvind Gudiseva
 
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
KAI CHU CHUNG
 
Continuous delivery w projekcie open source - Marcin Stachniuk
MarcinStachniuk
 
Release management with NuGet/Chocolatey/JIRA
Yaroslav Serhieiev
 
오픈 소스 프로그래밍 - NoSQL with Python
Ian Choi
 
Spark on Dataproc - Israel Spark Meetup at taboola
tsliwowicz
 
Image archive, analysis & report generation with Google Cloud
wesley chun
 
Creating Extensible Plugins for WordPress
Hristo Chakarov
 
Infinum Android Talks #04 - How to publish an Android archive (.aar) to Maven...
Denis_infinum
 
Infinum Android Talks #04 - How to publish an android archive (.aar) to Maven...
Infinum
 
Introduction to Cloud Computing with Google Cloud
wesley chun
 
Beyond Puppet
Kris Buytaert
 
A Love Story with Kubevirt and Backstage from Cloud Native NoVA meetup Feb 2024
Cloud Native NoVA
 
Ad

More from Soshi Nemoto (11)

PDF
CI : the first_step: Auto Testing with CircleCI - (MOSG)
Soshi Nemoto
 
PDF
Big query the first step - (MOSG)
Soshi Nemoto
 
PDF
Preparation study of_docker - (MOSG)
Soshi Nemoto
 
PDF
Making environment for_infrastructure_as_code
Soshi Nemoto
 
PDF
Fabric workshop(1) - (MOSG)
Soshi Nemoto
 
PDF
DevOps(4) : Ansible(2) - (MOSG)
Soshi Nemoto
 
PDF
DevOps(3) : Ansible - (MOSG)
Soshi Nemoto
 
PDF
DevOps(2) : Vagrant - (MOSG)
Soshi Nemoto
 
PDF
DevOps(1) : What's DevOps - (MOSG)
Soshi Nemoto
 
PDF
Instruction: dev environment
Soshi Nemoto
 
PDF
Why was your proposal rejected?
Soshi Nemoto
 
CI : the first_step: Auto Testing with CircleCI - (MOSG)
Soshi Nemoto
 
Big query the first step - (MOSG)
Soshi Nemoto
 
Preparation study of_docker - (MOSG)
Soshi Nemoto
 
Making environment for_infrastructure_as_code
Soshi Nemoto
 
Fabric workshop(1) - (MOSG)
Soshi Nemoto
 
DevOps(4) : Ansible(2) - (MOSG)
Soshi Nemoto
 
DevOps(3) : Ansible - (MOSG)
Soshi Nemoto
 
DevOps(2) : Vagrant - (MOSG)
Soshi Nemoto
 
DevOps(1) : What's DevOps - (MOSG)
Soshi Nemoto
 
Instruction: dev environment
Soshi Nemoto
 
Why was your proposal rejected?
Soshi Nemoto
 
Ad

Recently uploaded (20)

PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
July Patch Tuesday
Ivanti
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 

Big query - Command line tools and Tips - (MOSG)