pig tutorial - apache pig tutorial - Apache Pig - COSH() - pig latin - apache pig - pig hadoop

What is cosh() function?

  • The inverse hyperbolic functions are the area hyperbolic sine "arsinh" (also denoted "sinh−1", "asinh" or sometimes "arcsinh") and so on.
  • Just as the points (cos t, sin t) form a circle with a unit radius, the points (cosh t, sinh t) form the right half of the equilateral hyperbola.
 cosh function in apache

Learn apache pig - apache pig tutorial - cosh function in apache - apache pig examples - apache pig programs

COSH() function in Apache Pic

  • The COSH() function of Pig Latin is used to compute the hyperbolic cosine of a specified expression.


grunt> COSH(expression)


  • Ensure that we have a file named wikitechy_math.txt in the HDFS directory /pig_data/.
  • This file contains integer and floating point values as shown below.


  • You have loaded this file nito Pig with a relation named math_data as given below.
grunt> math_data = LOAD 'hdfs://localhost:9000/pig_data/wikitechy_math.txt' USING PigStorage(',')
   as (data:float);
  • You compute the hyperbolic cosine values of the contents of the wikitechy_math.txt file using COSH() function as shown below.
grunt> cosh_data = foreach math_data generate (data), COSH(data);
  • Above statement stores the result in the relation named cosh_data.


Now you can the contents of the relation using the Dump operator as given below.

grunt> Dump cosh_data; 


The output shows that the result in the file>cosh_data.


Related Searches to Apache Pig - COSH()

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add wikitechy.com to your ad blocking whitelist or disable your adblocking software.