SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Downloaden Sie, um offline zu lesen
Hive Source Code
                    Reading
            Hadoop Source Code Reading Vol.9(5/30)
              http://hadoop-scr9th.eventbrite.com/
                          @wyukawa


2012年5月31日木曜日
Overview
                Motivation
                What component did I read?
                Set up Development Environment
                Useful document for Code Reading
                Let’s try!
                My understanding
                Where does Hive tune performance?
                My impression
2012年5月31日木曜日
Motivation
                Curiosity
                  How does Hive convert HiveQL to
                  MapReduce jobs?
                  What optimizing processes are adopted?

                 select item, sum(value) from item_tbl group by item;




                                  map         reduce


2012年5月31日木曜日
What component did I read?




                http://www.slideshare.net/ragho/hive-user-meeting-august-2009-facebook

2012年5月31日木曜日
Set up Development Environment

          See http://glowing-moon-7493.herokuapp.com/
                        questions/171/hive


                   Setting up is troublesome...(-_-;)



                         I read r1342841.


2012年5月31日木曜日
Useful document

                Hive Anatomy
                 http://www.slideshare.net/nzhang/hive-
                 anatomy
                Internal Hive
                 http://www.slideshare.net/recruitcojp/
                 internal-hive


2012年5月31日木曜日
Let’s try!




        http://matome.naver.jp/odai/2133708130778775801/2133714001783351003


2012年5月31日木曜日
a few minutes later




           http://matome.naver.jp/odai/2133708130778775801/2133714001583346003

2012年5月31日木曜日
a few hours later




           http://matome.naver.jp/odai/2133708130778775801/2133714001683348003

2012年5月31日木曜日
It’s difficult...
                Complex
                Method length is long




           http://matome.naver.jp/odai/2133708130778775801/2133714001683349103

2012年5月31日木曜日
And there is this ticket...




           http://matome.naver.jp/odai/2133708130778775801/2133714001583345803

2012年5月31日木曜日
2012年5月31日木曜日
Terrible...It’s not good...




           http://matome.naver.jp/odai/2133622524999684001/2133810307761770103

2012年5月31日木曜日
anyway...




           http://matome.naver.jp/odai/2133708130778775801/2133714001583346703

2012年5月31日木曜日
My understanding
     HiveQL            Parser           AST             Semantic Analyzer



        Operator            Logical Plan Generation               QB



   Logical Optimizer              Operator          Physical Plan Generation



   Prepare Execution            Task         Physical Optimizer        Task


     Start MapReduce job
2012年5月31日木曜日
Operator Example
                FetchOperator
                SelectOperator
                FilterOperator
                GroupByOperator
                TableScanOperator
                ReduceSinkOperator
                JoinOperator

2012年5月31日木曜日
Explain Example 1
                hive> explain select * from aaa;
                ...

                STAGE DEPENDENCIES:
                 Stage-0 is a root stage

                STAGE PLANS:
                 Stage: Stage-0
                  Fetch Operator
                   limit: -1

2012年5月31日木曜日
Explain Example 2




2012年5月31日木曜日
Optimizer

                Rule-based
                Optimizer is a set of Transformation rules on
                the operator tree
                The transformation rules are specified by a
                regexp pattern on the tree.
                The rule with minimum cost are executed.
                The cost is regexp pattern match length.


2012年5月31日木曜日
Cost Calculation Example
           HiveQL is “select key from src;”
           Optimizer is ColumnPruner.
           SelectOperator is expressed as “SEL%”.
           Regexp pattern of ColumnPrunerSelectProc rule is
           expressed as “SEL%”.
           The cost is 4.
           Pattern.compile(“SEL%”).matcher(“SEL%”).group
           ().length()

2012年5月31日木曜日
Logical Optimizer Example

                ColumnPruner
                PredicatePushDown
                PartitionPruner
                GroupByOptimizer
                UnionProcessor
                JoinReorder


2012年5月31日木曜日
Physical Optimizer Example


                SkewJoinResolver
                CommonJoinResolver
                 If hive.auto.convert.join=true, resolver start.
                IndexWhereResolver
                MetadataOnlyOptimizer



