Variables and functions for spark adaptor