Gopakumar-Vafa invariant and Macdonald formula