Is The Sun also Rises a primary source or a secondary source?
Normally, primary source is used to refer to a piece of text which offers the first thought on a specific subject. A secondary source, therefore, is a text which refers to the primary source. In example, the Declaration of Independence would be a primary source and anything written regarding the Declaration of Independence would be a secondary source.
That being said, one could (loosely) consider Hemingway's novel The Sun Also Rises a primary source based upon the fact that it is his own original work. But, one does not typically refer to a fictional novel as a primary source.
To expand on the idea, a published critical analysis on the novel would be considered a secondary source given it refers to, and quotes, the primary source.