• LOGIN
  • No products in the cart.

301.4.7-Joins

Joins

  • Two Tables
Retail_invoice = LOAD '/Retail_invoice_hdfs' USING PigStorage('\t') as (uniq_idi:chararray, InvoiceNo:chararray, StockCode:chararray, Description:chararray,Quantity:INT);
DESCRIBE Retail_invoice;

Retail_Customer = LOAD '/Retail_Customer_hdfs' USING PigStorage('\t') as (uniq_idc:chararray, InvoiceDate:chararray, UnitPrice:INT, CustomerID:chararray,Country:chararray);
DESCRIBE Retail_Customer;

Left Outer Join

Left_join = JOIN Retail_invoice BY uniq_idi LEFT OUTER, Retail_Customer BY uniq_idc;
DESCRIBE Left_join;

DUMP Left_join;

Right Outer Join

Right_join = JOIN Retail_invoice BY uniq_idi RIGHT OUTER, Retail_Customer BY uniq_idc;
DESCRIBE Right_join;

DUMP Right_join;

Full Outer Join

Full_join = JOIN Retail_invoice BY uniq_idi FULL, Retail_Customer BY uniq_idc;
DESCRIBE Full_join;

DUMP Full_join;