2012年5月31日木曜日
Break




           http://matome.naver.jp/odai/2133708130778775801/2133714001583346703

2012年5月31日木曜日
Where does Hive tune performance?



                hive.map.aggr            Logical Plan Generation

                hive.auto.convert.join   Physical Optimizer

                hive.exec.parallel       Prepare Execution




2012年5月31日木曜日
hive.map.aggr
                default true                              Logical Plan Generation

                map side aggregation(in-mapper combining)




                     http://www.umiacs.umd.edu/~jimmylin/MapReduce-book-final.pdf

2012年5月31日木曜日
hive.auto.convert.join
                default false                                 Physical Optimizer
                If hive.auto.convert.join=true, map join start.




                                http://www.facebook.com/notes/facebook-engineering/join-
                                        optimization-in-apache-hive/470667928919
2012年5月31日木曜日
hive.exec.parallel
            default false
                                                    Prepare Execution
            If hive.exec.parallel=true, parallel launch(like
            parallel query in Oracle) start. It is effective in
            multi table insert.
      2012-04-03 19:34:09,346 Stage-4 map = 0%, reduce = 0%
      2012-04-03 19:34:16,576 Stage-5 map = 0%, reduce = 0%
      2012-04-03 19:34:47,630 Stage-4 map = 100%, reduce = 0%
      2012-04-03 19:34:57,716 Stage-5 map = 100%, reduce = 0%
      2012-04-03 19:35:40,147 Stage-4 map = 100%, reduce = 67%
      2012-04-03 19:35:46,430 Stage-4 map = 100%, reduce = 100%
      2012-04-03 19:35:46,443 Stage-5 map = 100%, reduce = 100%


2012年5月31日木曜日
My impression
            There are a few choices of performance tuning.
            (hive.auto.convert.join, hive.exec.parallel)
            Data model, ETL flow is more important than
            performance tuning.
            Current optimization in Hive is rule-based. If
            index and statistics and cost-based optimization
            are more developed, there will be more choices
            of performance tuning.


2012年5月31日木曜日

Weitere ähnliche Inhalte

Andere mochten auch

Programming Hive Reading #3
Programming Hive Reading #3Programming Hive Reading #3
Programming Hive Reading #3moai kids
 
ただいまHadoop勉強中
ただいまHadoop勉強中ただいまHadoop勉強中
ただいまHadoop勉強中Satoshi Noto
 
自己紹介プレゼン予告
自己紹介プレゼン予告自己紹介プレゼン予告
自己紹介プレゼン予告Shogo Mochizuki
 
石井の自己紹介スライド(METIシンポジウム用)
石井の自己紹介スライド(METIシンポジウム用)石井の自己紹介スライド(METIシンポジウム用)
石井の自己紹介スライド(METIシンポジウム用)Rikie Ishii
 
自己紹介プレゼン
自己紹介プレゼン自己紹介プレゼン
自己紹介プレゼンKeisuke Miyagawa
 
0331プレゼンテーション
0331プレゼンテーション0331プレゼンテーション
0331プレゼンテーションTaichi Nagano
 
cocowa 松本博樹 自己紹介スライド
cocowa 松本博樹 自己紹介スライドcocowa 松本博樹 自己紹介スライド
cocowa 松本博樹 自己紹介スライドHiroki Matsumoto
 
就活:勝てる自己PRの組み立てかた
就活:勝てる自己PRの組み立てかた 就活:勝てる自己PRの組み立てかた
就活:勝てる自己PRの組み立てかた Kohta Matsumura
 
自己紹介&自社紹介 吉澤和香奈
自己紹介&自社紹介 吉澤和香奈自己紹介&自社紹介 吉澤和香奈
自己紹介&自社紹介 吉澤和香奈Wakana Yoshizawa
 
自己紹介LT(公開版)
自己紹介LT(公開版)自己紹介LT(公開版)
自己紹介LT(公開版)Ken Muryoi
 
