Giter Club home page Giter Club logo

bigquery's Introduction

구글 빅쿼리 완벽 가이드

빅데이터, AI, 머신러닝 엔지니어를 위한 대용량 데이터 분석 도구

책표지

《구글 빅쿼리 완벽 가이드》는 다음 판매처에서 구매하실 수 있습니다.

및 전국 교보문고 매장

★ 정오표: https://www.onlybook.co.kr/entry/bigquery-errata
★ 도서정보: https://www.onlybook.co.kr/entry/bigquery

환경 설정

  • 『구글 빅쿼리 완벽 가이드』의 예제 코드를 실행하려면 다음과 같은 환경 설정이 필요합니다. 원서에는 담겨 있지 않은 내용이라 국내 독자를 위해 정리해뒀습니다.

bq 명령줄 도구(command-line) 설치

  • Google Cloud SDK 설치시 사용 가능
  • Installing Google Cloud SDK로 이동
    • Mac OS : 비트에 맞는 파일을 설치한 후, 스크립트 실행

       ./google-cloud-sdk/install.sh
      
    • 윈도우 : Cloud SDK 설치 프로그램 다운로드 또는 파워셀에서 아래 명령어 실행

       (New-Object Net.WebClient).DownloadFile("https://dl.google.com/dl/cloudsdk/channels/rapid/GoogleCloudSDKInstaller.exe", "$env:Temp\GoogleCloudSDKInstaller.exe")
       & $env:Temp\GoogleCloudSDKInstaller.exe
      
    • 공통

      • gcloud 초기화
       gcloud init
      

데이터셋 생성

  • 데이터셋이 없는 경우, 테이블 생성이 불가능합니다. 데이터셋을 먼저 생성해주세요

  • 7장 데이터셋 생성

     bq --location=US mk ch07
     bq --location=US mk ch07eu
    
  • 8장 데이터셋 생성

     bq --location=US mk ch08eu
    
  • 9장 데이터셋 생성

     bq --location=US mk ch09eu
    
  • 10장 데이터셋 생성

     bq --location=US mk ch10eu
    

bigquery's People

Contributors

onlybooks avatar zzsza avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bigquery's Issues

Cloud Shell Editor 에서 에러 해결 요청

수고하십니다. 책을 따라 하고 있습니다. Cloud Shell Editor 에서 아래와 같이 에러 생기는데 제가 무슨 실수를 핸는지 해결 방법은 뭔가요
phg67071@cloudshell:/bigquery/ch04$ bq --location=US mk ch04Invalid identifier 'ch04' for mk.phg67071@cloudshell:/bigquery/ch04$ bq --location=US > load > --source_format=CSV --autodetect > ch04.college_scorecard > ./college_scorecard.csv.gzBigQuery error in load operation: Cannot determine table described by ch04.college_scorecardphg67071@cloudshell:~/bigquery/ch04$ bq --location=US > load --null_marker=NULL \

--source_format=CSV --autodetect
ch04.college_scorecard
./college_scorecard.csv.gz
BigQuery error in load operation: Cannot determine table described by ch04.college_scorecard
phg67071@cloudshell:/bigquery/ch04$ bq --location=US
load --null_marker=NULL --replace
--source_format=CSV --autodetect
ch04.college_scorecard
./college_scorecard.csv.gz
BigQuery error in load operation: Cannot determine table described by ch04.college_scorecard
phg67071@cloudshell:
/bigquery/ch04$

감사합니다.

4장 스키마 질문 있습니다.

안녕하세요. 구글 빅쿼리 완벽 가이드를 구입해서 학습하는 학생입니다.
실습 중 4장의 4-14번 스키마 파일을 지정해 데이터를 빅쿼리로 로드하는 명령을 수행하면 아래와 같은 에러가 발생 합니다.

BigQuery error in load operation: Error processing job 'sound-
vault-299001:bqjob_r28a0067ca69418ae_00000176f0ece41e_1': Error while reading
data, error message: Could not parse 'PrivacySuppressed' as DOUBLE for field
FIRST_GEN (position 1613) starting at location 504392  with message 'Unable to
parse'
Failure details:
- Error while reading data, error message: CSV processing encountered
too many errors, giving up. Rows: 25; errors: 1; max bad: 0; error
percent: 0
- query: Could not parse 'PrivacySuppressed' as DOUBLE for field
FIRST_GEN (position 1613) starting at location 504392  with message
'Unable to parse'

schema.json 진입하여 where 절에 사용하는 4개의 칼럼 모두를 수정하고 명령을 실행 시 위와 같은 에러가 발생 했습니다. 어떤 문제인지 알고 싶습니다.

예제4-27 실행시 에러

선생님 수고하십니다.
질문1
예제4-27 실행시 아래와 같이 에러가 나는데 무엇이 문제일런지요,,
감사합니다.
*** 예제 처럼 --external_table_definition=cstable::${SCHEMA}@csv=${INPUT} \ 부분 코드도 사용해봤지만 에러라
--external_table_definition=cstable::${DEF} \ 로 했습니다.

질문 2.
예제4-35 에서 ch04.college_scorecard_gcs 테이블은 어떻케 하면 생성되는가요
책 어느부분인지요, 앞에서도 ch04.college_scorecard_gcs 언급은 되는데 ,

phg67071@cloudshell:$ LOC="--location US"
phg67071@cloudshell:
$ INPUT=gs://bigquery-oreilly-book/college_scorecard.csv
phg67071@cloudshell:$
phg67071@cloudshell:
$ SCHEMA=$(gsutil cat $INPUT | head -1 | awk -F, '{ORS=","}{for (i=1; i <= NF; i++){ print $i":STRING"; }}' | sed 's/,$//g'| cut -b 4- )
BucketNotFoundException: 404 gs://bigquery-oreilly-book bucket does not exist.
phg67071@cloudshell:$
phg67071@cloudshell:
$ bq $LOC query \

--external_table_definition=cstable::${DEF}
'SELECT SUM(IF(SAT_AVG != "NULL", 1, 0))/COUNT(SAT_AVG) FROM cstable'
Error decoding external_table_definition. external_table_definition should either be the name of a JSON file or the text
representation of an external table definition. Given:
phg67071@cloudshell:~$

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.