There has recently been interest in relating properties of matrices drawn at random from the classical compact groups to statistical characteristics of number-theoretical L-functions. One example is the relationship conjectured to hold between the value distributions of the characteristic polynomials of such matrices and value distributions within families of L-functions. These connections are extended here to non-classical groups. We focus on an explicit example: the exceptional Lie group G2. The value distributions for characteristic polynomials associated with the 7- and 14-dimensional representations of G2, defined with respect to the uniform invariant (Haar) measure, are calculated using two of the Macdonald constant term identities. A one-parameter family of L-functions over a finite field is described whose value distribution in the limit as the size of the finite field grows is related to that of the characteristic polynomials associated with the seven-dimensional representation of G2. The random matrix calculations extend to all exceptional Lie groups.