Cross2015自己紹介LT資料
Cross2015自己紹介LT資料Cross2015自己紹介LT資料
Cross2015自己紹介LT資料Horiguchi Seito
 
Web API: The Good Parts 落穂ひろい
Web API: The Good Parts 落穂ひろいWeb API: The Good Parts 落穂ひろい
Web API: The Good Parts 落穂ひろいAPI Meetup
 
パワーポイント基礎講座
パワーポイント基礎講座パワーポイント基礎講座
パワーポイント基礎講座ofunato
 
すごい自己紹介
すごい自己紹介すごい自己紹介
すごい自己紹介Hikaru Wada
 
コンテンツをディレクションするということ
コンテンツをディレクションするということコンテンツをディレクションするということ
コンテンツをディレクションするということYoshihiro Kanematsu
 
インターネット広告代理店の「制作ディレクション」というお仕事
インターネット広告代理店の「制作ディレクション」というお仕事インターネット広告代理店の「制作ディレクション」というお仕事
インターネット広告代理店の「制作ディレクション」というお仕事Koki Kaku
 
青年海外協力隊・フィールド調査団の最終報告書
青年海外協力隊・フィールド調査団の最終報告書青年海外協力隊・フィールド調査団の最終報告書
青年海外協力隊・フィールド調査団の最終報告書Daisuke Miyazaki
 

Andere mochten auch (20)

Programming Hive Reading #3
Programming Hive Reading #3Programming Hive Reading #3
Programming Hive Reading #3
 
ただいまHadoop勉強中
ただいまHadoop勉強中ただいまHadoop勉強中
ただいまHadoop勉強中
 
自己紹介プレゼン予告
自己紹介プレゼン予告自己紹介プレゼン予告
自己紹介プレゼン予告
 
石井の自己紹介スライド(METIシンポジウム用)
石井の自己紹介スライド(METIシンポジウム用)石井の自己紹介スライド(METIシンポジウム用)
石井の自己紹介スライド(METIシンポジウム用)
 
自己紹介プレゼン
自己紹介プレゼン自己紹介プレゼン
自己紹介プレゼン
 
0331プレゼンテーション
0331プレゼンテーション0331プレゼンテーション
0331プレゼンテーション
 
cocowa 松本博樹 自己紹介スライド
cocowa 松本博樹 自己紹介スライドcocowa 松本博樹 自己紹介スライド
cocowa 松本博樹 自己紹介スライド
 
就活:勝てる自己PRの組み立てかた
就活:勝てる自己PRの組み立てかた 就活:勝てる自己PRの組み立てかた
就活:勝てる自己PRの組み立てかた
 
自己紹介&自社紹介 吉澤和香奈
自己紹介&自社紹介 吉澤和香奈自己紹介&自社紹介 吉澤和香奈
自己紹介&自社紹介 吉澤和香奈
 
Indexed Hive
Indexed HiveIndexed Hive
Indexed Hive
 
自己紹介
自己紹介自己紹介
自己紹介
 
自己紹介LT(公開版)
自己紹介LT(公開版)自己紹介LT(公開版)
自己紹介LT(公開版)
 
Cross2015自己紹介LT資料
Cross2015自己紹介LT資料Cross2015自己紹介LT資料
Cross2015自己紹介LT資料
 
Web API: The Good Parts 落穂ひろい
Web API: The Good Parts 落穂ひろいWeb API: The Good Parts 落穂ひろい
Web API: The Good Parts 落穂ひろい
 
パワーポイント基礎講座
パワーポイント基礎講座パワーポイント基礎講座
パワーポイント基礎講座
 
すごい自己紹介
すごい自己紹介すごい自己紹介
すごい自己紹介
 
Hive: Loading Data
Hive: Loading DataHive: Loading Data
Hive: Loading Data
 
コンテンツをディレクションするということ
コンテンツをディレクションするということコンテンツをディレクションするということ
コンテンツをディレクションするということ
 
インターネット広告代理店の「制作ディレクション」というお仕事
インターネット広告代理店の「制作ディレクション」というお仕事インターネット広告代理店の「制作ディレクション」というお仕事
インターネット広告代理店の「制作ディレクション」というお仕事
 
