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

Function parse_limit

evaluation/test-suite-sql-eval/process_sql.py:483–495  ·  view source on GitHub ↗
(toks, start_idx)

Source from the content-addressed store, hash-verified

481
482
483def parse_limit(toks, start_idx):
484 idx = start_idx
485 len_ = len(toks)
486
487 if idx < len_ and toks[idx] == 'limit':
488 idx += 2
489 # make limit value can work, cannot assume put 1 as a fake limit number
490 if type(toks[idx-1]) != int:
491 return idx, 1
492
493 return idx, int(toks[idx-1])
494
495 return idx, None
496
497
498def parse_sql(toks, start_idx, tables_with_alias, schema):

Callers 1

parse_sqlFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected