SlideShare a Scribd company logo
PHP と MySQL で
    1-Click
  MapReduce
(@ニコニコ超会議)

  @yuya_takeyama
はじめに
1-Click
無理でした!!!
PHP と MySQL で
       1-Click
1カチャカチャカチャ...ッターン!
      MapReduce
    (@ニコニコ超会議)

     @yuya_takeyama
N番煎じでお送りします
•   MyMR on GitHub
    https://github.com/yuya-takeyama/mymr

•   PHP と MySQL でカジュアルに MapReduce する
    http://blog.yuyat.jp/archives/1706

•   もっとカジュアルに PHP と MySQL で MapReduce する
    http://blog.yuyat.jp/archives/1853

•   PHP と MySQL でカジュアルに MapReduce する
    (スライド・Long Version)
    http://www.slideshare.net/taketyan/php-mysql-mapreduce

•   PHP と MySQL でカジュアルに MapReduce する
    (スライド・Short Version)
    http://www.slideshare.net/taketyan/php-mysql-
    mapreduce-short-version
MapReduce とは
(word count による例)
MapReduce とは

データ処理のための
プログラミングモデル
入力
処理の流れ      ↓
         Map
           ↓
        Shuffle
           ↓
        Reduce
           ↓
          出力
Map


•入力データを受け取り
• 複数の Key/Value ペアを出力
•to be or not to be
•<"to", 1>
•<"be", 1>
•<"or", 1>
•<"not", 1>
•<"to", 1>
•<"be", 1>
Shuffle


•Map による Key/Value を
• Key ごとにまとめて出力
•<"to", 1>
•<"be", 1>
•<"or", 1>
•<"not", 1>
•<"to", 1>
•<"be", 1>
•<"be", [1, 1]>
•<"not", [1]>
•<"or", [1]>
•<"to", [1, 1]>
Reduce


•Shuffle による中間データを
• 集約して答えを出力
•<"be", [1, 1]>
•<"not", [1]>
•<"or", [1]>
•<"to", [1, 1]>
•<"be", 2>
•<"not", 1>
•<"or", 1>
•<"to", 2>
複数の関数の
入出力を経て
最終的な答えを出力
ところで
MySQL で
MapReduce
  したい!!!
それ
  MySQL で
  も1
     カチ
        ャカ
MapReduce  チャ
              ...っ
                   ター
                     ン!
                        で

    したい!!!
モチベーション
•
プログラミングモデルとしての
MapReduce を使いたい

•   GROUP BY では難しい集計

•MySQL を入出力にしたい
• LL でサクッとやりたい
モチベーション
•
プログラミングモデルとしての
MapReduce を使いたい

•   GROUP BY では難しい集計

•MySQL を入出力にしたい
            PHP である必要はあまり無い


• LL でサクッとやりたい
モチベーション
 •
もち プログラミングモデルとしての
  ろん
     1カ
  MapReduce を使いたい
        チャ
           カチ
              ャ...
 • GROUP BY では難しい集計ッタ
                      ーン
                          !で
 • MySQL を入出力にしたい
              PHP である必要はあまり無い


 • LL でサクッとやりたい
というわけで作りました
MyMR
   https://github.com/yuya-takeyama/mymr


•MySQL を入出力とする

• PHP で Map/Reduce を書く

• カチャカチャ...ッターン!で実行
実行までの流れ

•入出力に使う MySQL テーブルの用意
•PHP で Map 関数を書く
•PHP で Reduce 関数を書く
•mymr コマンドを実行する
実行までの流れ

•入出力に使う MySQL テーブルの用意
•PHP で Map 関数を書く
•PHP で Reduce 関数を書く
•mymr コマンドを実行する
           この辺がカチャカチャカチャ...
実行までの流れ

•入出力に使う MySQL テーブルの用意
•PHP で Map 関数を書く
•PHP で Reduce 関数を書く
•mymr コマンドを実行する
            この辺が...ッターン!
に よ る
 yM R
M
    文章中の
単語の数を数える例
 (word count)
use MyMRBuilder;
                      Map/Reduce の定義
$builder = new Builder;

$builder->setInputTable('root@localhost/db/texts');
$builder->setOutputTable('root@localhost/db/word_counts');

$builder->setMapper(function ($record, $emitter) {
    $words = preg_split('/s+/u', $record['text']);
    foreach ($words as $word) {
        $emitter->emit($word, 1);
    }
});