青年海外協力隊・フィールド調査団の最終報告書
青年海外協力隊・フィールド調査団の最終報告書青年海外協力隊・フィールド調査団の最終報告書
青年海外協力隊・フィールド調査団の最終報告書
 

Ähnlich wie Hive sourcecodereading

20120630 android ics in Yokohama
20120630 android ics in Yokohama20120630 android ics in Yokohama
20120630 android ics in YokohamaKenichi Ohwada
 
OSC2012 Tokyo Spring, USP lab. presentation
OSC2012 Tokyo Spring, USP lab. presentationOSC2012 Tokyo Spring, USP lab. presentation
OSC2012 Tokyo Spring, USP lab. presentationRyuichi Ueda
 
20120516 NetCommons GoogleMap
20120516 NetCommons GoogleMap20120516 NetCommons GoogleMap
20120516 NetCommons GoogleMapKenichi Ohwada
 
Agile Shibuya github_enterprise
Agile Shibuya github_enterpriseAgile Shibuya github_enterprise
Agile Shibuya github_enterpriseKoichiro Ohba
 
hktstudy 201206 「私だってやれば出来る子!♥Multi-Mechanize♥」
hktstudy 201206 「私だってやれば出来る子!♥Multi-Mechanize♥」hktstudy 201206 「私だってやれば出来る子!♥Multi-Mechanize♥」
hktstudy 201206 「私だってやれば出来る子!♥Multi-Mechanize♥」Aya Komuro
 
GoogleAnalytics Tools クックブック
GoogleAnalytics Tools クックブックGoogleAnalytics Tools クックブック
GoogleAnalytics Tools クックブックTakashi Sudou
 
グリーを支えるソーシャルコーディングのすべて
グリーを支えるソーシャルコーディングのすべてグリーを支えるソーシャルコーディングのすべて
グリーを支えるソーシャルコーディングのすべてKoichiro Ohba
 

Ähnlich wie Hive sourcecodereading (8)

20120630 android ics in Yokohama
20120630 android ics in Yokohama20120630 android ics in Yokohama
20120630 android ics in Yokohama
 
OSC2012 Tokyo Spring, USP lab. presentation
OSC2012 Tokyo Spring, USP lab. presentationOSC2012 Tokyo Spring, USP lab. presentation
OSC2012 Tokyo Spring, USP lab. presentation
 
20120516 NetCommons GoogleMap
20120516 NetCommons GoogleMap20120516 NetCommons GoogleMap
20120516 NetCommons GoogleMap
 
Agile Shibuya github_enterprise
Agile Shibuya github_enterpriseAgile Shibuya github_enterprise
Agile Shibuya github_enterprise
 
hktstudy 201206 「私だってやれば出来る子!♥Multi-Mechanize♥」
hktstudy 201206 「私だってやれば出来る子!♥Multi-Mechanize♥」hktstudy 201206 「私だってやれば出来る子!♥Multi-Mechanize♥」
hktstudy 201206 「私だってやれば出来る子!♥Multi-Mechanize♥」
 
Web GLの話
Web GLの話Web GLの話
Web GLの話
 
GoogleAnalytics Tools クックブック
GoogleAnalytics Tools クックブックGoogleAnalytics Tools クックブック
GoogleAnalytics Tools クックブック
 
グリーを支えるソーシャルコーディングのすべて
グリーを支えるソーシャルコーディングのすべてグリーを支えるソーシャルコーディングのすべて
グリーを支えるソーシャルコーディングのすべて
 

Mehr von wyukawa

Presto conferencetokyo2019
Presto conferencetokyo2019Presto conferencetokyo2019
Presto conferencetokyo2019wyukawa
 
Strata2017 sg
Strata2017 sgStrata2017 sg
Strata2017 sgwyukawa
 
Azkaban-en
Azkaban-enAzkaban-en
Azkaban-enwyukawa
 
Promcon2016
Promcon2016Promcon2016
Promcon2016wyukawa
 
