* TSX ends up 0.4%, at 21,009.60

* For the week, the index loses 0.4%

* Tech sector climbs 1.7%

* Consumer discretionary stocks weigh

Feb 9 (Reuters) - Canada's main stock index climbed to a one-week high on Friday, led by technology and financial shares, as investors grew optimistic that interest rates were headed lower and on the outlook for corporate earnings.

The Toronto Stock Exchange's S&P/TSX composite index ended up 89.96 points, or 0.4%, at 21,009.60, its highest closing level since last Friday. For the week, the index was down 0.4%.

U.S. benchmark the S&P 500 traded above the 5,000 mark for a second day with boosts from megacap stocks, while investors were encouraged by strong earnings data and modest revisions to 2023 inflation figures.

"The U.S. markets are very, very strong based on AI ... It's pulling the TSX with it," said Barry Schwartz, portfolio manager at Baskin Financial Services. "The biggest driver is Shopify. It's been on an absolute tear."

Shares of e-commerce company Shopify rose 3.3%, while the technology sector was up 1.7% at its highest level since November 2021. The sector has climbed 10.3% since the start of the year after surging nearly 56% in 2023.

"The inflation number today once again shows that interest rates are going to be coming down fast and furious in the second half of 2024," Schwartz said. "So I think the markets are getting ahead of what should be a very, very strong year for corporate earnings."

Canadian jobs data was also upbeat, showing that the economy added 37,300 jobs in January, more than double the expectation of economists.

Heavily weighted financials rose 0.8% and industrials added 0.4%.

The consumer discretionary sector was a drag, falling 1.4%, after auto parts supplier Magna International forecast 2024 profit below estimates. Shares of Magna ended 6.7% lower.

The materials group, which includes precious and base metals miners and fertilizer companies, was down 0.6% as gold and copper prices fell. (Reporting by Fergal Smith in Toronto and Purvi Agarwal in Bengaluru; Editing by Tasim Zahid and Jonathan Oatis)