lyfeyaj / jaql

Automatically exported from code.google.com/p/jaql

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error message: "Only predicates on two join inputs are supported by join at this time"

GoogleCodeExporter opened this issue · comments

What steps will reproduce the problem?
1. Running the code in the attached file, though it requires some input 
files.

What is the expected output? What do you see instead?
I get this error message:
"java.lang.RuntimeException: Only predicates on two join inputs are 
supported by join at this time"
on the command

$Ps = join $TfDfOverDocs, $TfDfOverCol where $TfDfOverDocs.($attribute) == 
$TfDfOverCol.($attribute)
into { ($attribute): $TfDfOverCol.($attribute), term: $TfDfOverDocs.term,
        userid: $TfDfOverDocs.userid, TfDfOverCol_DF: $TfDfOverCol.DF, 
TfDfOverCol_TF: $TfDfOverCol.TF,
        TfDfOverDocs_DF: $TfDfOverDocs.DF, TfDfOverDocs_TF: 
$TfDfOverDocs.TF},

What version of the product are you using? On what operating system?
OS = Linux with kernel 2.6.9
Hadoop version = 0.20.1
JAQL version = 0.4

Please provide any additional information below.
I found the code which produce this exception:
Expr e1 = c.child(0);
Expr e2 = c.child(1);
HashSet<Var> s1 = e1.getCapturedVars();
HashSet<Var> s2 = e2.getCapturedVars();
if( s1.size() == 1 && s2.size() == 1 ) {
...  } else {
throw new RuntimeException("Only predicates on two join inputs are 
supported by join at this time");
}

But I don't understand what s1 and s2 represent.

Original issue reported on code.google.com by Avishay.Livne on 5 May 2010 at 3:47

Attachments:

I've realized the problem is caused by the "where" predicate (i.e., "where 
$TfDfOverDocs.($attribute) == $TfDfOverCol.($attribute)"
in which I use .($attribute) to refer to different attribute each time. If I 
replace 
($attribute) with concrete attribute name (i.e., $TfDfOverDocs.genre) then the 
code 
runs.

Is there any way to achieve this kind of generic behavior?

Original comment by Avishay.Livne on 6 May 2010 at 9:03

I was able to successfully compile your query on the current trunk version (rev 
598) without the error message. I believe this was fixed a while back with 
another issue on join predicates.  Let us know if you continue to have trouble.

A computed attribute should work just fine, as long as the computation is not a 
part of the join. For example, this is not supported:

$Ps = join $attribute in ('x','y'), $TfDfOverDocs, $TfDfOverCol 
 where $TfDfOverDocs.($attribute) == $TfDfOverCol.($attribute)
  into $TfDfOverDocs;

because it computes the attribute in the join.

Original comment by Kevin.Be...@gmail.com on 10 Jul 2010 at 1:05

  • Changed state: Fixed