MCPcopy Create free account
hub / github.com/apache/impala / _write_query

Method _write_query

tests/comparison/model_translator.py:107–131  ·  view source on GitHub ↗

Taking in a Query object with some attributes set, return a string representation of the query in the correct dialect. This is just another dispatch destination of self._write(). When self._write(Query) is called, that's dispatched to self._write_query(Query)

(self, query)

Source from the content-addressed store, hash-verified

105 return sql
106
107 def _write_query(self, query):
108 """
109 Taking in a Query object with some attributes set, return a string
110 representation of the query in the correct dialect.
111
112 This is just another dispatch destination of self._write(). When
113 self._write(Query) is called, that's dispatched to self._write_query(Query)
114 """
115 sql = list()
116 # Write out each section in the proper order
117 for clause in (
118 query.with_clause,
119 query.select_clause,
120 query.from_clause,
121 query.where_clause,
122 query.group_by_clause,
123 query.having_clause,
124 query.union_clause,
125 query.order_by_clause,
126 query.limit_clause
127 ):
128 if clause:
129 sql.append(self._write(clause))
130 sql = '\n'.join(sql)
131 return sql
132
133 def _write_insert_statement(self, insert_statement):
134 """

Callers

nothing calls this directly

Calls 3

_writeMethod · 0.95
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected