MCPcopy Create free account
hub / github.com/FlyingFeather/DEA-SQL / parse_group_by

Function parse_group_by

hardness_eval.py:450–470  ·  view source on GitHub ↗
(toks, start_idx, tables_with_alias, schema, default_tables)

Source from the content-addressed store, hash-verified

448
449
450def parse_group_by(toks, start_idx, tables_with_alias, schema, default_tables):
451 idx = start_idx
452 len_ = len(toks)
453 col_units = []
454
455 if idx >= len_ or toks[idx] != 'group':
456 return idx, col_units
457
458 idx += 1
459 assert toks[idx] == 'by'
460 idx += 1
461
462 while idx < len_ and not (toks[idx] in CLAUSE_KEYWORDS or toks[idx] in (")", ";")):
463 idx, col_unit = parse_col_unit(toks, idx, tables_with_alias, schema, default_tables)
464 col_units.append(col_unit)
465 if idx < len_ and toks[idx] == ',':
466 idx += 1 # skip ','
467 else:
468 break
469
470 return idx, col_units
471
472
473def parse_order_by(toks, start_idx, tables_with_alias, schema, default_tables):

Callers 1

parse_sqlFunction · 0.70

Calls 1

parse_col_unitFunction · 0.70

Tested by

no test coverage detected