Wall-based spanwise forcing has been experimentally used with success by Auteri et al. (Phys. Fluids, vol. 22, 2010, 115103) to obtain large reductions of turbulent skin-friction drag and considerable energy savings in a pipe flow. The spatial distribution of the azimuthal wall velocity used in the experiment was not continuous, but piecewise constant. The present study is a numerical replica of the experiment, based on a set of direct numerical simulations (DNS); its goal is the identification of the effects of spatially discrete forcing, as opposed to the idealized sinusoidal forcing considered in the majority of numerical studies. Regardless of the discretization, with DNS the maximum drag reduction is found to be larger: the flow easily reaches complete relaminarization, whereas the experiment was capped at 33 % drag reduction. However, the key result stems from the observation that, for the piecewise-constant forcing, the apparent irregularities of the experimental data appear in the simulation data too. They derive from the rich harmonic content of the discontinuous travelling wave, which alters the drag reduction of the sinusoidal forcing. A detailed understanding of the contribution of each harmonic reveals that, whenever for example technological limitations constrain one to work far from the optimal forcing parameters, a discrete forcing may perform very differently from the corresponding ideal sinusoid, and in principle can outperform it. However, care should be exercised in comparison, as discrete and continuous forcing have different energy requirements.