$builder->setReducer(function ($key, $values) {
    $sum = 0;
    foreach ($values as $count) {
        $sum += $count;
    }
    return array('count' => $sum);
});

return $builder;
use MyMRBuilder;
                      Map/Reduce の定義
$builder = new Builder;

$builder->setInputTable('root@localhost/db/texts');
$builder->setOutputTable('root@localhost/db/word_counts');

$builder->setMapper(function ($record, $emitter) {
    $words = preg_split('/s+/u', $record['text']);
    foreach ($words as $word) {       入出力テーブルの指定
        $emitter->emit($word, 1);
    }
});

$builder->setReducer(function ($key, $values) {
    $sum = 0;
    foreach ($values as $count) {
        $sum += $count;
    }
    return array('count' => $sum);
});

return $builder;
use MyMRBuilder;
                      Map/Reduce の定義
$builder = new Builder;

$builder->setInputTable('root@localhost/db/texts');
$builder->setOutputTable('root@localhost/db/word_counts');

$builder->setMapper(function ($record, $emitter) {
    $words = preg_split('/s+/u', $record['text']);
    foreach ($words as $word) {
        $emitter->emit($word, 1);
    }                                    この辺が Map
});

$builder->setReducer(function ($key, $values) {
    $sum = 0;
    foreach ($values as $count) {
        $sum += $count;
    }
    return array('count' => $sum);
});

return $builder;
use MyMRBuilder;
                      Map/Reduce の定義
$builder = new Builder;

$builder->setInputTable('root@localhost/db/texts');
$builder->setOutputTable('root@localhost/db/word_counts');

$builder->setMapper(function ($record, $emitter) {
    $words = preg_split('/s+/u', $record['text']);
    foreach ($words as $word) {
        $emitter->emit($word, 1);
    }
});

$builder->setReducer(function ($key, $values) {
    $sum = 0;
    foreach ($values as $count) {
        $sum += $count;
    }
    return array('count' => $sum);      この辺が Reduce
});

return $builder;
入力


•to be or not to be
Map

function ($record, $emitter) {
    $words = preg_split('/s+/u',
                        $record['text']);
    foreach ($words as $word) {
        $emitter->emit($word, 1);
    }
}
Map       レコードを
                       連想配列として受け取る

function ($record, $emitter) {
    $words = preg_split('/s+/u',
                        $record['text']);
    foreach ($words as $word) {
        $emitter->emit($word, 1);
    }
}
Map

function ($record, $emitter) {
    $words = preg_split('/s+/u',
                        $record['text']);
    foreach ($words as $word) {
        $emitter->emit($word, 1);
    }
}                         text カラム内の
                       文字列をスペースで分割
Map

function ($record, $emitter) {
    $words = preg_split('/s+/u',
                        $record['text']);
    foreach ($words as $word) {
        $emitter->emit($word, 1);
    }
}
                    Key/Value のペアとして
                    中間テーブルに INSERT
+----+--------------------+

Map    | id | text               |
       +----+--------------------+
       | 1 | to be or not to be |
       +----+--------------------+
      ↓ レコードを連想配列として Map へ ↓
        +----+---------+-------+
        | id | key     | value |
        +----+---------+-------+
        | 1 | to       | 1     |
        | 2 | be       | 1     |
        | 3 | or       | 1     |
        | 4 | not      | 1     |
        | 5 | to       | 1     |
        | 6 | be       | 1     |
        +----+---------+-------+
+----+--------------------+

Map          | id | text               |
             +----+--------------------+
             | 1 | to be or not to be |
             +----+--------------------+
          ↓ レコードを連想配列として Map へ ↓
               +----+---------+-------+
               | id | key     | value |
               +----+---------+-------+
               | 1 | to       | 1     |
               | 2 | be       | 1     |
               | 3 | or       | 1     |
               | 4 | not
 value には JSON で入れるので         | 1     |
               | 5 | to
     構造化データも使用可能              | 1     |
               | 6 | be       | 1     |
               +----+---------+-------+
+----+---------+-------+
                            | id | key     | value |

Shuffle                      +----+---------+-------+
                            | 1 | to
                            | 2 | be
                                           | 1
                                           | 1
                                                   |
                                                   |
                            | 3 | or       | 1     |
                            | 4 | not      | 1     |
                            | 5 | to       | 1     |
                            | 6 | be       | 1     |
                            +----+---------+-------+

                          ↓ キーで GROUP BY して ↓