Prometheus london
Prometheus londonPrometheus london
Prometheus londonwyukawa
 
Presto in my_use_case2
Presto in my_use_case2Presto in my_use_case2
Presto in my_use_case2wyukawa
 
Prometheus casual talk1
Prometheus casual talk1Prometheus casual talk1
Prometheus casual talk1wyukawa
 
My ambariexperience
My ambariexperienceMy ambariexperience
My ambariexperiencewyukawa
 
Prometheus
PrometheusPrometheus
Prometheuswyukawa
 
Upgrading from-hdp-21-to-hdp-24
Upgrading from-hdp-21-to-hdp-24Upgrading from-hdp-21-to-hdp-24
Upgrading from-hdp-21-to-hdp-24wyukawa
 
Presto in my_use_case
Presto in my_use_casePresto in my_use_case
Presto in my_use_casewyukawa
 
Hdfs write
Hdfs writeHdfs write
Hdfs writewyukawa
 
Osc mercurial-public
Osc mercurial-publicOsc mercurial-public
Osc mercurial-publicwyukawa
 
Dvcs study
Dvcs studyDvcs study
Dvcs studywyukawa
 
Hudson study-zen
Hudson study-zenHudson study-zen
Hudson study-zenwyukawa
 
Shibuya.trac.8
Shibuya.trac.8Shibuya.trac.8
Shibuya.trac.8wyukawa
 
Hudson tanabata.trac
Hudson tanabata.tracHudson tanabata.trac
Hudson tanabata.tracwyukawa
 

Mehr von wyukawa (18)

Presto conferencetokyo2019
Presto conferencetokyo2019Presto conferencetokyo2019
Presto conferencetokyo2019
 
Strata2017 sg
Strata2017 sgStrata2017 sg
Strata2017 sg
 
Azkaban-en
Azkaban-enAzkaban-en
Azkaban-en
 
Azkaban
AzkabanAzkaban
Azkaban
 
Promcon2016
Promcon2016Promcon2016
Promcon2016
 
Prometheus london
Prometheus londonPrometheus london
Prometheus london
 
Presto in my_use_case2
Presto in my_use_case2Presto in my_use_case2
Presto in my_use_case2
 
Prometheus casual talk1
Prometheus casual talk1Prometheus casual talk1
Prometheus casual talk1
 
My ambariexperience
My ambariexperienceMy ambariexperience
My ambariexperience
 
Prometheus
PrometheusPrometheus
Prometheus
 
Upgrading from-hdp-21-to-hdp-24
Upgrading from-hdp-21-to-hdp-24Upgrading from-hdp-21-to-hdp-24
Upgrading from-hdp-21-to-hdp-24
 
Presto in my_use_case
Presto in my_use_casePresto in my_use_case
Presto in my_use_case
 
Hdfs write
Hdfs writeHdfs write
Hdfs write
 
Osc mercurial-public
Osc mercurial-publicOsc mercurial-public
Osc mercurial-public
 
Dvcs study
Dvcs studyDvcs study
Dvcs study
 
Hudson study-zen
Hudson study-zenHudson study-zen
Hudson study-zen
 
Shibuya.trac.8
Shibuya.trac.8Shibuya.trac.8
Shibuya.trac.8
 
Hudson tanabata.trac
Hudson tanabata.tracHudson tanabata.trac
Hudson tanabata.trac
 

Kürzlich hochgeladen

IFIP IP3での資格制度を対象とする国際認定(IPSJ86全国大会シンポジウム)
IFIP IP3での資格制度を対象とする国際認定(IPSJ86全国大会シンポジウム)IFIP IP3での資格制度を対象とする国際認定(IPSJ86全国大会シンポジウム)
IFIP IP3での資格制度を対象とする国際認定(IPSJ86全国大会シンポジウム)ssuser539845
 
持続可能なDrupal Meetupのコツ - Drupal Meetup Tokyoの知見
持続可能なDrupal Meetupのコツ - Drupal Meetup Tokyoの知見持続可能なDrupal Meetupのコツ - Drupal Meetup Tokyoの知見
持続可能なDrupal Meetupのコツ - Drupal Meetup Tokyoの知見Shumpei Kishi
 
