| 743 | |
| 744 | |
| 745 | def get_nestedSQL(sql): |
| 746 | nested = [] |
| 747 | for cond_unit in sql['from']['conds'][::2] + sql['where'][::2] + sql['having'][::2]: |
| 748 | if type(cond_unit[3]) is dict: |
| 749 | nested.append(cond_unit[3]) |
| 750 | if type(cond_unit[4]) is dict: |
| 751 | nested.append(cond_unit[4]) |
| 752 | if sql['intersect'] is not None: |
| 753 | nested.append(sql['intersect']) |
| 754 | if sql['except'] is not None: |
| 755 | nested.append(sql['except']) |
| 756 | if sql['union'] is not None: |
| 757 | nested.append(sql['union']) |
| 758 | return nested |
| 759 | |
| 760 | |
| 761 | def get_keywords(sql): |