public function union(Query $query, $flag = null) {
        if ($flag === Dialect::ALL || $flag === Dialect::DISTINCT) {
            $query->attribute('flag', $flag);
        }

        return $this->_addCompound(Dialect::UNION, $query);
    }