What you describe is in essence still a spear, and it’s arguably not a good one.
To understand why, you have to understand the practicalities of the construction of a spear versus those of a rapier.
How a spear is built and why it works.
Note that I am considering an actual spear here, not a javelin.
The general construction of a spear is a relatively compact piece of hard material (usually metal or stone) on the end of a relatively rigid pole (usually made of wood). The details of this construction are actually kind of important to understanding the fighting style. In particular:
- The head is very compact relative to the rest of the weapon. This allows it to be kept light without sacrificing durability, which allows for better control when thrusting (compare to many other polearms, where the head is a significant portion of the weight of the weapon and for which thrusting attacks were inefficient compared to other options) while still avoiding significant risk of the head itself breaking.
- The shaft is (usually) constructed to have very high compressive strength along its length, typically at the cost of durability perpendicular to the length of the shaft. This allows for even better thrusting attacks, but means that using the shaft to block is usually a bad idea (which is why so many traditional fighting styles using a spear either use a shield with it, or emphasize dodging or deflecting/redirecting over blocking).
- The binding of the head to the shaft is a potential weak point on the weapon. It’s got to be durable enough that shock loading won’t cause it to come undone, but in general it’s still the most likely part to break unless the shaft itself is attacked directly. The combination of the very compact head and the structure of the shaft means that it can be optimized, however, to simply have good compressive and tensile strength relative to the length of the shaft, and most historical designs were built like this. This leads to a case where striking a spear head as it’s thrust can often easily knock it off the weapon (or knock it out of alignment with the weapon, which will cause it to break off the next time you try to thrust at something).
All of this leads to a relatively simple to construct and simple to use pole weapon optimized for thrusting strikes.
How a rapier is built, why it works, and how it’s different from a spear.
At its simplest, a rapier is a short sword (typically about 1m to 1.3m long) with a thin (often 3cm or less at its widest) double edged blade and an often complicated guard. The blade itself is often at least a bit flexible due to its small cross-section perpendicular to its length, and the overall weapon is light, but not exceedingly so when you consider it rationally (typically about one kilogram). Similar to a spear, details of the actual construction are important to the overall fighting style. In particular:
- The tang (the un-sharpened metal at the opposite end for the blade from the tip) extends the full length (or almost the whole length) of the grip and is in some way locked in. This is a crucial part of making any sword a viable weapon, because it makes it almost impossible for the blade to become separated from the grip. This is also, notably, a drastic difference from a spear, where the norm is either a short tang no longer than the head itself, or a locked collar arrangement (similar to how the heads of most farm implements are affixed to their handles).
- The blade itself has to be specially made. The very edges have to be rigid enough to retain their sharpness and not get dented just because of hitting something but soft enough that they won’t just chip or shatter if you hit something hard, and the rest of the blade has to be flexible and springy enough that striking something hard won’t just snap the blade. This is in stark contrast with a spear head, which instead of being flexible relies on its relatively compact dimensions relative to its volume to maintain its structural stability and is a lot less picky about the exact properties of the material it’s made of.
- Due to the short effective range of a rapier, you need a guard to protect the hand. This isn’t needed at all in a spear, so we can kind of ignore it for the purposes of this discussion, but it’s important to understand that the guard also served to help balance the weapon effectively. The reason a rapier works so well for highly agile combat styles (same for many other fencing swords as well as other thin blades with complicated hilts) is that it has more mass right by where you are controlling it from than anywhere else in the weapon. This gives very precise control, at the cost of not being able to hit as hard.
OK, so what about a rapier on a stick?
What you would get is not a spear, and would not be wielded as such. What it would really be is something along the lines of a glaive, fauchard, naginata, or guandao, but with a very thin blade. Such weapons are generally not great for thrusting attacks, but are very good for sweeping strikes. The problem though is that if the blade is thin and flexible like a rapier, it’s actually going to be too fragile for this type of usage. On top of that, sweeping attacks are pointless unless there’s momentum behind them, because you have to overcome momentum to get them started in the first place (essentially, the lighter a weapon, the shorter it should be if you want it to hit effectively, because you need to put more force directly behind the strike to get the same net impact as you would with a heavier weapon of the same size), and if you get momentum behind it, the impact load on the blade will be enough that it just snaps unless you’re super careful with it.
Now, there are some other designs you could look at that might be better for what you want, but they don’t involve flexible, rapier-like blades. The terms you want to look for are ‘sword staff’, ‘svärdstav’, ‘partisan’, ‘langue de boeuf’, and ‘ox-tongue spear’. All of these describe spear-like weapons that had longer double-edged blades as heads instead of the shorter points many westerners associate with spears these days. They could all be used for both slashing and piercing attacks, and retain most of the benefits of range that a spear would give you, at the cost of some agility due to being heavier (both for durability, and to allow more momentum behind a sweeping attack).