MCPcopy Create free account
hub / github.com/google-research/language / _parse_function

Function _parse_function

language/xsp/data_preprocessing/sql_parsing.py:132–148  ·  view source on GitHub ↗

Parse the part relative to a Function in the SQL query.

(sql, example, anonymize_values)

Source from the content-addressed store, hash-verified

130
131
132def _parse_function(sql, example, anonymize_values):
133 """Parse the part relative to a Function in the SQL query."""
134 successful_copy = True
135 for item in sql:
136 if _is_parenthesis(item):
137 successful_copy = populate_sql(item, example,
138 anonymize_values) and successful_copy
139 continue
140 if _is_identifier(item) and item.value.lower() in ('count', 'avg', 'min',
141 'max', 'sum',
142 'distinct'):
143 _add_simple_step(item, example)
144 continue
145
146 _debug_state(item, example)
147 raise ParseError('Incomplete _parse_function')
148 return successful_copy
149
150
151def _find_all_entities(token,

Callers 3

_parse_identifier_listFunction · 0.85
_parse_comparisonFunction · 0.85
populate_sqlFunction · 0.85

Calls 6

_is_parenthesisFunction · 0.85
populate_sqlFunction · 0.85
_is_identifierFunction · 0.85
_add_simple_stepFunction · 0.85
_debug_stateFunction · 0.85
ParseErrorClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…