def build_yql function.