20240326_IoTLT_vol109_kitazaki_v1___.pdf
20240326_IoTLT_vol109_kitazaki_v1___.pdf20240326_IoTLT_vol109_kitazaki_v1___.pdf
20240326_IoTLT_vol109_kitazaki_v1___.pdfAyachika Kitazaki
 
ARスタートアップOnePlanetの Apple Vision Proへの情熱と挑戦
ARスタートアップOnePlanetの Apple Vision Proへの情熱と挑戦ARスタートアップOnePlanetの Apple Vision Proへの情熱と挑戦
ARスタートアップOnePlanetの Apple Vision Proへの情熱と挑戦Sadao Tokuyama
 
「今からでも間に合う」GPTsによる 活用LT会 - 人とAIが協調するHumani-in-the-Loopへ
「今からでも間に合う」GPTsによる 活用LT会 - 人とAIが協調するHumani-in-the-Loopへ「今からでも間に合う」GPTsによる 活用LT会 - 人とAIが協調するHumani-in-the-Loopへ
「今からでも間に合う」GPTsによる 活用LT会 - 人とAIが協調するHumani-in-the-LoopへTetsuya Nihonmatsu
 
2024 01 Virtual_Counselor
2024 01 Virtual_Counselor 2024 01 Virtual_Counselor
2024 01 Virtual_Counselor arts yokohama
 
2024 02 Nihon-Tanken ~Towards a More Inclusive Japan~
2024 02 Nihon-Tanken ~Towards a More Inclusive Japan~2024 02 Nihon-Tanken ~Towards a More Inclusive Japan~
2024 02 Nihon-Tanken ~Towards a More Inclusive Japan~arts yokohama
 
TaketoFujikawa_台本中の動作表現に基づくアニメーション原画システムの提案_SIGEC71.pdf
TaketoFujikawa_台本中の動作表現に基づくアニメーション原画システムの提案_SIGEC71.pdfTaketoFujikawa_台本中の動作表現に基づくアニメーション原画システムの提案_SIGEC71.pdf
TaketoFujikawa_台本中の動作表現に基づくアニメーション原画システムの提案_SIGEC71.pdfMatsushita Laboratory
 
情報処理学会86回全国大会_Generic OAMをDeep Learning技術によって実現するための課題と解決方法
情報処理学会86回全国大会_Generic OAMをDeep Learning技術によって実現するための課題と解決方法情報処理学会86回全国大会_Generic OAMをDeep Learning技術によって実現するための課題と解決方法
情報処理学会86回全国大会_Generic OAMをDeep Learning技術によって実現するための課題と解決方法ssuser370dd7
 

Kürzlich hochgeladen (12)

IFIP IP3での資格制度を対象とする国際認定(IPSJ86全国大会シンポジウム)
IFIP IP3での資格制度を対象とする国際認定(IPSJ86全国大会シンポジウム)IFIP IP3での資格制度を対象とする国際認定(IPSJ86全国大会シンポジウム)
IFIP IP3での資格制度を対象とする国際認定(IPSJ86全国大会シンポジウム)
 
持続可能なDrupal Meetupのコツ - Drupal Meetup Tokyoの知見
持続可能なDrupal Meetupのコツ - Drupal Meetup Tokyoの知見持続可能なDrupal Meetupのコツ - Drupal Meetup Tokyoの知見
持続可能なDrupal Meetupのコツ - Drupal Meetup Tokyoの知見
 
20240326_IoTLT_vol109_kitazaki_v1___.pdf
20240326_IoTLT_vol109_kitazaki_v1___.pdf20240326_IoTLT_vol109_kitazaki_v1___.pdf
20240326_IoTLT_vol109_kitazaki_v1___.pdf
 
ARスタートアップOnePlanetの Apple Vision Proへの情熱と挑戦
ARスタートアップOnePlanetの Apple Vision Proへの情熱と挑戦ARスタートアップOnePlanetの Apple Vision Proへの情熱と挑戦
ARスタートアップOnePlanetの Apple Vision Proへの情熱と挑戦
 
