datafu-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jarek Jarcec Cecho (JIRA)" <>
Subject [jira] [Created] (DATAFU-68) SampleByKey can throw NullPointerException
Date Mon, 08 Sep 2014 08:50:28 GMT
Jarek Jarcec Cecho created DATAFU-68:

             Summary: SampleByKey can throw NullPointerException
                 Key: DATAFU-68
             Project: DataFu
          Issue Type: Bug
            Reporter: Jarek Jarcec Cecho
            Assignee: Jarek Jarcec Cecho
             Fix For: 1.3.0

I've noticed that {{SampleByKey}} can throw {{NullPointerException}}:

Caused by: java.lang.NullPointerException
	at datafu.pig.sampling.SampleByKey.setUDFContextSignature(
	at org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.POUserFunc.setSignature(
	at org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.POUserFunc.instantiateFunc(
	at org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.POUserFunc.<init>(
	at org.apache.pig.newplan.logical.expression.ExpToPhyTranslationVisitor.visit(
	at org.apache.pig.newplan.logical.expression.UserFuncExpression.accept(
	at org.apache.pig.newplan.ReverseDependencyOrderWalkerWOSeenChk.walk(
	at org.apache.pig.newplan.logical.relational.LogToPhyTranslationVisitor.visit(
	at org.apache.pig.newplan.logical.relational.LOFilter.accept(
	at org.apache.pig.newplan.DependencyOrderWalker.walk(
	at org.apache.pig.newplan.PlanVisitor.visit(
	at org.apache.pig.backend.hadoop.executionengine.HExecutionEngine.compile(
	at org.apache.pig.PigServer.compilePp(
	at org.apache.pig.PigServer.executeCompiledLogicalPlan(
	at org.apache.pig.PigServer.storeEx(
	at org.apache.pig.Pig

I've reproduced the behaviour on old 1.1.0 version, but the UDF in question did not change
much since then and hence I'm assuming that trunk will be affected the same way. Script that
reproduces the issue is simple:

grunt> DEFINE SampleByKey datafu.pig.sampling.SampleByKey('0.5'); 
grunt> data = LOAD 'datafu/input_datafu' AS (A_id:chararray, B_id:chararray, C:int);
grunt> out = FILTER data BY SampleByKey(A_id); 
grunt> DUMP out;

The problem seems to be that method {{setUDFContextSignature}} can be called with {{null}}
argument that breaks our code. The documentation for this method is not specific whether {{null}}
is or isn't allowed. I've looked into other UDFs in Pig and it seems that they are handling
the case when signature is {{null}} and hence I've decided to fix {{SampleByKey}} as well.

This message was sent by Atlassian JIRA

View raw message