An elementary question of algebraic geometry which was posted on math.stackexchange but received no answer there.
Let $f: X \rightarrow Y$ be a morphism of schemes. Assume that
(i) $f: X \rightarrow Y$ is locally finite, in this sense: $Y$ can be covered by affine open sets $U_i=spec\ A_i$, and $f^{-1}(U_i)$ can be in turn covered by affine open sets $V_{i,j} = spec \ B_{i,j}$, in such a way that each $B_{i,j}$ is finitely generated as an $A_i$-module.
(ii) $f$ is quasi-compact.
Then does it imply that $f$ is a finite morphism?