INSTALL build.example.com-casters-simple;
INSTALL build.example.com-casters-simple_stats;
MATERIALIZE build.example.com-casters-integers;
MATERIALIZE build.example.com-casters-simple_stats;
SELECT t1.uuid AS t1_uuid, t2.float_a AS t2_float_a, t3.a AS t3_a
FROM build.example.com-casters-simple AS t1
JOIN build.example.com-casters-simple_stats AS t2 ON t1.id = t2.index
JOIN build.example.com-casters-integers AS t3 ON t3_a = t2.index;
CREATE VIEW view1 AS SELECT col1 as c1, col2 as c2 FROM table1 WHERE foo is None and bar is baz;
statements = sqlparse.parse(sqlparse.format(sql, strip_comments=True))
rec_keys = ['statement', 'install', 'materialize', 'tables', 'drop', 'indexes', 'joins']
expected = [
[u'INSTALL p00casters006003', set([u'p00casters006003']), None, None, None, None, None],
[u'INSTALL p00casters002003', set([u'p00casters002003']), None, None, None, None, None],
[u'MATERIALIZE p00casters004003', None, set([u'p00casters004003']), None, None, None, None],
[u'MATERIALIZE p00casters002003', None, set([u'p00casters002003']), None, None, None, None],
[u'SELECT t1.uuid AS t1_uuid, t2.float_a AS t2_float_a, t3.a AS t3_a FROM p00casters006003 AS t1 JOIN p00casters002003 AS t2 ON t1.id = t2.index JOIN p00casters004003 AS t3 ON t3_a = t2.index',
None, set([u'p00casters004003', u'p00casters006003', u'p00casters002003']), None, None,
set([(u'p00casters006003', (u'id',)), (u'p00casters002003', (u'index',))]), None],
[u'CREATE VIEW view1 AS SELECT col1 as c1, col2 as c2 FROM table1 WHERE foo is None and bar is baz',
None, None, None, ['DROP VIEW IF EXISTS view1;'], None, None],
[None, None, None, None, None, None, None]