it seems that spark defines swapped input and output! and it was never noticed before