'Get the names of all tables that need to be joined for a field
@param rfield: the field (S3ResourceField)
@return: a set of tablenames'

@staticmethod
def rfield_tables(rfield):

    left = rfield.left
    if left:
        tablenames = set((j.first._tablename for tn in left for j in left[tn]))
    else:
        tablenames = set([rfield.tname])
    return tablenames
