Apache Pig – Metric Conversion UDF

java pig udf

Here is an UDF to give you an idea of how to calculate metric conversions. This UDF contains just a few metric conversion. You can modify the UDF add more metrics.

List of Metric conversions

Kilometer(km) to Mile(mi) – Mile to Kilometer

Inches (in) to Centimeter(cm) – Centimeter to Inches

Celsius(C) to Fahrenheit(F) -Fahrenheit to Celsius

Kilogram(kg) to Pounds(lbs) – Pounds to Kilogram

Apache Pig Script Example

Java PigUnit Test

Java Pig UDF – Metric Conversion UDF