What does the 1M resistor do in this circuit? (knock sensor)

Thanks for the quick reply...
but I still can't understand why a resistor has to be put in.. wouldn't that mean that the 'capacitor' would discharge? It seems that it would be desirable for all the charge to be sent in to the arduino (instead of passing to the other side of the "capacitor" through the resistor..)