Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8601885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:56:53+00:00 2026-06-12T01:56:53+00:00

While implementing solution provided at How to optimize a group by statement in PIG

  • 0

While implementing solution provided at How to optimize a group by statement in PIG latin? I found that all the rows with one null column is dropped, which is expected behavior in Pig. I was wondering if the below code would work?

A = B join by ( Bcol1 is null?'UNK',Bcol2 is null?'UNK',Bcol2 is null?999),
C join by ( Ccol1 is null?'UNK',Ccol2 is null?'UNK',Ccol2 is null?999)

I am getting some parsing error.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:56:54+00:00Added an answer on June 12, 2026 at 1:56 am

    PIG is a data flow scripting language and adding extra FOREACH GENERATE which fix the null will not cause extra map reduce jobs.

    B = foreach B generate ....., (Bcol1 is null) ? 'UNK' : Bcol1 as Bcol1, (Bcol2 is null) ? 'UNK' : Bcol2 as Bcol2, (Bcol3 is null) ? 999 : Bcol3;
    C = foreach C generate ....., (Ccol1 is null) ? 'UNK' : Ccol1 as Ccol1, (Ccol2 is null) ? 'UNK' : Ccol2 as Ccol2, (Ccol3 is null) ? 999 : Ccol3;
    A = join B by (Bcol1, Bcol2, Bcol3), C by (Ccol1, Ccol2, Ccol3);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While implementing XML file reading/writing in my application I saw that when I call
While implementing some security aspects with Spring Security, I have noticed that both Authentication
I am implementing a sound effect that plays while a user is dragging a
UPDATE - Cause found! ... please read below & suggest the solution: While creating
I read in forum that while implementing any application using AMQP it is necessary
While implementing transaction scope in mvc application. is it better to create a transaction
I'm writing a web site (C#, ASP 3.5) while implementing a simple CMS. In
I am implementing a jquery file upload page. While a user is adding files,
I was checking out the stocktwits.com website. While signing up I provided them with
I'm implementing a c# program that should automatize a Mono-alphabetic substitution cipher. The functionality

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.