-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
66 lines (55 loc) · 1.31 KB
/
test.py
File metadata and controls
66 lines (55 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# import sqlparse
# sql = 'select ppc from table1 where id = 1'
# res = sqlparse.parse(sql)
# stmt = res[0]
# print(stmt.get_real_name())
import re
# table_names = ['ppc', 'pradeep', 'cool']
# tab = table_names[:2]
# print(tab)
# str = 'ppca'
# lis = str.split(".")
# print(lis)
# sql = 'select distinct table1.A,table2.B from table1'
# ag_op = re.search('select(.*)from', sql).group(1).strip()
# s = re.search("select(.*)from",sql)
# sq_st = re.search(r"\((.*)\)", sql)
# if sq_st is not None:
# print(sq_st.group(1))
# print(s.group(1).strip() + "ppc")
# sel_col_strs = [x.strip() for x in ag_op.split(",")]
# print(sel_col_strs)
# l = []
#
# if True:
# l = [1,2,3]
# else:
# pass
#
# print(l)
# sql = "select table1.A from table1 where table1.A = 20 and table1.B = 30"
# q_str = []
# if re.search('where',sql) == None:
# q_str = "True"
# else:
# q_str = re.search('where(.*)', sql).group(1).strip()
# q_str = q_str.split(" ")
# print(q_str)
# # cond_split = re.split('(\W)', q_str)
# # print(cond_split)
# colname = 'table1.A'
# colname = colname.split(".")
# print(colname)
# sql = '1 == 1 and 2 == 2'
# if eval(sql):
# print("hurray")
# else:
# print("fail")
# lis = ['a','b','c']
# stri = 'ppc'
# lis2 = [stri]
# l = lis2 + lis
# print(l)
q = {}
q['ppc'] = 'll'
print(q['ppc'])