Long_pike and short_pike were used in RTW to define the length of the phalanx-capable spears (if the unit didn't have the phalanx formation, those were thus redundant). As their names might suggest, they simply made the spears shorter or longer than normal (a Seleucid phalanx having longer spears than a Greek phalanx shows this in action). As one would expect, the only units that use long_pike also have the phalanx formation (or the M2TW version of it). What is sort of interesting is that all units that have the phalanx formation also have long_pikes.
But I digress. Short answer; I assume it's the same as in RTW and simply regulates the length of the pike/spear in a phalanx (or equivalent) formation.

The pike main attribute is news to me, I hadn't even noticed it until now. All units with the pike attribute are phalanxes, though all phalanxes do not have the pike attribute.

The spear attribute was used in RTW to give a unit a bonus against cavalry and possibly a penalty against infantry, I don't remember exactly. I assume light_spear (which I don't remember from RTW) does something similar. How either relate to spear_bonus X, I'm not sure. It was introduced in the BI expansion as I recall. I would guess there's some redundancy there, but to what extent is beyond me.
Other than that, I don't know.