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

Function parse_group_by

evaluation/test-suite-sql-eval/process_sql.py:421–441  ·  view source on GitHub ↗
(toks, start_idx, tables_with_alias, schema, default_tables)

Source from the content-addressed store, hash-verified

419
420
421def parse_group_by(toks, start_idx, tables_with_alias, schema, default_tables):
422 idx = start_idx
423 len_ = len(toks)
424 col_units = []
425
426 if idx >= len_ or toks[idx] != 'group':
427 return idx, col_units
428
429 idx += 1
430 assert toks[idx] == 'by'
431 idx += 1
432
433 while idx < len_ and not (toks[idx] in CLAUSE_KEYWORDS or toks[idx] in (")", ";")):
434 idx, col_unit = parse_col_unit(toks, idx, tables_with_alias, schema, default_tables)
435 col_units.append(col_unit)
436 if idx < len_ and toks[idx] == ',':
437 idx += 1 # skip ','
438 else:
439 break
440
441 return idx, col_units
442
443
444def 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