Pig —Multi-Query Execution

A = LOAD ‘/user/input/t.txt‘ as (k:chararray,c:int);
B = group A BY k;
C = foreach B generate group,SUM(A.c);

store C into ‘/user/output/test1.out‘;
DUMP C;
store C into ‘/user/output/test2.out‘;
A = LOAD ‘/user/input/t.txt‘ as (k:chararray,c:int);
B = group A BY k;
C = foreach B generate group,SUM(A.c);

store C into ‘/user/output/test1.out‘;

store C into ‘/user/output/test2.out‘;

With multi-query execution Pig processes an entire script or a batch of statements at once.Will create a batch Job to process the data

Turning it On or Off

Multi-query execution is turned on by default. To turn it off and revert to Pig‘s "execute-on-dump/store" behavior, use the "-M" or "-no_multiquery" options.

To run script "myscript.pig" without the optimization, execute Pig as follows:

$ pig -M myscript.pig
or
$ pig -no_multiquery myscript.pig

the first code will produce three mapred Job for:

1.store C into ‘/user/output/test1.out‘

2.DUMP C

3.store C into ‘/user/output/test2.out‘

while the seconde code will only produce:one mapred Job

if we run the second code by: pig -no_multiquery test.pig it will also produce two Jobs

Store vs. Dump

With multi-query exection, you want to use STORE to save (persist) your results. You do not want to use DUMP as
it will disable multi-query execution and is likely to slow down execution. (If you have included DUMP statements in your scripts for debugging purposes, you should remove them.)

Pig —Multi-Query Execution,布布扣,bubuko.com

时间: 2024-12-28 11:34:41

Pig —Multi-Query Execution的相关文章

SQL Server Query Execution Plan Analysis

SQL Server Query Execution Plan Analysis Source:http://www.sql-server-performance.com/tips/query_execution_plan_analysis_p1.aspx 当需要分析某个查询的效能时,最好的方式之一查看这个查询的执行计划.执行计划描述SQL Server查询优化器如何实际运行(或者将会如何运行)一个特定的查询. 查看查询的执行计划有几种不同的方式.它们包括: SQL Server查询分析器里有一

Multiple Server Query Execution报The result set could not be merged..

在SQL Server中使用Multiple Server Query Execution这个功能做数据库维护或脚本发布时非常方便,昨天由于磁盘空间原因,删除清理了大量的软件和组件,结果导致SSMS客户端出了问题,重装过后,使用Multiple Server Query Execution时,出现了大量下面错误: An error occurred while executing batch. Error message is: The result set could not be merge

对数据集“dsArea”执行查询失败。 (rsErrorExecutingCommand),Query execution failed for dataset 'dsArea'. (rsErrorExecutingCommand),Manually process the TFS data warehouse and analysis services cube

错误提示: 处理报表时出错. (rsProcessingAborted)对数据集“dsArea”执行查询失败. (rsErrorExecutingCommand)Team System 多维数据集或者不存在,或者未经处理. 解决方法: Manually process the TFS data warehouse and analysis services cube When you need the freshest data in your reports, when errors have

Understanding how SQL Server executes a query

https://www.codeproject.com/Articles/630346/Understanding-how-SQL-Server-executes-a-query https://www.codeproject.com/Articles/732812/How-to-analyse-SQL-Server-performance This article will help you write better database code and will help you get st

2743711 - Possible Unexpected Results When Using Query With an ORDER BY Clause on a Rowstore Table With a Parallelized Search on a Cpbtree-Type Index

2743711 - Possible Unexpected Results When Using Query With an ORDER BY Clause on a Rowstore Table With a Parallelized Search on a Cpbtree-Type Index Version 14 from May 28, 2019 in English Show Changes Symptom A query on a rowstore table containing

事件轮询 event loop

Understanding the node.js event loop The first basic thesis of node.js is that I/O is expensive: So the largest waste with current programming technologies comes from waiting for I/O to complete. There are several ways in which one can deal with the

翻译-In-Stream Big Data Processing 流式大数据处理

相当长一段时间以来,大数据社区已经普遍认识到了批量数据处理的不足.很多应用都对实时查询和流式处理产生了迫切需求.最近几年,在这个理念的推动下,催生出了一系列解决方案,Twitter Storm,Yahoo S4,Cloudera Impala,Apache Spark和Apache Tez纷纷加入大数据和NoSQL阵营.本文尝试探讨流式处理系统用到的技术,分析它们与大规模批量处理和OLTP/OLAP数据库的关系,并探索一个统一的查询引擎如何才能同时支持流式.批量和OLAP处理. 在Grid Dy

MySQL监控模板说明-Percona MySQL Monitoring Template for Cacti

http://blog.chinaunix.net/uid-16844903-id-3535535.html https://www.percona.com/doc/percona-monitoring-plugins/1.1/zabbix/index.html InnoDB Adaptive Hash Index InnoDB Buffer Pool Activity InnoDB Buffer Pool InnoDB Checkpoint Age InnoDB Current Lock Wa

http://elasticsearch-py.readthedocs.io/en/master/api.html

API Documentation All the API calls map the raw REST api as closely as possible, including the distinction between required and optional arguments to the calls. This means that the code makes distinction between positional and keyword arguments; we,

Impala:新一代开源大数据分析引擎--转载

原文地址:http://www.parallellabs.com/2013/08/25/impala-big-data-analytics/ 文 / 耿益锋 陈冠诚 大数据处理是云计算中非常重要的问题,自Google公司提出MapReduce分布式处理框架以来,以Hadoop为代表的开源软件受到越来越多公司的重视和青睐.以Hadoop为基础,之后的HBase,Hive,Pig等系统如雨后春笋般的加入了Hadoop的生态系统中.今天我们就来谈谈Hadoop系统中的一个新成员 – Impala. I