SELECT                    ↓ 値は GROUP_CONCAT ↓
  `key`,                      +---------+--------+
  GROUP_CONCAT(`value`)       | key     | values |
FROM                          +---------+--------+
  `中間テーブル`                    | be      | 1,1    |
                              | not     | 1      |
GROUP BY                      | or      | 1      |
  `key`                       | to      | 1,1    |
                              +---------+--------+
Reduce
function ($key, $values) {
    $sum = 0;
    foreach ($values as $count) {
        $sum += $count;
    }
    return array('count' => $sum);
}
Reduce
                 Key      Value の配列

function ($key, $values) {
    $sum = 0;
    foreach ($values as $count) {
        $sum += $count;
    }
    return array('count' => $sum);
}
Reduce
                         Value を全て足す
function ($key, $values) {
    $sum = 0;
    foreach ($values as $count) {
        $sum += $count;
    }
    return array('count' => $sum);
}
Reduce
function ($key, $values) {
    $sum = 0;
    foreach ($values as $count) {
        $sum += $count;
    }
    return array('count' => $sum);
}
                     返り値の連想配列を
                    レコードとして INSERT
+---------+--------+
            | key     | values |
Reduce      +---------+--------+
            | be      | 1,1    |
            | not     | 1      |
            | or      | 1      |
            | to      | 1,1    |
            +---------+--------+
         ↓ キーと値の配列を Reduce へ ↓
           +----+---------+-------+
           | id | key     | count |
           +----+---------+-------+
           | 1 | be       |     2 |
           | 2 | not      |     1 |
           | 3 | or       |     1 |
           | 4 | to       |     2 |
           +----+---------+-------+
+---------+--------+
                 | key     | values |
Reduce           +---------+--------+
                 | be      | 1,1    |
                 | not     | 1      |
                 | or      | 1      |
 実際にはデリミタとして改行を使用| to      | 1,1    |
                 +---------+--------+
   改行区切りの JSON になる

             ↓ キーと値の配列を Reduce へ ↓
                +----+---------+-------+
                | id | key     | count |
                +----+---------+-------+
                | 1 | be       |     2 |
                | 2 | not      |     1 |
                | 3 | or       |     1 |
                | 4 | to       |     2 |
                +----+---------+-------+
今後の目標


•非同期 INSERT による並列化
• Hadoop へのシームレスな
移行方法の提供
今後の野望

•V8 エンジンとかで

•ストレージエンジン API を
• カジュアルに叩いて

•MapReduce したい
今後の野望
もち
 • ろん エンジンとかで
   V8 1
        カチ
          ャカ
 •          チャ
   ストレージエンジン API を
               ...ッ
                    ター
 • カジュアルに叩いて          ン!
                         で
 •MapReduce したい
ご清聴
 ありがとう
ございました

More Related Content

PDF
PHP と MySQL でカジュアルに MapReduce する (Short Version)
PDF
PHP と MySQL でカジュアルに MapReduce する
PDF
MySQL 入門的なはなし
PDF
アカデミック以外の場において発表される成果や知見の活用について
PPTX
My sqlで2億件のシリアルデータと格闘した話
PPTX
大規模CSVをMySQLに入れる
PDF
これでBigQueryをドヤ顔で語れる!BigQueryの基本
PDF
ヤフー社内でやってるMySQLチューニングセミナー大公開
PHP と MySQL でカジュアルに MapReduce する (Short Version)
PHP と MySQL でカジュアルに MapReduce する
MySQL 入門的なはなし
アカデミック以外の場において発表される成果や知見の活用について
My sqlで2億件のシリアルデータと格闘した話
大規模CSVをMySQLに入れる
これでBigQueryをドヤ顔で語れる!BigQueryの基本
ヤフー社内でやってるMySQLチューニングセミナー大公開

Similar to PHP と MySQL で 1 カチャカチャカチャ...ッターン! MapReduce (@ニコニコ超会議) (20)

PDF
Javaでmongo db
PDF
Hadoop入門
PDF
削除フラグのはなし
PDF
"Programming Hive" Reading #1
PDF
【第3回初心者勉強会】データベースを使おう
PPTX
PHPとMongoDBで学ぶ次世代データストア
PDF
Data-Intensive Text Processing with MapReduce ch4
PDF
textsearch_jaで全文検索
PPTX
TinyMapReduce on ruby
PDF
Random partionerのデータモデリング
 
