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 8729611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:51:47+00:00 2026-06-13T08:51:47+00:00

I am trying to drop records that contain at least one null in any

  • 0

I am trying to drop records that contain at least one null in any of the fields. For example, if the data has 3 fields, then:

filtered = FILTER data by ($0 is not null) AND ($1 is not null) AND ($2 is not null)

Is there any cleaner way to do this, without having to write out 3 boolean expressions?

  • 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-13T08:51:48+00:00Added an answer on June 13, 2026 at 8:51 am

    If all of the fields are of numeric types, you could simply do something like

    filtered = FILTER data BY $0*$1*$2 is not null;
    

    In Pig, if any terms in an arithmetic expression are null, the result is null.

    You could also write a UDF to take an arbitrary number of arguments and return null (or 0, or false, whatever you find most convenient) if any of the arguments are null.

    filtered = FILTER data BY NUMBER_OF_NULLS($0, $1, $2) == 0;
    

    where NUMBER_OF_NULLS is defined elsewhere, e.g.

    public class NUMBER_OF_NULLS extends EvalFunc {
        public Integer exec(Tuple input) {
            if (input == null) { return 0; }
    
            int c = 0;
            for (int i = 0; i < input.size(); i++) {
                if (input.get(i) == null) c++;
            }
            return c;
        }
    }
    

    Note: I have not tested the above UDF, and I don’t claim it adheres to any best practices for writing clear, robust UDFs. You should add exception-handling code, for example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to insert data from one of my existing table into another
I'm trying to formulate the right query to select records that each have a
What I am trying to achieve is a form that has a button on
hi i am trying to make a query that will run records from a
I have a table of data that I'm trying to standardize. The data entered
I'm trying to select all records that have a duplicate value in the LASTNAME
I'm trying to drop NSOperation objects into an NSOperationQueue. But it seems I'm misunderstanding
I'm trying to drop a SQL Server database from .NET code. I've tried using
I am trying to remove/ drop a users permissions but i keep getting the
I am trying to programmatically drop a column in a table inside of an

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.