Write it as a LEFT SEMI JOIN:
select type,sum(cost) as Cost from T1
LEFT SEMI JOIN T2 ON T1.trans_id = T2.trans_id
WHERE type=0
group by type;
As with Hive 0.13 you won't have to do this as Hive 0.13 supports IN/EXISTS clause with subqueries (HIVE-784).