「今からでも間に合う」GPTsによる 活用LT会 - 人とAIが協調するHumani-in-the-Loopへ
「今からでも間に合う」GPTsによる 活用LT会 - 人とAIが協調するHumani-in-the-Loopへ「今からでも間に合う」GPTsによる 活用LT会 - 人とAIが協調するHumani-in-the-Loopへ
「今からでも間に合う」GPTsによる 活用LT会 - 人とAIが協調するHumani-in-the-Loopへ
 
2024 04 minnanoito
2024 04 minnanoito2024 04 minnanoito
2024 04 minnanoito
 
What is the world where you can make your own semiconductors?
What is the world where you can make your own semiconductors?What is the world where you can make your own semiconductors?
What is the world where you can make your own semiconductors?
 
2024 01 Virtual_Counselor
2024 01 Virtual_Counselor 2024 01 Virtual_Counselor
2024 01 Virtual_Counselor
 
2024 02 Nihon-Tanken ~Towards a More Inclusive Japan~
2024 02 Nihon-Tanken ~Towards a More Inclusive Japan~2024 02 Nihon-Tanken ~Towards a More Inclusive Japan~
2024 02 Nihon-Tanken ~Towards a More Inclusive Japan~
 
TaketoFujikawa_台本中の動作表現に基づくアニメーション原画システムの提案_SIGEC71.pdf
TaketoFujikawa_台本中の動作表現に基づくアニメーション原画システムの提案_SIGEC71.pdfTaketoFujikawa_台本中の動作表現に基づくアニメーション原画システムの提案_SIGEC71.pdf
TaketoFujikawa_台本中の動作表現に基づくアニメーション原画システムの提案_SIGEC71.pdf
 
2024 03 CTEA
2024 03 CTEA2024 03 CTEA
2024 03 CTEA
 
情報処理学会86回全国大会_Generic OAMをDeep Learning技術によって実現するための課題と解決方法
情報処理学会86回全国大会_Generic OAMをDeep Learning技術によって実現するための課題と解決方法情報処理学会86回全国大会_Generic OAMをDeep Learning技術によって実現するための課題と解決方法
情報処理学会86回全国大会_Generic OAMをDeep Learning技術によって実現するための課題と解決方法
 

