| 203 | |
| 204 | |
| 205 | def get_nestedSQL(sql): |
| 206 | nested = [] |
| 207 | for cond_unit in sql['from']['conds'][::2] + sql['where'][::2] + sql['having'][::2]: |
| 208 | if type(cond_unit[3]) is dict: |
| 209 | nested.append(cond_unit[3]) |
| 210 | if type(cond_unit[4]) is dict: |
| 211 | nested.append(cond_unit[4]) |
| 212 | if sql['intersect'] is not None: |
| 213 | nested.append(sql['intersect']) |
| 214 | if sql['except'] is not None: |
| 215 | nested.append(sql['except']) |
| 216 | if sql['union'] is not None: |
| 217 | nested.append(sql['union']) |
| 218 | return nested |
| 219 | |
| 220 | |
| 221 | def eval_nested(pred, label): |