-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtry_mparser.py
36 lines (20 loc) · 1.04 KB
/
try_mparser.py
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
from m_parser import informatica_to_mparser
import json
exp1 = "IIF(IsNull(lkp_mail_AgencyAddressID), v_DefaultInt, lkp_mail_AgencyAddressID)"
exp2 = """Decode(true, LicensedIndicator = 'Y', '1', LicensedIndicator = 'N', '0', '1')"""
exp3 = "5 + 4 = 9"
exp4 = "5 + 4 > 9"
exp5 = "(5 + 4 == 9) and x==20"
exp10 = """
DECODE(v_InsertUpdateExpireOrIgnore,
'Insert', TO_DATE('1800-01-01 01:00:00', 'YYYY-MM-DD HH24:MI:SS'),
SYSDATE)
--Decode(v_InsertUpdateExpireOrIgnore, 'Insert', trunc(sysdate, 'DD'), lkp_ExistingEffectiveDate)
"""
exp11 = "DECODE(v_InsertUpdateExpireOrIgnore, 'Insert', TO_DATE('1800-01-01 01:00:00', 'YYYY-MM-DD HH24:MI:SS'), SYSDATE) --Decode(v_InsertUpdateExpireOrIgnore, 'Insert', trunc(sysdate, 'DD'), lkp_ExistingEffectiveDate)"
# parsed_expression = informatica_to_mparser(exp2)
# print(json.dumps(parsed_expression['parsed_exp'], indent=4))
def get_parsed_exp(exp):
return informatica_to_mparser(exp)['parsed_exp']
# print(json.dumps(get_parsed_exp(exp1), indent=4))
print(json.dumps(get_parsed_exp(exp1), indent=4))