Where Does The “Holy, Holy, Holy” Prayer Come From?

At Mass we say, “Holy, holy, holy, Lord God of Hosts, heaven and earth are full of your glory. Hosanna in the highest. Blessed is he who comes in the name of the Lord. Hosanna in the highest.
What this prayer is and where it come from
In Latin, this prayer is called the Sanctus. It comes as its first word in Latin. The first line is the hymn of the seraphim in Isaiah 6:3 and Revelation 4:8. The second part is what the crowd cried to Jesus at his triumphal entry into Jerusalem (Mt 21:9), which is modeled after Psalm 118:25.
What “Hosanna” means?
Hosanna is a Hebrew term. It is derived from the words yasha, which means “save,” and na, which is an expression of entreaty or request and can be translated in a variety of ways, for example, “I pray,” “I beseech,” “please,” or “O.” The Hebrew terms were combined – yasha na (“O, save!”), as in Psalm 118:25 – and this became hosanna.
Its Origin And Use
It was used as part of the Jewish temple liturgy during the feast of Tabernacles. During that time, the priests carried willow branches and cried “Hosanna!” while processing around the altar of burnt offering’. Over time, the crowd who gathered to worship picked it up, and it became a cry of joy. The seventh day of Tabernacles even came to be called “Hosanna Day.”
By saying “in the highest,” the crowd invoked heaven’s blessing on them and the salvation that the Messiah was bringing.
The phrase also echoes the song of the angels in Luke 2:14: “Glory to God in the highest”. To paraphrase the shouts of the crowd: “Save us, our Messiah, who comes to fulfill God’s mission! Save us, we beseech you, as you take your rightful throne and extend heaven’s salvation to us!”
Thus, During the Triumphant entry, the crowd greeted the Messiah by waving palm branches and joyfully crying “Hosanna!” to him as he entered Jerusalem. By this time, the term may have lost some of its original meaning and may have been mostly an acclamation of joy and petition (as it is now during Mass).
Even at that, it still carried the air of a joyful petition for deliverance. The expression “Hosanna to the Son of David!” was an exhortation to acclaim or praise the Messiah in hopes of deliverance probably from the hated Romans in the mind of the crowd.
In fact, the expression, “Hosanna in the highest!” is more mysterious.
Suggestions have included the idea that it is an exhortation to us to cry “Hosanna!” to God, that it is an exhortation to the angels to cry “Hosanna!” to God, that it is an exhortation for there to be songs of praise in heaven, and even that the phrase means “Up with your branches!” on the unlikely supposition that the branches carried during the feast of Tabernacles had come to be called “hosannas”.
“Hosanna” was used as part of Mass in the first century.
The Didache (A.D. 70) includes the acclamation “Hosanna to the God of David!” among the congregation’s responses during the prayer of thanksgiving after Communion.