I have performance issues with the following query:
INSERT OVERWRITE TABLE output PARTITION(`date`) SELECT DISTINCT i1.type, i1.id1, i1.id2, i1.id3,