- Apache Pig 教程
- Apache Pig - 首頁
- Apache Pig 簡介
- Apache Pig - 概述
- Apache Pig - 架構
- Apache Pig 環境
- Apache Pig - 安裝
- Apache Pig - 執行
- Apache Pig - Grunt Shell
- Pig Latin
- Pig Latin - 基礎
- 載入和儲存運算子
- Apache Pig - 讀取資料
- Apache Pig - 儲存資料
- 診斷運算子
- Apache Pig - 診斷運算子
- Apache Pig - Describe 運算子
- Apache Pig - Explain 運算子
- Apache Pig - Illustrate 運算子
- Pig Latin 內建函式
- Apache Pig - Eval 函式
- 載入和儲存函式
- Apache Pig - Bag 和 Tuple 函式
- Apache Pig - 字串函式
- Apache Pig - 日期時間函式
- Apache Pig - 數學函式
- Apache Pig 有用資源
- Apache Pig - 快速指南
- Apache Pig - 有用資源
- Apache Pig - 討論
Apache Pig - 處理壓縮
我們可以使用函式BinStorage()和TextLoader()在Apache Pig中載入和儲存壓縮資料。
示例
假設我們在HDFS目錄/pigdata/中有一個名為employee.txt.zip的檔案。然後,我們可以如下所示將壓縮檔案載入到Pig中。
Using PigStorage:
grunt> data = LOAD 'hdfs://:9000/pig_data/employee.txt.zip' USING PigStorage(',');
Using TextLoader:
grunt> data = LOAD 'hdfs://:9000/pig_data/employee.txt.zip' USING TextLoader;
同樣,我們可以如下所示將壓縮檔案儲存到Pig中。
Using PigStorage:
grunt> store data INTO 'hdfs://:9000/pig_Output/data.bz' USING PigStorage(',');
apache_pig_load_store_functions.htm
廣告