Ejemplo n.º 1
0
 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
Ejemplo n.º 2
0
    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)