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