forcedotcom / phoenix

BSD 3-Clause "New" or "Revised" License
558 stars 227 forks source link

Make joins work with tenant-specific tables #518

Closed elilevine closed 10 years ago

elilevine commented 11 years ago

In JoinCompiler.java there are two places where PtableImpl.makePTable is invoked. In both cases, null is passed as the last parameter (baseTableName). For tenant-specific tables baseTableName will be non-null. Need to handle that correctly.

jtaylor-sfdc commented 11 years ago

These PTables created for joins are short-lived. They're basically the combined columns from two tables. Once the join completes, they would no longer be used. Please let me know if that's not the case @maryannxue.

We could choose one or the other baseTableName to pass through, but I'm not sure it matters. What do you think, @elilevine ?

elilevine commented 11 years ago

Maybe it makes sense to clearer identify a PTable as a transient table meant to only support a one-time operation by adding a "temporary" property to PTable or something like that. That way these temporary tables can do away with PTable properties that are meant for tables that are part of DB metadata.

Short of that, we can just leave baseTableName as null IMHO.

jtaylor-sfdc commented 10 years ago

I don't think there's any additional work required here, so I'l close this. We'll add test cases to confirm and if we find any issues we'll reopen.