Multiple realities(covers information from several alternate timelines)
A katana was a traditional Japanese sword.
In 2256, among many weapons stored or displayed in Captain Gabriel Lorca's laboratory aboard the USS Discovery, there were a couple of katanas. (DIS: "Magic to Make the Sanest Man Go Mad")
In 2258 of an alternate reality, Hikaru Sulu used a retractable sword resembling a katana to fight off the Romulans. (Star Trek)
In the prime reality, a samurai wielding a katana appeared firstly to Lieutenant Hikaru Sulu and later to Captain Kirk and First Officer Spock while they and most of their fellow officers from the USS Enterprise were visiting the Shore Leave Planet in 2267. (TOS: "Shore Leave")
In the final draft script of "Shore Leave", this weapon was described as "a huge deadly sword."
In 2268, after the Beta XII-A entity altered the matter on the USS Enterprise to create primitive weapons, Lieutenant Sulu was given a katana. (TOS: "Day of the Dove")