  For a complex function $F$ on $\mathbb C$, we study the associated
composition operator $T_{F}(f):=F\circ f= F(f)$ on Wiener amalgam
$W^{p,q}(\mathbb R^d) \ (1\leq p< \infty, 1\leq q<2).$ We have shown $T_{F} $
maps $W^{p, 1}(\mathbb R^d)$ to $W^{p,q}(\mathbb R^d)$ if and only if $F$ is
real analytic on $\mathbb R^2$ and $F(0)=0.$ Similar result is proved in the
case of modulation spaces $M^{p,q}(\mathbb R^d).$ In particular, this gives an
affirmative answer to the open question proposed by Bhimani-Ratnakumar (J.
Funct. Anal. 270 (2016), p.621-648).
