Traditional, European, knight training would last fourteen years. Starting when the prospective knight turned seven, and lasting until they were twenty-one. They’d spend seven years serving as a page before becoming a squire at fourteen. Obviously, that encompassed a bit more than just training on a sword, but it’s a good starting point. In a modern context, you can probably train to an expert level with a sword in five or six years.
For a spear, I’m inclined to say six months for combat proficiency. From what I know, polearms are a lot easier to train on. To actually become an expert? You’re probably still looking at years of training, but, and I could be wrong, in conventional combat, spears have a much lower skill ceiling than swords. So, I’m inclined to say the extra time and effort would be wasted.