PPTX
Tritonn から Elasticsearch への移行話
PPTX
BPStudy32 CouchDB 再入門
PDF
WordNetで作ろう! 言語横断検索サービス
PDF
Mongodb 紹介
PDF
MySQL勉強会 インデックス編.2013 08-02
PDF
EucalyptusのHadoopクラスタとJaqlでBasket解析をしてHiveとの違いを味わってみました
PDF
MapReduceによる大規模データ処理 at Yahoo! JAPAN
PDF
Programming in Scala Chapter 17 Collections
PDF
20160929_InnoDBの全文検索を使ってみた by 株式会社インサイトテクノロジー 中村範夫
PDF
WordBeach 2012 WS PHP入門編
Javaでmongo db
Hadoop入門
削除フラグのはなし
"Programming Hive" Reading #1
【第3回初心者勉強会】データベースを使おう
PHPとMongoDBで学ぶ次世代データストア
Data-Intensive Text Processing with MapReduce ch4
textsearch_jaで全文検索
TinyMapReduce on ruby
Random partionerのデータモデリング
 
Tritonn から Elasticsearch への移行話
BPStudy32 CouchDB 再入門
WordNetで作ろう! 言語横断検索サービス
Mongodb 紹介
MySQL勉強会 インデックス編.2013 08-02
EucalyptusのHadoopクラスタとJaqlでBasket解析をしてHiveとの違いを味わってみました
MapReduceによる大規模データ処理 at Yahoo! JAPAN
Programming in Scala Chapter 17 Collections
20160929_InnoDBの全文検索を使ってみた by 株式会社インサイトテクノロジー 中村範夫
WordBeach 2012 WS PHP入門編
Ad

More from Yuya Takeyama (13)

PDF
5分でわかる? 関数型 PHP の潮流
PDF
Good Parts of PHP and the UNIX Philosophy
PDF
Reactor Pattern and React
PDF
PHPUnit でテスト駆動開発を始めよう
PDF
HashTable と HashDos
PDF
Proposal for xSpep BDD Framework for PHP
PDF
Building Development Environment with php-build and phpenv
PDF
PHPUnit でよりよくテストを書くために
PDF
Making DSL with []
PDF
LIMIT 付きで UPDATE を行うと何故怒られるか
PDF
GOOS #1
PDF
Ruby 同好会宣言
ODP
第一回 社内勉強会 PHP Application Security Checklist に学ぶ PHP セキュリティ (Excerpt)
5分でわかる? 関数型 PHP の潮流
Good Parts of PHP and the UNIX Philosophy
Reactor Pattern and React
PHPUnit でテスト駆動開発を始めよう
HashTable と HashDos
Proposal for xSpep BDD Framework for PHP
Building Development Environment with php-build and phpenv
PHPUnit でよりよくテストを書くために
Making DSL with []
LIMIT 付きで UPDATE を行うと何故怒られるか
GOOS #1
Ruby 同好会宣言
第一回 社内勉強会 PHP Application Security Checklist に学ぶ PHP セキュリティ (Excerpt)
Ad

