Zebra and Pig

Zebra ZT41142 打印机网络连接配置避坑指南 本文详细解析了Zebra ZT41142工业打印机网络连接配置的常见问题与解决方案。针对网络通但打印报错的典型情况,核心指出必须使用斑马官方工具创建专用的Zebra Network Port,而非Windows标准TCP/IP端口,并提供了从IP配置、驱动安装到进阶排查的完整避坑指南。 阅读详情

Overview

With Pig you can load and store data in Zebra format. You can also take advantage of sorted Zebra tables for map-side groups and merge joins. When working with Pig keep in mind that, unlike MapReduce, you do not need to declare Zebra schemas. Zebra automatically converts Zebra schemas to Pig schemas (and vice versa) for you.

Zebra Pig Examples

Loading Data

To load data stored in Zebra format (columns) use the TableLoader function.

register $LOCATION/zebra-$version.jar;
A = LOAD 'studenttab' USING org.apache.hadoop.zebra.pig.TableLoader();
B = FOREACH A GENERATE name, age, gpa;

There are a couple of things to note:

  1. You need to register a Zebra jar file the same way you would do it for any other UDF.
  2. You need to place the jar on your classpath.

Zebra data is self-described meaning that the name and type information is stored with the data; you don't need to provide an AS clause or perform type casting unless you actually need to change the data. To check column names and types, you can run the DESCRIBE statement right after the load:

A = LOAD 'studenttab' USING org.apache.hadoop.zebra.pig.TableLoader();
DESCRIBE A;
A: {name: chararray,age: int,gpa: float}

