def _validate_sql_string(sql_string): if len(sql_string) > 0: if sql_string[-1] != ";": sql_string = sql_string + ";" else: raise InvalidQueryError(sql_string) return sql_string
def get_rules_list(self, ksqlfile): with open(ksqlfile) as rf: rule = "" for line in rf: rule = rule + " " + line.strip() if rule[-1:] == ';': yield rule rule = "" if rule[-1:] != ';': raise InvalidQueryError(rule)