Hive sourcecodereading

  • 1. Hive Source Code Reading Hadoop Source Code Reading Vol.9(5/30) http://hadoop-scr9th.eventbrite.com/ @wyukawa 2012年5月31日木曜日
  • 2. Overview Motivation What component did I read? Set up Development Environment Useful document for Code Reading Let’s try! My understanding Where does Hive tune performance? My impression 2012年5月31日木曜日
  • 3. Motivation Curiosity How does Hive convert HiveQL to MapReduce jobs? What optimizing processes are adopted? select item, sum(value) from item_tbl group by item; map reduce 2012年5月31日木曜日
  • 4. What component did I read? http://www.slideshare.net/ragho/hive-user-meeting-august-2009-facebook 2012年5月31日木曜日
  • 5. Set up Development Environment See http://glowing-moon-7493.herokuapp.com/ questions/171/hive Setting up is troublesome...(-_-;) I read r1342841. 2012年5月31日木曜日
  • 6. Useful document Hive Anatomy http://www.slideshare.net/nzhang/hive- anatomy Internal Hive http://www.slideshare.net/recruitcojp/ internal-hive 2012年5月31日木曜日
  • 7. Let’s try! http://matome.naver.jp/odai/2133708130778775801/2133714001783351003 2012年5月31日木曜日
  • 8. a few minutes later http://matome.naver.jp/odai/2133708130778775801/2133714001583346003 2012年5月31日木曜日
  • 9. a few hours later http://matome.naver.jp/odai/2133708130778775801/2133714001683348003 2012年5月31日木曜日
  • 10. It’s difficult... Complex Method length is long http://matome.naver.jp/odai/2133708130778775801/2133714001683349103 2012年5月31日木曜日
  • 11. And there is this ticket... http://matome.naver.jp/odai/2133708130778775801/2133714001583345803 2012年5月31日木曜日
  • 13. Terrible...It’s not good... http://matome.naver.jp/odai/2133622524999684001/2133810307761770103 2012年5月31日木曜日
  • 14. anyway... http://matome.naver.jp/odai/2133708130778775801/2133714001583346703 2012年5月31日木曜日
  • 15. My understanding HiveQL Parser AST Semantic Analyzer Operator Logical Plan Generation QB Logical Optimizer Operator Physical Plan Generation Prepare Execution Task Physical Optimizer Task Start MapReduce job 2012年5月31日木曜日
  • 16. Operator Example FetchOperator SelectOperator FilterOperator GroupByOperator TableScanOperator ReduceSinkOperator JoinOperator 2012年5月31日木曜日
  • 17. Explain Example 1 hive> explain select * from aaa; ... STAGE DEPENDENCIES: Stage-0 is a root stage STAGE PLANS: Stage: Stage-0 Fetch Operator limit: -1 2012年5月31日木曜日
  • 19. Optimizer Rule-based Optimizer is a set of Transformation rules on the operator tree The transformation rules are specified by a regexp pattern on the tree. The rule with minimum cost are executed. The cost is regexp pattern match length. 2012年5月31日木曜日
  • 20. Cost Calculation Example HiveQL is “select key from src;” Optimizer is ColumnPruner. SelectOperator is expressed as “SEL%”. Regexp pattern of ColumnPrunerSelectProc rule is expressed as “SEL%”. The cost is 4. Pattern.compile(“SEL%”).matcher(“SEL%”).group ().length() 2012年5月31日木曜日
  • 21. Logical Optimizer Example ColumnPruner PredicatePushDown PartitionPruner GroupByOptimizer UnionProcessor JoinReorder 2012年5月31日木曜日
  • 22. Physical Optimizer Example SkewJoinResolver CommonJoinResolver If hive.auto.convert.join=true, resolver start. IndexWhereResolver MetadataOnlyOptimizer 2012年5月31日木曜日
  • 23. Break http://matome.naver.jp/odai/2133708130778775801/2133714001583346703 2012年5月31日木曜日
  • 24. Where does Hive tune performance? hive.map.aggr Logical Plan Generation hive.auto.convert.join Physical Optimizer hive.exec.parallel Prepare Execution 2012年5月31日木曜日
  • 25. hive.map.aggr default true Logical Plan Generation map side aggregation(in-mapper combining) http://www.umiacs.umd.edu/~jimmylin/MapReduce-book-final.pdf 2012年5月31日木曜日
  • 26. hive.auto.convert.join default false Physical Optimizer If hive.auto.convert.join=true, map join start. http://www.facebook.com/notes/facebook-engineering/join- optimization-in-apache-hive/470667928919 2012年5月31日木曜日
  • 27. hive.exec.parallel default false Prepare Execution If hive.exec.parallel=true, parallel launch(like parallel query in Oracle) start. It is effective in multi table insert. 2012-04-03 19:34:09,346 Stage-4 map = 0%, reduce = 0% 2012-04-03 19:34:16,576 Stage-5 map = 0%, reduce = 0% 2012-04-03 19:34:47,630 Stage-4 map = 100%, reduce = 0% 2012-04-03 19:34:57,716 Stage-5 map = 100%, reduce = 0% 2012-04-03 19:35:40,147 Stage-4 map = 100%, reduce = 67% 2012-04-03 19:35:46,430 Stage-4 map = 100%, reduce = 100% 2012-04-03 19:35:46,443 Stage-5 map = 100%, reduce = 100% 2012年5月31日木曜日
  • 28. My impression There are a few choices of performance tuning. (hive.auto.convert.join, hive.exec.parallel) Data model, ETL flow is more important than performance tuning. Current optimization in Hive is rule-based. If index and statistics and cost-based optimization are more developed, there will be more choices of performance tuning. 2012年5月31日木曜日