PHP と MySQL で 1 カチャカチャカチャ...ッターン! MapReduce (@ニコニコ超会議)

  • 1. PHP と MySQL で 1-Click MapReduce (@ニコニコ超会議) @yuya_takeyama
  • 4. PHP と MySQL で 1-Click 1カチャカチャカチャ...ッターン! MapReduce (@ニコニコ超会議) @yuya_takeyama
  • 5. N番煎じでお送りします • MyMR on GitHub https://github.com/yuya-takeyama/mymr • PHP と MySQL でカジュアルに MapReduce する http://blog.yuyat.jp/archives/1706 • もっとカジュアルに PHP と MySQL で MapReduce する http://blog.yuyat.jp/archives/1853 • PHP と MySQL でカジュアルに MapReduce する (スライド・Long Version) http://www.slideshare.net/taketyan/php-mysql-mapreduce • PHP と MySQL でカジュアルに MapReduce する (スライド・Short Version) http://www.slideshare.net/taketyan/php-mysql- mapreduce-short-version
  • 8. 入力 処理の流れ ↓ Map ↓ Shuffle ↓ Reduce ↓ 出力
  • 10. •to be or not to be
  • 11. •<"to", 1> •<"be", 1> •<"or", 1> •<"not", 1> •<"to", 1> •<"be", 1>
  • 12. Shuffle •Map による Key/Value を • Key ごとにまとめて出力
  • 13. •<"to", 1> •<"be", 1> •<"or", 1> •<"not", 1> •<"to", 1> •<"be", 1>
  • 14. •<"be", [1, 1]> •<"not", [1]> •<"or", [1]> •<"to", [1, 1]>
  • 16. •<"be", [1, 1]> •<"not", [1]> •<"or", [1]> •<"to", [1, 1]>
  • 20. MySQL で MapReduce したい!!!
  • 21. それ MySQL で も1 カチ ャカ MapReduce チャ ...っ ター ン! で したい!!!
  • 22. モチベーション • プログラミングモデルとしての MapReduce を使いたい • GROUP BY では難しい集計 •MySQL を入出力にしたい • LL でサクッとやりたい
  • 23. モチベーション • プログラミングモデルとしての MapReduce を使いたい • GROUP BY では難しい集計 •MySQL を入出力にしたい PHP である必要はあまり無い • LL でサクッとやりたい
  • 24. モチベーション • もち プログラミングモデルとしての ろん 1カ MapReduce を使いたい チャ カチ ャ... • GROUP BY では難しい集計ッタ ーン !で • MySQL を入出力にしたい PHP である必要はあまり無い • LL でサクッとやりたい
  • 26. MyMR https://github.com/yuya-takeyama/mymr •MySQL を入出力とする • PHP で Map/Reduce を書く • カチャカチャ...ッターン!で実行
  • 27. 実行までの流れ •入出力に使う MySQL テーブルの用意 •PHP で Map 関数を書く •PHP で Reduce 関数を書く •mymr コマンドを実行する
  • 28. 実行までの流れ •入出力に使う MySQL テーブルの用意 •PHP で Map 関数を書く •PHP で Reduce 関数を書く •mymr コマンドを実行する この辺がカチャカチャカチャ...
  • 29. 実行までの流れ •入出力に使う MySQL テーブルの用意 •PHP で Map 関数を書く •PHP で Reduce 関数を書く •mymr コマンドを実行する この辺が...ッターン!
  • 30. に よ る yM R M 文章中の 単語の数を数える例 (word count)
  • 31. use MyMRBuilder; Map/Reduce の定義 $builder = new Builder; $builder->setInputTable('root@localhost/db/texts'); $builder->setOutputTable('root@localhost/db/word_counts'); $builder->setMapper(function ($record, $emitter) {     $words = preg_split('/s+/u', $record['text']);     foreach ($words as $word) {         $emitter->emit($word, 1);     } }); $builder->setReducer(function ($key, $values) {     $sum = 0;     foreach ($values as $count) {         $sum += $count;     }     return array('count' => $sum); }); return $builder;
  • 32. use MyMRBuilder; Map/Reduce の定義 $builder = new Builder; $builder->setInputTable('root@localhost/db/texts'); $builder->setOutputTable('root@localhost/db/word_counts'); $builder->setMapper(function ($record, $emitter) {     $words = preg_split('/s+/u', $record['text']);     foreach ($words as $word) { 入出力テーブルの指定         $emitter->emit($word, 1);     } }); $builder->setReducer(function ($key, $values) {     $sum = 0;     foreach ($values as $count) {         $sum += $count;     }     return array('count' => $sum); }); return $builder;
  • 33. use MyMRBuilder; Map/Reduce の定義 $builder = new Builder; $builder->setInputTable('root@localhost/db/texts'); $builder->setOutputTable('root@localhost/db/word_counts'); $builder->setMapper(function ($record, $emitter) {     $words = preg_split('/s+/u', $record['text']);     foreach ($words as $word) {         $emitter->emit($word, 1);     } この辺が Map }); $builder->setReducer(function ($key, $values) {     $sum = 0;     foreach ($values as $count) {         $sum += $count;     }     return array('count' => $sum); }); return $builder;
  • 34. use MyMRBuilder; Map/Reduce の定義 $builder = new Builder; $builder->setInputTable('root@localhost/db/texts'); $builder->setOutputTable('root@localhost/db/word_counts'); $builder->setMapper(function ($record, $emitter) {     $words = preg_split('/s+/u', $record['text']);     foreach ($words as $word) {         $emitter->emit($word, 1);     } }); $builder->setReducer(function ($key, $values) {     $sum = 0;     foreach ($values as $count) {         $sum += $count;     }     return array('count' => $sum); この辺が Reduce }); return $builder;
  • 35. 入力 •to be or not to be
  • 36. Map function ($record, $emitter) {     $words = preg_split('/s+/u', $record['text']);     foreach ($words as $word) {         $emitter->emit($word, 1);     } }
  • 37. Map レコードを 連想配列として受け取る function ($record, $emitter) {     $words = preg_split('/s+/u', $record['text']);     foreach ($words as $word) {         $emitter->emit($word, 1);     } }
  • 38. Map function ($record, $emitter) {     $words = preg_split('/s+/u', $record['text']);     foreach ($words as $word) {         $emitter->emit($word, 1);     } } text カラム内の 文字列をスペースで分割
  • 39. Map function ($record, $emitter) {     $words = preg_split('/s+/u', $record['text']);     foreach ($words as $word) {         $emitter->emit($word, 1);     } } Key/Value のペアとして 中間テーブルに INSERT
  • 40. +----+--------------------+ Map | id | text | +----+--------------------+ | 1 | to be or not to be | +----+--------------------+ ↓ レコードを連想配列として Map へ ↓ +----+---------+-------+ | id | key | value | +----+---------+-------+ | 1 | to | 1 | | 2 | be | 1 | | 3 | or | 1 | | 4 | not | 1 | | 5 | to | 1 | | 6 | be | 1 | +----+---------+-------+
  • 41. +----+--------------------+ Map | id | text | +----+--------------------+ | 1 | to be or not to be | +----+--------------------+ ↓ レコードを連想配列として Map へ ↓ +----+---------+-------+ | id | key | value | +----+---------+-------+ | 1 | to | 1 | | 2 | be | 1 | | 3 | or | 1 | | 4 | not value には JSON で入れるので | 1 | | 5 | to 構造化データも使用可能 | 1 | | 6 | be | 1 | +----+---------+-------+
  • 42. +----+---------+-------+ | id | key | value | Shuffle +----+---------+-------+ | 1 | to | 2 | be | 1 | 1 | | | 3 | or | 1 | | 4 | not | 1 | | 5 | to | 1 | | 6 | be | 1 | +----+---------+-------+ ↓ キーで GROUP BY して ↓ SELECT ↓ 値は GROUP_CONCAT ↓ `key`, +---------+--------+ GROUP_CONCAT(`value`) | key | values | FROM +---------+--------+ `中間テーブル` | be | 1,1 | | not | 1 | GROUP BY | or | 1 | `key` | to | 1,1 | +---------+--------+
  • 43. Reduce function ($key, $values) {     $sum = 0;     foreach ($values as $count) {         $sum += $count;     }     return array('count' => $sum); }
  • 44. Reduce Key Value の配列 function ($key, $values) {     $sum = 0;     foreach ($values as $count) {         $sum += $count;     }     return array('count' => $sum); }
  • 45. Reduce Value を全て足す function ($key, $values) {     $sum = 0;     foreach ($values as $count) {         $sum += $count;     }     return array('count' => $sum); }
  • 46. Reduce function ($key, $values) {     $sum = 0;     foreach ($values as $count) {         $sum += $count;     }     return array('count' => $sum); } 返り値の連想配列を レコードとして INSERT
  • 47. +---------+--------+ | key | values | Reduce +---------+--------+ | be | 1,1 | | not | 1 | | or | 1 | | to | 1,1 | +---------+--------+ ↓ キーと値の配列を Reduce へ ↓ +----+---------+-------+ | id | key | count | +----+---------+-------+ | 1 | be | 2 | | 2 | not | 1 | | 3 | or | 1 | | 4 | to | 2 | +----+---------+-------+
  • 48. +---------+--------+ | key | values | Reduce +---------+--------+ | be | 1,1 | | not | 1 | | or | 1 | 実際にはデリミタとして改行を使用| to | 1,1 | +---------+--------+ 改行区切りの JSON になる ↓ キーと値の配列を Reduce へ ↓ +----+---------+-------+ | id | key | count | +----+---------+-------+ | 1 | be | 2 | | 2 | not | 1 | | 3 | or | 1 | | 4 | to | 2 | +----+---------+-------+
  • 49. 今後の目標 •非同期 INSERT による並列化 • Hadoop へのシームレスな 移行方法の提供
  • 50. 今後の野望 •V8 エンジンとかで •ストレージエンジン API を • カジュアルに叩いて •MapReduce したい
  • 51. 今後の野望 もち • ろん エンジンとかで V8 1 カチ ャカ • チャ ストレージエンジン API を ...ッ ター • カジュアルに叩いて ン! で •MapReduce したい