

def format_subqueries(self):
    if (len(self.subqueries) == 0):
        return
    context = self.context
    buf = StringIO()
    buf.write('WITH ')
    for (i, expr) in enumerate(self.subqueries):
        if (i > 0):
            buf.write(',\n')
        formatted = util.indent(context.get_compiled_expr(expr), 2)
        alias = context.get_ref(expr)
        buf.write('{0} AS (\n{1}\n)'.format(alias, formatted))
    return buf.getvalue()

dataset/ETHPy150Open cloudera/ibis/ibis/impala/compiler.py ImpalaSelect.format_subqueries/original