1. A computer-implemented method comprising: identifying by a processor one or more resource sharing opportunities across a plurality of parallel tasks, wherein the plurality of parallel tasks includes one or more relational operations and at least one non-relational operation; executing the plurality of parallel tasks involving the one or more relational operations and the at least one non-relational operation; sharing, in response to executing the plurality of parallel tasks, one or more resources of the identified resource sharing opportunities across tasks involving both the one or more relational operations and at least one non-relational operation, and wherein at least one non-relational operation includes a clustering operation; and designating a task of the plurality of parallel tasks as a primary task, wherein a cluster-id of the primary task is a map output key of a merged task, and wherein in the merged task, cluster-ids of other tasks are part of map output values.