You can provide alternative names to the columns with the AS clause. You can also provide alternative types as long as the original type can be converted to the new type. (One exception to this rule are maps since you can't specify schema for a map. Zebra always creates map values as bytearrays which would require casting to real type in the script. Note that this is not different for treating maps in Pig for any other storage.) For more information see Schemas and Arithmetic Operators and More.

You can provide multiple, comma-separated files to the loader:

A = LOAD 'studenttab, votertab' USING org.apache.hadoop.zebra.pig.TableLoader();

TableLoader supports efficient column selection; projections are automatically pushed down to the loader. This example tells the loader to only return two columns, name and age.

A = LOAD 'studenttab' USING org.apache.hadoop.zebra.pig.TableLoader('name, age');

Map-Side Group and Merge Join

If the input data is globally sorted, merge join and map-side group can be used. Please note the “sorted” argument that is passed to the loader. This lets the loader know that the data is expected to be globally sorted and that a single key must be given to the same map.

Here is an example of the merge join. Note that the first argument to the loader is left empty to indicate that all columns are requested.

A = LOAD'studentsortedtab' USING org.apache.hadoop.zebra.pig.TableLoader('', 'sorted');
B = LOAD 'votersortedtab' USING org.apache.hadoop.zebra.pig.TableLoader('', 'sorted');
G = JOIN A BY $0, B By $0 USING "merge";

Here is an example of a map-side group. Note that multiple sorted files are passed to the loader and that the loader will perform sort-preserving merge to make sure that the data is globally sorted.

A = LOAD 'studentsortedtab, studentnullsortedtab' using org.apache.hadoop.zebra.pig.TableLoader('name, age, gpa, source_table', 'sorted');
B = GROUP A BY $0 USING "collected";
C = FOREACH B GENERATE group, MAX(a.$1);

Sorting Data

Pig allows you to sort data by ascending (ASC) or descending (DESC) order (for more information, see ORDER BY). Currently, Zebra supports tables that are sorted in ascending order. Zebra does not support tables that are sorted in descending order; if Zebra encounters a table to be stored that is sorted in descending order, Zebra will issue a warning and store the table as an unsorted table.

Storing Data

To store data in Zebra format use the TableStorer function. Since Zebra does not support anonymous columns, the relation that is stored must have a name (alias) assigned to every column in the relation.

A = LOAD 'studentsortedtab, studentnullsortedtab' USING org.apache.hadoop.zebra.pig.TableLoader('name, age, gpa, source_table', 'sorted');
B = GROUP A BY $0 USING "collected";
C = FOREACH B GENERATE group, MAX(a.$1) AS max_val;
STORE C INTO 'output' USING org.apache.hadoop.zebra.pig.TableStorer('');

Simple Types

-- The following line is required if the Zebra jar is not part of Hadoop Core

REGISTER $LOCATION/zebra-$version.jar;

-- Load an existing table (a projection string is not specified so all the columns will be loaded)

A = LOAD '$PATH/tbl1' USING org.apache.hadoop.pig.zebra.pig.TableLoader();

-- Store in table format with storage hint '[c1];[c2]' which mean two Column Groups with one column each (note that you do not specify a schema)

STORE A INTO '$PATH/tbl2' USING org.apache.hadoop.zebra.pig.TableStorer('[c1] COMPRESS BY gz; SERIALIZE BY pig;[c2]');

-- Load an existing table (two columns are projected)

B = LOAD '$PATH/tbl3' USING org.apache.hadoop.zebra.pig.TableLoader('c1,c2');

-- Load an existing table (one column is projected)

C = LOAD '$PATH/tbl4' USING org.apache.hadoop.zebra.pig.TableLoader('c2');   

Complex Types

-- The following line is required if the Zebra jar is not part of Hadoop Core

register $LOCATION/zebra-$version.jar;

-- STR_SCHEMA = 
-- "s1:bool, s2:int, s3:long, s4:float, s5:string, s6:bytes,
--  r1:record(f1:int, f2:long), r2:record(r3:record(f3:float, f4)), 
--  m1:map(string),m2:map(map(int)), 
--  c:collection (r1:record(f13:double, f14:float, f15:bytes))";

-- STR_STORAGE = 
-- "[s1, s2]; [m1#{a}]; [r1.f1]; [s3, s4, r2.r3.f3]; 
--  [s5, s6, m2#{x|y}]; [r1.f2, m1#{b}]; [r2.r3.f4, m2#{z}]";


-- Load an existing table (two columns are projected)

A = LOAD '$PATH/tbl1' USING org.apache.hadoop.zebra.pig.TableLoader('r1.f2, s1');

-- Store in table format (all columns are stored in one column group)

STORE A INTO '$PATH/tbl2' USING org.apache.hadoop.zebra.pig.TableStorer('');

-- Load an existing table (two columns are projected)

B = LOAD '$PATH/tbl3' USING org.apache.hadoop.zebra.pig.TableLoader('s1, r1');    

HDFS File Globs

Pig supports HDFS file globs (for more information see GlobStatus).

In this example, all Zebra tables in the directory of /path/to/PIG/tables will be loaded as a union (table union).

 A = LOAD ‘/path/to/PIG/tables/*’ USING org.apache.hadoop.zebra.pig.TableLoader(‘’);

In this example, three Zebra tables of t1, t2 and t3 in /path/to/PIG/tables will be loaded as a union (table union). Note that the ordering of the three tables in the union may not necessarily be t1 followed by t2 followed by t3 as you would expect if you specified ‘/path/to/PIG/tables/t1, /path/to/PIG/tables/t2, /path/to/PIG/tables/t3’. Instead, the ordering is determined by the ordering the HDFS glob expansion generates, namely, the string ordering of the expanded paths.

 A = LOAD ‘/path/to/PIG/tables/{t1, t2, t3}’ USING org.apache.hadoop.zebra.pig.TableLoader(‘’);
Zebra Setup Utilities进阶指南:自定义打印机字体全流程解析 本文详细解析了如何使用Zebra Setup Utilities为斑马打印机自定义字体的全流程。从自定义字体的实战价值讲起,逐步指导用户完成环境准备、字体文件获取,并分别针对V5和V8驱动版本提供了清晰的操作步骤。文章还涵盖了字体调用、常见问题排错及管理技巧,帮助用户彻底掌握这一提升标签打印专业性与效率的核心技能。 阅读详情

相关推荐

Zebra ZD888打印机ZPL指令实战:无驱动IP打印标签全解析

本文详细解析了如何通过ZPL指令实现斑马ZD888打印机的无驱动IP打印。文章从网络配置、ZPL核心语法入手,结合实战代码演示了如何建立Socket连接、发送指令打印文本、条码及中文字符,并提供了字体加载、乱码排查等高级技巧与常见问题解决方案,为自动化标签打印提供了一套稳定高效的实现方法。

e4f5g6h7的博客 1338

ZEBRA命令的添加

ZEBRA命令的注册一共分为四种,对应四种不同的宏: 1. DEFUN(funcname,cmdname,cmd,str,helpstr)       定义命令的执行函数 2. DEFUN_NOSH(funcname,cmdname,cmdstr,helpstr)    定义vtysh不作处理的命令 3. DEFSH(daemon,cmdname,cmdstr,helpstr)       

u010069213的专栏 3091

解决Zebra ZT41142打印机网络连接配置的常见误区

本文详细解析了Zebra ZT41142打印机网络连接配置的常见误区,特别是端口类型选择的关键问题。通过分步指导打印机端设置、PC端驱动安装及端口配置,帮助用户避免90%的连接故障,并提供高级排错技巧和企业环境优化建议,确保打印机稳定联网运行。

weixin_28693447的博客 412

学习 defn & def

看到有人问 说是一个人问他写的一些没有参数的defn能否使用 def来替换;有人回答是如果你每次返回的结果是相同的那么就用def.可以见列子。 user=>(def t0 (System/currentTimeMillis)) user=>(defn t1 [](System/currentTimeMillis)) user=> t0 1318408644243 user=> t0

Xiao_Qiang_的专栏 2181

Zebra Setup Utilities: 打印机字体管理与文件传输全攻略

本文详细介绍了Zebra Setup Utilities(ZSU)在打印机字体管理与文件传输中的高效应用。通过ZSU,用户可以轻松管理Zebra打印机字体、快速传输文件,提升工作效率。文章涵盖安装配置、字体添加与管理、文件传输技巧及常见问题解决,是Zebra打印机用户的实用指南。

weixin_29309785的博客 232

不用装驱动!5分钟搞定Zebra ZD888打印机IP直连打印(附ZPL指令大全)

本文详细介绍了Zebra ZD888打印机IP直连打印的实战指南,无需安装驱动即可快速实现打印操作。文章深入解析ZPL指令的精髓,包括环境搭建、指令架构和高级打印技巧,帮助用户高效完成标签打印任务,特别适合仓储物流和零售行业使用。

dog123的博客 811

quagga 中 命令框架

原文:http://blog.chinaunix.net/uid-29048474-id-3819111.html   在quagga中有很多的命令,利用这些下面分析一下命令是怎么被读取和执行的。在quagga中定义的命令都是利用宏定义实现的,这个宏定义还是有点复杂,下面是命令的宏定义语句。 #define DEFUN(funcname, cmdname, cmdstr, helpstr)

xiyanxiyan10的专栏 1780

zebra命令模式

函数测试框架(Function Test Frame),目的在于提供接口函数的测试的代码框架,轻松实现自动补齐、函数解释、函数运行等,方便测试人员与接口使用者迅速了解函数

zebra 中分析DEFUN宏方法

转载于: https://blog.csdn.net/u010069213/article/details/18570355 zebra实现命令的方法是由command.h中的一个宏来实现的,他的方法DEFUN定义如下 #define DEFUN(funcname,cmdname,cmdstr,helpstr)\ int funcname(struct cmd_element *,...

lailaiquququ11的博客 682

Android 13高通平台CTS camera部分fail项修改(续)

接着上一篇,有几个提了case高通也分析了很久的fail项,其中最离谱的是问题1,第一个接手case的人反反复复处理、内部排查踢皮球、要求log,折腾了很久,最终就给出个解不了的结论。后面还是靠着自己发现了一些蛛丝马迹,并且换了个case接手人才最终解决。

hkj887tg的博客 2061

从URDF到仿真动画:基于Simulink、Simscape与S-Function的机械臂一体化建模与控制

本文详细介绍了从URDF文件到高保真仿真动画的一体化机械臂建模与控制流程。通过整合Simulink、Simscape与S-Function,构建了包含物理特性的虚拟机械臂模型,并实现了自适应滑模等高级控制算法的嵌入与验证。该流程打通了从机械设计到控制算法验证的闭环,为机器人开发提供了高效的仿真平台。

cnn8visionary的博客 700

Pig

Pig概念: Apache Pig是建立在Hadoop之上的一个数据管理工具(类似Hive),用于分析较大的数据集,Pig通常与Hadoop 一起使用;我们可以使用Pig在Hadoop中执行所有的数据处理操作。 用户只需要借助 Pig Latin 的高级语言,编写对应的业务逻辑即可提交执行作业到Yarn上执行。 Apache Pig 为不熟悉MR编程的人降低管理大数据集的门槛。也为大数据高效管理提...

ho_ll_ow的博客 663

相场断裂模型中的各向异性机制:从裂纹密度到驱动力的数值实现

断裂力学是研究材料在载荷作用下裂纹萌生与扩展规律的基础学科,其核心在于理解材料失效的能量准则与路径选择。传统方法通常预设裂纹路径,而相场断裂模型通过引入连续的相场变量,将裂纹模拟转化为一个能量最小化问题,能够自发预测裂纹的萌生、扩展与分叉,在工程失效分析中具有重要价值。当材料具有显著的方向依赖性时,如单晶、复合材料或轧制金属板,各向同性假设会失效,此时需引入各向异性机制。该机制的核心在于改造两个关键部分:一是裂纹密度函数,通过引入各向异性张量来定义不同方向上形成裂纹微结构的能量成本;二是临界能量释放率(断裂

weixin_31421613的博客 298

linux下动态路由软件,用Zebra打造Linux下小型路由器(图)

首先编辑ifcfg-eth0,让它的地址为192.168.1.1, 详细内容如下:[root@rhel5~]#vi /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0ONBOOT=yesBOOTPROTO=staticIPADDR=192.168.1.1NETMASK=255.255.255.0其次编辑ifcfg-eth1,让它的地址为192....

weixin_42465030的博客 481

告别License烦恼:手把手教你用VS Code+Cppcheck搭建免费的MISRA-C代码检查环境

本文详细介绍了如何使用VS Code和开源工具Cppcheck搭建免费的MISRA-C代码检查环境,帮助开发者规避商业工具的高额License费用。通过四步环境搭建和实战技巧,实现高效的代码静态检查,提升嵌入式开发的安全性和可靠性。

weixin_42523326的博客 248

2024年12月中国电子学会青少年软件编程(Python)等级考试试卷(五级)答案 + 解析

2024年12月中国电子学会青少年软件编程(Python)等级考试试卷(五级)答案 + 解析

伶俐角少儿编程 487

Zebra源码分析和改造三-添加定制命令

目录 Zebra源码分析和改造三-添加定制命令 Zebra源码分析和改造三-添加定制命令 一 视图介绍 由上面几篇文章分析可见,所有的命令都是包含在node中的,根据Cisco或者H3常见路由器或者交换机的CLI格式可见,一个node就对应着一个视图(View)。常用...

测试 878

基于STM32的家庭环境监测毕业设计(全部资料)

本文设计并实现了一套基于STM32的家庭环境监测系统,具备温湿度、烟雾浓度和PM2.5检测功能,通过OLED屏实时显示数据,并能自动或手动控制风扇、加湿器等设备。系统采用分层架构设计,包含数据采集、处理、显示和控制执行模块,经测试性能稳定可靠。研究结果表明,该系统能有效提升家庭环境监测与控制的智能化水平,但仍存在传感器精度和智能化程度不足等问题,未来可进一步优化硬件配置并引入AI算法提升性能。

3254968421的博客 462

linux 路由器软件,用Zebra打造Linux下小型路由器(图)

首先编辑ifcfg-eth0,让它的地址为192.168.1.1, 详细内容如下:[root@rhel5~]#vi /etc/sysconfig/network-scripts/ifcfg-eth0DEVICE=eth0ONBOOT=yesBOOTPROTO=staticIPADDR=192.168.1.1NETMASK=255.255.255.0其次编辑ifcfg-eth1,让它的地址为192....

weixin_39531780的博客 287

即插即用系列(代码实践)| 2025 Strip R-CNN:大尺寸条形卷积——遥感目标检测新SOTA,专治细长目标(桥梁、船只)

摘要: 论文《Strip R-CNN: Large Strip Convolution for Remote Sensing Object Detection》针对遥感图像中细长目标(如桥梁、道路)检测难题,提出创新性解决方案。通过设计StripBlock模块,将传统方形卷积核替换为大尺寸条形卷积(水平1×19与垂直19×1组合),有效捕获长距离空间特征,同时减少背景噪声。结合CenterPooling增强目标中心定位,该模块可即插即用至现有网络,显著提升遥感检测任务(如DOTA数据集)的精度。代码已开源,

分享顶会顶刊论文即插即用模块 189

maxim max96712+max96717调试笔记

mxxim max96712 和max96717调试笔记

libuping2023的博客 1万+

斑马打印机zebra setup utilities如何导入模板

Zebra Setup Utilities 是 Zebra 官方提供的一款打印机管理工具,可以方便地配置打印机、上传模板文件、测试打印等。下面我详细介绍如何使用 Zebra Setup Utilities 上传模板文件到打印机的步骤。

weixin_45582252的博客 2742

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

Ubuntu下使用Quagga(Zebra)搭建rip路由器记录

参考这篇博客,但原博客内容图片等有些不清晰,我自己做了个简单的拓扑。 我要做的就是192.168.1.10ping通192.168.3.10,实物图如下。 这2台机器共有6个网口,从左往右数依次是:enp1s0,enp2s0,...,enp6s0。下文中称左边机器为:RouterA,右边机器为RouterB。 RouterA中用的enp1s0(192.168.1.10),enp2s0(192.168.2.10), RouterB中用的enp1s0(192.168.2.20),enp2s0(.

salmonwilliam的博客 1765

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

Apache Pig入门1 –介绍/基本架构/与Hive对比

一、介绍 Google的工程师为了方便自己对MapReduce的实现搞了一个叫做Sawzall的工具,Google就放了几篇论文放在网上,但这玩意在代码上不开源在设计思想是开源的,在前面一篇文章中我也提到过Hadoop也推出了类似Sawzall的Pig语言,就是根据Google放出来的论文山寨的。 Pig是对处理超大型数据集的抽象层,在MapReduce中的框架中有map和reduce两个

每天积累一点,一年后你会发现,自己变化很大 621

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

Zebra-VTYSH源码分析和改造(三):添加定制命令

一 视图介绍 由上面几篇文章分析可见,所有的命令都是包含在node中的,根据Cisco或者H3常见路由器或者交换机的CLI格式可见,一个node就对应着一个视图(View)。常用的视图包括:普通视图,管理视图,文件系统视图,配置视图,以及接口配置视图和VLAN视图等。 在Zebra-VTYSH源码中,实现了的有Enable视图和配置视图。如下图所示: / # vtysh Copyri

大象大象啥模样。。。 1万+

解决zebra下ospf正常启动却无法建立邻居的问题

zebra正常启动,配置好ospf之后,却无法建立邻居,用tcpdump抓包能够抓到双发发送的OSPF报文,ping交换机也没有问题。 以上问题经过分析,是由iptables限制所导致的,执行以下命令之后邻居就建立起来了: [root@localhost ~]# iptables -F [root@localhost ~]# iptables -t nat -F [root@localho

dingtao7890的博客 2266
上一篇: hadoop 2.2 hdfs 操作例子
下一篇: pig 自定义函数和在eclipse里运行
hxpjava1
博客等级 码龄19年 1365粉丝 511原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值