Constructing representative sample for a general join operation