sql = 'insert into table inser_tbl partition (dt = dt) select 1 as id, name, case when (name = "" or name = "") then 3 else 4 end as score from tbl where id > 10 limit 100'
stmts = sqlparse.parse(sql)[0].tokens
cols = []
tbls = []
froms = []
wheres = []
last_key = ''
for stmt in stmts:
if stmt.value == 'insert' or stmt.value == 'select' or stmt.value == 'from':