<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>pig udf output schema - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/pig-udf-output-schema/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/pig-udf-output-schema/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Wed, 15 Sep 2021 05:04:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>pig udf output schema - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/pig-udf-output-schema/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What is the purpose of @outputSchema decorator in Python UDF when using in Apache Pig ?</title>
		<link>https://www.wikitechy.com/interview-questions/apache-pig/what-is-the-purpose-of-outputschema-decorator-in-python-udf-when-using-in-apache-pig/</link>
					<comments>https://www.wikitechy.com/interview-questions/apache-pig/what-is-the-purpose-of-outputschema-decorator-in-python-udf-when-using-in-apache-pig/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Mon, 12 Jul 2021 08:49:19 +0000</pubDate>
				<category><![CDATA[Apache Pig]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Amazon Development Centre India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[apache pig python]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[CRISIL LIMITED interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Ernst & Young interview questions and answers]]></category>
		<category><![CDATA[Exide Industries interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[Genpact interview questions and answers]]></category>
		<category><![CDATA[Hexaware Technologies interview questions and answers]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[Myntra Designs Pvt. Ltd interview questions and answers]]></category>
		<category><![CDATA[outputschema pig]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[pig and python analogy]]></category>
		<category><![CDATA[pig interview questions and answers]]></category>
		<category><![CDATA[pig interview questions and answers for experienced]]></category>
		<category><![CDATA[pig interview questions for experienced]]></category>
		<category><![CDATA[Pig Interview Questions for experienced and freshers]]></category>
		<category><![CDATA[pig practice questions]]></category>
		<category><![CDATA[pig python udf bag input]]></category>
		<category><![CDATA[pig python udf example]]></category>
		<category><![CDATA[pig udf load function example]]></category>
		<category><![CDATA[pig udf output schema]]></category>
		<category><![CDATA[pig udf return tuple]]></category>
		<category><![CDATA[Prokarma Softech nterview questions and answers]]></category>
		<category><![CDATA[python udf example]]></category>
		<category><![CDATA[python udf hive]]></category>
		<category><![CDATA[python udf pig tuple]]></category>
		<category><![CDATA[python udf spark]]></category>
		<category><![CDATA[Quintiles interview questions and answers]]></category>
		<category><![CDATA[RBS India Development Centre Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[Syngene International Limited interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[Xoriant Solutions Pvt Ltd interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=215</guid>

					<description><![CDATA[Answer:A UDF has input and output. Here is the different ways you can specify the output format of a Python UDF through use of the outputSchema decorator.]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="specifying-the-udf-output-schema" class="color-green" style="text-align: justify;">Specifying the UDF output schema</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>A UDF has input and output. Here is the different ways you can specify the output format of a Python UDF through use of the outputSchema decorator.</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="sample-code" class="color-green">Sample Code:</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-javascript code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-javascript code-embed-code"># the original udf<br/># it returns a single chararray (that&#039;s PigLatin for String)<br/>@outputSchema(&#039;word:chararray&#039;)<br/>def hi_world():<br/>    return &quot;hello world&quot;<br/>    <br/># this one returns a Python tuple. Pig recognises the first element <br/># of the tuple as a chararray like before, and the next one as a <br/># long (a kind of integer)<br/>@outputSchema(&quot;word:chararray,number:long&quot;)<br/>def hi_everyone():<br/>  return &quot;hi there&quot;, 15<br/><br/>#we can use outputSchema to define nested schemas too, here is a bag of tuples<br/>@outputSchema(&#039;some_bag:bag{t:(field_1:chararray, field_2:int)}&#039;)<br/>def bag_udf():<br/>    return [<br/>        (&#039;hi&#039;,1000),<br/>        (&#039;there&#039;,2000),<br/>        (&#039;bill&#039;,0)<br/>    ]<br/><br/>#and here is a map<br/>@outputSchema(&#039;something_nice:map[]&#039;)<br/>def my_map_maker():<br/>    return {&quot;a&quot;:&quot;b&quot;, &quot;c&quot;:&quot;d&quot;, &quot;e&quot;,&quot;f&quot;}</code></pre> </div>
</div>
</div>
<p style="text-align: justify;">OutputSchema can be used to imply that a function outputs one or a combination of basic types. Those types are:</p>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>chararray: like a string</li>
<li>bytearray: a bunch of bytes in a row. Like a string but not as human friendly</li>
<li>long: long integer</li>
<li>int: normal integer</li>
<li>double: floating point number</li>
<li>datetime</li>
<li>boolean</li>
<li>No schema is specified;then the Pig assumes that the UDF outputs a bytearray.</li>
</ul>
</div>
</div>
<div class="hddn" style="text-align: justify;"><img fetchpriority="high" decoding="async" class="aligncenter size-medium" src="https://cdn.wikitechy.com/interview-questions/apache-pig/apache-pig-udf.png" alt="Apache Pig UDF" width="700" height="476" /></div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/apache-pig/what-is-the-purpose-of-outputschema-decorator-in-python-udf-when-using-in-apache-pig/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is UDF in Pig ?</title>
		<link>https://www.wikitechy.com/interview-questions/apache-pig/what-is-udf-in-pig/</link>
					<comments>https://www.wikitechy.com/interview-questions/apache-pig/what-is-udf-in-pig/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Mon, 12 Jul 2021 05:39:32 +0000</pubDate>
				<category><![CDATA[Apache Pig]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Amazon Development Centre India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[apache pig interview questions for experienced]]></category>
		<category><![CDATA[apache pig practice examples]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[CRISIL LIMITED interview questions and answers]]></category>
		<category><![CDATA[define in pig]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Ernst & Young interview questions and answers]]></category>
		<category><![CDATA[Exide Industries interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[Genpact interview questions and answers]]></category>
		<category><![CDATA[Hexaware Technologies interview questions and answers]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[Myntra Designs Pvt. Ltd interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[pig evalfunc example]]></category>
		<category><![CDATA[pig filter udf example]]></category>
		<category><![CDATA[pig interview questions and answers for experienced]]></category>
		<category><![CDATA[pig practical questions]]></category>
		<category><![CDATA[pig script execution sequence]]></category>
		<category><![CDATA[pig udf]]></category>
		<category><![CDATA[pig udf example]]></category>
		<category><![CDATA[pig udf examples]]></category>
		<category><![CDATA[pig udf load function example]]></category>
		<category><![CDATA[pig udf multiple arguments]]></category>
		<category><![CDATA[pig udf output schema]]></category>
		<category><![CDATA[pig udf return tuple]]></category>
		<category><![CDATA[Prokarma Softech nterview questions and answers]]></category>
		<category><![CDATA[Quintiles interview questions and answers]]></category>
		<category><![CDATA[RBS India Development Centre Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[Syngene International Limited interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[udf in pig]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[Xoriant Solutions Pvt Ltd interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=161</guid>

					<description><![CDATA[Answer:Pig UDFs-Pig supported the languages: Java, Python, and JavaScript.]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="udf-in-pig" class="color-green" style="text-align: justify;">UDF in Pig</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li><b>Pig UDFs</b>-Pig supported the languages: Java, Python, and JavaScript.</li>
<li>It give high importance for Java functions.</li>
<li>It include the parts of data load, column transformation, and aggregation.</li>
<li>The coder can customize all parts of the processing which including data load, column transformation and aggregation.</li>
<li>In addition to pre-defined function, Apache Pig support for User Defined Function.</li>
<li>The own function define by User Defined Function.</li>
<li>It supports programming languages, like Java, Jython, Python, JavaScript, Ruby and Groovy.</li>
<li>For writing User Defined Function, it complete support is provided in Java and limited support providing for remaining languages.</li>
<li>Since Apache Pig written in Java, the User Defined Function written using Java language work efficiently compared to all other languages.</li>
<li>The coder have a Java repository for User Defined Function is termed as Piggybank.</li>
<li>Using Piggybank, the coder access Java User Defined Function written by others, and contribute our own User Defined Function.</li>
</ul>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn"></div>
</div>
<div class="text-center row" style="text-align: justify;">
<div class="col-sm-12">
<div id="bsa-zone_1590522538159-8_123456"></div>
</div>
</div>
<div class="hddn"><img fetchpriority="high" decoding="async" class="aligncenter size-medium" src="https://cdn.wikitechy.com/interview-questions/apache-pig/apache-pig-udf.png" alt="Apache Pig UDF" width="700" height="476" /></div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="steps" class="color-green">Steps:</h2>
</div>
</div>
<div class="Content">
<div class="hddn">
<ul>
<li style="text-align: justify;">All User Defined Function must extend <code>"org.apache.pig.EvalFunc"</code></li>
<li style="text-align: justify;">All functions must override <code>"exec"</code> method.</li>
</ul>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/apache-pig/what-is-udf-in-pig/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
