Chatgpt
Chatgpt
You:
a) Create pig script to declare bag using movies_data.csv b) Create pig script to Filter movie rating > 3 c) Create pig script to Display pig script to display
number of rows d) Create pig script to group movies by genre.
------------------
ChatGPT:
Sure, I can help you with that! Below are the Pig scripts for each of the tasks you mentioned:
Assuming you have a CSV file named movies_data.csv with columns like movie_id, movie_name, genre, and rating.
pig
-- Load the data from CSV file
movies = LOAD 'movies_data.csv' USING PigStorage(',') AS (movie_id:int, movie_name:chararray, genre:chararray, rating:float);
pig
-- Load the data from CSV file
movies = LOAD 'movies_data.csv' USING PigStorage(',') AS (movie_id:int, movie_name:chararray, genre:chararray, rating:float);
https://chat.openai.com/c/a4d305b4-3075-49dc-815c-15286d6d8ff2 1/2
12/11/23, 11:32 PM ChatGPT
pig
-- Load the data from CSV file
movies = LOAD 'movies_data.csv' USING PigStorage(',') AS (movie_id:int, movie_name:chararray, genre:chararray, rating:float);
pig
-- Load the data from CSV file
movies = LOAD 'movies_data.csv' USING PigStorage(',') AS (movie_id:int, movie_name:chararray, genre:chararray, rating:float);
Note: Make sure to adjust the column names and data types in the Pig scripts based on your actual CSV file structure.
------------------
https://chat.openai.com/c/a4d305b4-3075-49dc-815c-15286d6d8ff2 2/2