blob: 3d35c2f07a6fa33ba4ec9c0d9d7a1d28e9ed11d0 [file] [log] [blame]
# Simple query to introduce projection dependencies. Shows resolution
# through inline views, unions, and materialization points.
select * from (
select tinyint_col + int_col x from functional.alltypes
union all
select sum(bigint_col) y from (select bigint_col from functional.alltypes) v1) v2
---- LINEAGE
{
"queryText":"select * from (\n select tinyint_col + int_col x from functional.alltypes\n union all\n select sum(bigint_col) y from (select bigint_col from functional.alltypes) v1) v2",
"queryId":"0:0",
"hash":"25456c60a2e874a20732f42c7af27553",
"user":"dummy_user",
"timestamp":1547867921,
"edges":[
{
"sources":[
1,
2,
3
],
"targets":[
0
],
"edgeType":"PROJECTION"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"x"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.bigint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.int_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.tinyint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
}
]
}
====
# Simple query to introduce predicate dependencies. Shows conjuncts in WHERE, ON, and
# HAVING clause, as well dependencies introduced by GROUP BY and ORDER BY clauses and
# analytic functions.
select sum(a.tinyint_col) over (partition by a.smallint_col order by a.id),
count(b.string_col), b.timestamp_col
from functional.alltypes a join functional.alltypessmall b on (a.id = b.id)
where a.year = 2010 and b.float_col > 0
group by a.tinyint_col, a.smallint_col, a.id, b.string_col, b.timestamp_col, b.bigint_col
having count(a.int_col) > 10
order by b.bigint_col limit 10
---- LINEAGE
{
"queryText":"select sum(a.tinyint_col) over (partition by a.smallint_col order by a.id),\n count(b.string_col), b.timestamp_col\nfrom functional.alltypes a join functional.alltypessmall b on (a.id = b.id)\nwhere a.year = 2010 and b.float_col > 0\ngroup by a.tinyint_col, a.smallint_col, a.id, b.string_col, b.timestamp_col, b.bigint_col\nhaving count(a.int_col) > 10\norder by b.bigint_col limit 10",
"queryId":"0:0",
"hash":"e0309eeff9811f53c82657d62c1e04eb",
"user":"dummy_user",
"timestamp":1547867921,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
2,
3
],
"targets":[
0
],
"edgeType":"PREDICATE"
},
{
"sources":[
5
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
7
],
"targets":[
6
],
"edgeType":"PROJECTION"
},
{
"sources":[
1,
2,
3,
5,
7,
8,
9,
10,
11,
12
],
"targets":[
0,
4,
6
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"sum(a.tinyint_col) OVER(...)"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.tinyint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.id",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.smallint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"count(b.string_col)"
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.string_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"timestamp_col"
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.timestamp_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":8,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.int_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":9,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.year",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":10,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.bigint_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":11,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.float_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":12,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.id",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
}
]
}
====
# CTAS queries
create table lineage_test_tbl as select int_col, tinyint_col from functional.alltypes
---- LINEAGE
{
"queryText":"create table lineage_test_tbl as select int_col, tinyint_col from functional.alltypes",
"queryId":"0:0",
"hash":"407f23b24758ffcb2ac445b9703f5c44",
"user":"dummy_user",
"timestamp":1547867921,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"int_col",
"metadata":{
"tableName":"default.lineage_test_tbl",
"tableCreateTime":-1
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.int_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"tinyint_col",
"metadata":{
"tableName":"default.lineage_test_tbl",
"tableCreateTime":-1
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.tinyint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
}
]
}
====
create table lineage_test_tbl as
select distinct a.int_col, a.string_col from functional.alltypes a
inner join functional.alltypessmall b on (a.id = b.id)
where a.year = 2009 and b.month = 2
---- LINEAGE
{
"queryText":"create table lineage_test_tbl as\nselect distinct a.int_col, a.string_col from functional.alltypes a\ninner join functional.alltypessmall b on (a.id = b.id)\nwhere a.year = 2009 and b.month = 2",
"queryId":"0:0",
"hash":"f3101dcb046a7d34d7ee14892a6cc94e",
"user":"dummy_user",
"timestamp":1547867921,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
4,
5,
6,
7
],
"targets":[
0,
2
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"int_col",
"metadata":{
"tableName":"default.lineage_test_tbl",
"tableCreateTime":-1
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.int_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"string_col",
"metadata":{
"tableName":"default.lineage_test_tbl",
"tableCreateTime":-1
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.string_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.id",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.year",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.id",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.month",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
}
]
}
====
create table lineage_test_tbl as
select * from
(select * from
(select int_col from functional.alltypestiny limit 1) v1 ) v2
---- LINEAGE
{
"queryText":"create table lineage_test_tbl as\nselect * from\n (select * from\n (select int_col from functional.alltypestiny limit 1) v1 ) v2",
"queryId":"0:0",
"hash":"9c04c1e9feee35ffacf14bfcd3b363a7",
"user":"dummy_user",
"timestamp":1547867921,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"int_col",
"metadata":{
"tableName":"default.lineage_test_tbl",
"tableCreateTime":-1
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.int_col",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
}
]
}
====
# CTAS from HBase table
create table lineage_test_tblm as select * from functional_hbase.alltypes limit 5
---- LINEAGE
{
"queryText":"create table lineage_test_tblm as select * from functional_hbase.alltypes limit 5",
"queryId":"0:0",
"hash":"a294f36bddf2adb329eac3055a76b2b5",
"user":"dummy_user",
"timestamp":1547867921,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
5
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
7
],
"targets":[
6
],
"edgeType":"PROJECTION"
},
{
"sources":[
9
],
"targets":[
8
],
"edgeType":"PROJECTION"
},
{
"sources":[
11
],
"targets":[
10
],
"edgeType":"PROJECTION"
},
{
"sources":[
13
],
"targets":[
12
],
"edgeType":"PROJECTION"
},
{
"sources":[
15
],
"targets":[
14
],
"edgeType":"PROJECTION"
},
{
"sources":[
17
],
"targets":[
16
],
"edgeType":"PROJECTION"
},
{
"sources":[
19
],
"targets":[
18
],
"edgeType":"PROJECTION"
},
{
"sources":[
21
],
"targets":[
20
],
"edgeType":"PROJECTION"
},
{
"sources":[
23
],
"targets":[
22
],
"edgeType":"PROJECTION"
},
{
"sources":[
25
],
"targets":[
24
],
"edgeType":"PROJECTION"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"id",
"metadata":{
"tableName":"default.lineage_test_tblm",
"tableCreateTime":-1
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypes.id",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"bigint_col",
"metadata":{
"tableName":"default.lineage_test_tblm",
"tableCreateTime":-1
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypes.bigint_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"bool_col",
"metadata":{
"tableName":"default.lineage_test_tblm",
"tableCreateTime":-1
}
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypes.bool_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"date_string_col",
"metadata":{
"tableName":"default.lineage_test_tblm",
"tableCreateTime":-1
}
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypes.date_string_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":8,
"vertexType":"COLUMN",
"vertexId":"double_col",
"metadata":{
"tableName":"default.lineage_test_tblm",
"tableCreateTime":-1
}
},
{
"id":9,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypes.double_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":10,
"vertexType":"COLUMN",
"vertexId":"float_col",
"metadata":{
"tableName":"default.lineage_test_tblm",
"tableCreateTime":-1
}
},
{
"id":11,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypes.float_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":12,
"vertexType":"COLUMN",
"vertexId":"int_col",
"metadata":{
"tableName":"default.lineage_test_tblm",
"tableCreateTime":-1
}
},
{
"id":13,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypes.int_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":14,
"vertexType":"COLUMN",
"vertexId":"month",
"metadata":{
"tableName":"default.lineage_test_tblm",
"tableCreateTime":-1
}
},
{
"id":15,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypes.month",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":16,
"vertexType":"COLUMN",
"vertexId":"smallint_col",
"metadata":{
"tableName":"default.lineage_test_tblm",
"tableCreateTime":-1
}
},
{
"id":17,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypes.smallint_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":18,
"vertexType":"COLUMN",
"vertexId":"string_col",
"metadata":{
"tableName":"default.lineage_test_tblm",
"tableCreateTime":-1
}
},
{
"id":19,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypes.string_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":20,
"vertexType":"COLUMN",
"vertexId":"timestamp_col",
"metadata":{
"tableName":"default.lineage_test_tblm",
"tableCreateTime":-1
}
},
{
"id":21,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypes.timestamp_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":22,
"vertexType":"COLUMN",
"vertexId":"tinyint_col",
"metadata":{
"tableName":"default.lineage_test_tblm",
"tableCreateTime":-1
}
},
{
"id":23,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypes.tinyint_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":24,
"vertexType":"COLUMN",
"vertexId":"year",
"metadata":{
"tableName":"default.lineage_test_tblm",
"tableCreateTime":-1
}
},
{
"id":25,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypes.year",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
}
]
}
====
# Insert into an HBase table
insert into
functional_hbase.alltypes
values (1, 1, true, "1999-12-01", 2.0, 1.0, 1, 12, 2, "abs",
cast(now() as timestamp), 1, 1999)
---- LINEAGE
{
"queryText":"insert into\nfunctional_hbase.alltypes\n values (1, 1, true, \"1999-12-01\", 2.0, 1.0, 1, 12, 2, \"abs\",\n cast(now() as timestamp), 1, 1999)",
"queryId":"0:0",
"hash":"b923425ce9cc2d53d36523ec83971e67",
"user":"dummy_user",
"timestamp":1547867921,
"edges":[
{
"sources":[
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
1
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
3
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
5
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
6
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
7
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
8
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
9
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
10
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
11
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
12
],
"edgeType":"PROJECTION"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"id",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"bigint_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"bool_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"date_string_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"double_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"float_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"int_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"month",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":8,
"vertexType":"COLUMN",
"vertexId":"smallint_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":9,
"vertexType":"COLUMN",
"vertexId":"string_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":10,
"vertexType":"COLUMN",
"vertexId":"timestamp_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":11,
"vertexType":"COLUMN",
"vertexId":"tinyint_col",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
},
{
"id":12,
"vertexType":"COLUMN",
"vertexId":"year",
"metadata":{
"tableName":"functional_hbase.alltypes",
"tableCreateTime":1559151687
}
}
]
}
====
insert into table functional.alltypesnopart (id, bool_col, timestamp_col)
select id, bool_col, timestamp_col
from functional.alltypes
---- LINEAGE
{
"queryText":"insert into table functional.alltypesnopart (id, bool_col, timestamp_col)\nselect id, bool_col, timestamp_col\nfrom functional.alltypes",
"queryId":"0:0",
"hash":"b7b9474fc6b97f104bd031209438ee0e",
"user":"dummy_user",
"timestamp":1547867921,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
5
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
6
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
7
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
8
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
9
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
10
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
11
],
"edgeType":"PROJECTION"
},
{
"sources":[
13
],
"targets":[
12
],
"edgeType":"PROJECTION"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"id",
"metadata":{
"tableName":"functional.alltypesnopart",
"tableCreateTime":1559151324
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.id",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"bool_col",
"metadata":{
"tableName":"functional.alltypesnopart",
"tableCreateTime":1559151324
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.bool_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"tinyint_col",
"metadata":{
"tableName":"functional.alltypesnopart",
"tableCreateTime":1559151324
}
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"smallint_col",
"metadata":{
"tableName":"functional.alltypesnopart",
"tableCreateTime":1559151324
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"int_col",
"metadata":{
"tableName":"functional.alltypesnopart",
"tableCreateTime":1559151324
}
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"bigint_col",
"metadata":{
"tableName":"functional.alltypesnopart",
"tableCreateTime":1559151324
}
},
{
"id":8,
"vertexType":"COLUMN",
"vertexId":"float_col",
"metadata":{
"tableName":"functional.alltypesnopart",
"tableCreateTime":1559151324
}
},
{
"id":9,
"vertexType":"COLUMN",
"vertexId":"double_col",
"metadata":{
"tableName":"functional.alltypesnopart",
"tableCreateTime":1559151324
}
},
{
"id":10,
"vertexType":"COLUMN",
"vertexId":"date_string_col",
"metadata":{
"tableName":"functional.alltypesnopart",
"tableCreateTime":1559151324
}
},
{
"id":11,
"vertexType":"COLUMN",
"vertexId":"string_col",
"metadata":{
"tableName":"functional.alltypesnopart",
"tableCreateTime":1559151324
}
},
{
"id":12,
"vertexType":"COLUMN",
"vertexId":"timestamp_col",
"metadata":{
"tableName":"functional.alltypesnopart",
"tableCreateTime":1559151324
}
},
{
"id":13,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.timestamp_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
}
]
}
====
insert into table functional.alltypessmall (smallint_col, int_col)
partition (year=2009, month=04)
select smallint_col, int_col
from functional.alltypes
where year=2009 and month=05
---- LINEAGE
{
"queryText":"insert into table functional.alltypessmall (smallint_col, int_col)\npartition (year=2009, month=04)\nselect smallint_col, int_col\nfrom functional.alltypes\nwhere year=2009 and month=05",
"queryId":"0:0",
"hash":"2ed3a6c784e1c0c7fcef226d71375180",
"user":"dummy_user",
"timestamp":1547867921,
"edges":[
{
"sources":[
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
1
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
3
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
6
],
"targets":[
5
],
"edgeType":"PROJECTION"
},
{
"sources":[
8
],
"targets":[
7
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
9
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
10
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
11
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
12
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
13
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
14
],
"edgeType":"PROJECTION"
},
{
"sources":[
15,
16
],
"targets":[
0,
1,
2,
3,
4,
5,
7,
9,
10,
11,
12,
13,
14
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"year",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"month",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"id",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"bool_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"tinyint_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"smallint_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.smallint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"int_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":8,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.int_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":9,
"vertexType":"COLUMN",
"vertexId":"bigint_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":10,
"vertexType":"COLUMN",
"vertexId":"float_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":11,
"vertexType":"COLUMN",
"vertexId":"double_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":12,
"vertexType":"COLUMN",
"vertexId":"date_string_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":13,
"vertexType":"COLUMN",
"vertexId":"string_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":14,
"vertexType":"COLUMN",
"vertexId":"timestamp_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":15,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.month",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":16,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.year",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
}
]
}
====
insert into table functional.alltypessmall (id, string_col, int_col)
partition (year, month)
select id, string_col, int_col, year, month
from functional_seq_snap.alltypes
where year=2009 and month>10
---- LINEAGE
{
"queryText":"insert into table functional.alltypessmall (id, string_col, int_col)\npartition (year, month)\nselect id, string_col, int_col, year, month\nfrom functional_seq_snap.alltypes\nwhere year=2009 and month>10",
"queryId":"0:0",
"hash":"39ac95ce0632ef1ee8b474be644971f3",
"user":"dummy_user",
"timestamp":1547867921,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
5
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
6
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
7
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
8
],
"edgeType":"PROJECTION"
},
{
"sources":[
10
],
"targets":[
9
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
11
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
12
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
13
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
14
],
"edgeType":"PROJECTION"
},
{
"sources":[
16
],
"targets":[
15
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
17
],
"edgeType":"PROJECTION"
},
{
"sources":[
1,
3
],
"targets":[
0,
2,
4,
6,
7,
8,
9,
11,
12,
13,
14,
15,
17
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"year",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional_seq_snap.alltypes.year",
"metadata":{
"tableName":"functional_seq_snap.alltypes",
"tableCreateTime":1559151137
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"month",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional_seq_snap.alltypes.month",
"metadata":{
"tableName":"functional_seq_snap.alltypes",
"tableCreateTime":1559151137
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"id",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional_seq_snap.alltypes.id",
"metadata":{
"tableName":"functional_seq_snap.alltypes",
"tableCreateTime":1559151137
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"bool_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"tinyint_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":8,
"vertexType":"COLUMN",
"vertexId":"smallint_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":9,
"vertexType":"COLUMN",
"vertexId":"int_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":10,
"vertexType":"COLUMN",
"vertexId":"functional_seq_snap.alltypes.int_col",
"metadata":{
"tableName":"functional_seq_snap.alltypes",
"tableCreateTime":1559151137
}
},
{
"id":11,
"vertexType":"COLUMN",
"vertexId":"bigint_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":12,
"vertexType":"COLUMN",
"vertexId":"float_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":13,
"vertexType":"COLUMN",
"vertexId":"double_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":14,
"vertexType":"COLUMN",
"vertexId":"date_string_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":15,
"vertexType":"COLUMN",
"vertexId":"string_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":16,
"vertexType":"COLUMN",
"vertexId":"functional_seq_snap.alltypes.string_col",
"metadata":{
"tableName":"functional_seq_snap.alltypes",
"tableCreateTime":1559151137
}
},
{
"id":17,
"vertexType":"COLUMN",
"vertexId":"timestamp_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
}
]
}
====
insert into table functional.alltypessmall
partition (year=2009, month)
select min(id), min(bool_col), min(tinyint_col), min(smallint_col), min(int_col),
min(bigint_col), min(float_col), min(double_col), min(date_string_col), min(string_col),
min(timestamp_col), month
from functional.alltypes
where year=2009 and month>10
group by month
having min(id) > 10
---- LINEAGE
{
"queryText":"insert into table functional.alltypessmall\npartition (year=2009, month)\nselect min(id), min(bool_col), min(tinyint_col), min(smallint_col), min(int_col),\nmin(bigint_col), min(float_col), min(double_col), min(date_string_col), min(string_col),\nmin(timestamp_col), month\nfrom functional.alltypes\nwhere year=2009 and month>10\ngroup by month\nhaving min(id) > 10",
"queryId":"0:0",
"hash":"e6969c2cc67e9d6f3f985ddc6431f915",
"user":"dummy_user",
"timestamp":1547867921,
"edges":[
{
"sources":[
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
2
],
"targets":[
1
],
"edgeType":"PROJECTION"
},
{
"sources":[
4
],
"targets":[
3
],
"edgeType":"PROJECTION"
},
{
"sources":[
6
],
"targets":[
5
],
"edgeType":"PROJECTION"
},
{
"sources":[
8
],
"targets":[
7
],
"edgeType":"PROJECTION"
},
{
"sources":[
10
],
"targets":[
9
],
"edgeType":"PROJECTION"
},
{
"sources":[
12
],
"targets":[
11
],
"edgeType":"PROJECTION"
},
{
"sources":[
14
],
"targets":[
13
],
"edgeType":"PROJECTION"
},
{
"sources":[
16
],
"targets":[
15
],
"edgeType":"PROJECTION"
},
{
"sources":[
18
],
"targets":[
17
],
"edgeType":"PROJECTION"
},
{
"sources":[
20
],
"targets":[
19
],
"edgeType":"PROJECTION"
},
{
"sources":[
22
],
"targets":[
21
],
"edgeType":"PROJECTION"
},
{
"sources":[
24
],
"targets":[
23
],
"edgeType":"PROJECTION"
},
{
"sources":[
2,
4,
25
],
"targets":[
0,
1,
3,
5,
7,
9,
11,
13,
15,
17,
19,
21,
23
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"year",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"month",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.month",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"id",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.id",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"bool_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.bool_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"tinyint_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":8,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.tinyint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":9,
"vertexType":"COLUMN",
"vertexId":"smallint_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":10,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.smallint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":11,
"vertexType":"COLUMN",
"vertexId":"int_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":12,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.int_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":13,
"vertexType":"COLUMN",
"vertexId":"bigint_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":14,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.bigint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":15,
"vertexType":"COLUMN",
"vertexId":"float_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":16,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.float_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":17,
"vertexType":"COLUMN",
"vertexId":"double_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":18,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.double_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":19,
"vertexType":"COLUMN",
"vertexId":"date_string_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":20,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.date_string_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":21,
"vertexType":"COLUMN",
"vertexId":"string_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":22,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.string_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":23,
"vertexType":"COLUMN",
"vertexId":"timestamp_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":24,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.timestamp_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":25,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.year",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
}
]
}
====
# Select statements with analytic functions
select
max(tinyint_col) over(partition by int_col)
from functional.alltypes
group by int_col, tinyint_col
---- LINEAGE
{
"queryText":"select\nmax(tinyint_col) over(partition by int_col)\nfrom functional.alltypes\ngroup by int_col, tinyint_col",
"queryId":"0:0",
"hash":"83c78528e6f5325c56a3f3521b08a78d",
"user":"dummy_user",
"timestamp":1547867921,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
2
],
"targets":[
0
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"max(tinyint_col) OVER(...)"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.tinyint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.int_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
}
]
}
====
select int_col, rank() over(order by int_col) from functional.alltypesagg
---- LINEAGE
{
"queryText":"select int_col, rank() over(order by int_col) from functional.alltypesagg",
"queryId":"0:0",
"hash":"4f1ecaaed571d2ed9f09f091f399c311",
"user":"dummy_user",
"timestamp":1547867921,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
1
],
"targets":[
2
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"int_col"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypesagg.int_col",
"metadata":{
"tableName":"functional.alltypesagg",
"tableCreateTime":1559151363
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"rank() OVER(...)"
}
]
}
====
select a.tinyint_col, a.int_col, count(a.double_col)
over(partition by a.tinyint_col order by a.int_col desc rows between 1 preceding and 1 following)
from functional.alltypes a inner join functional.alltypessmall b on a.id = b.id
order by a.tinyint_col, a.int_col
---- LINEAGE
{
"queryText":"select a.tinyint_col, a.int_col, count(a.double_col)\n over(partition by a.tinyint_col order by a.int_col desc rows between 1 preceding and 1 following)\nfrom functional.alltypes a inner join functional.alltypessmall b on a.id = b.id\norder by a.tinyint_col, a.int_col",
"queryId":"0:0",
"hash":"b6e26c00b2ef17f0592ebadb0ecc21f6",
"user":"dummy_user",
"timestamp":1547867921,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
5
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
1,
3
],
"targets":[
4
],
"edgeType":"PREDICATE"
},
{
"sources":[
6,
7
],
"targets":[
0,
2,
4
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"tinyint_col"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.tinyint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"int_col"
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.int_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"count(a.double_col) OVER(...)"
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.double_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.id",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.id",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
}
]
}
====
with v2 as
(select
double_col,
count(int_col) over() a,
sum(int_col + bigint_col) over(partition by bool_col) b
from
(select * from functional.alltypes) v1)
select double_col, a, b, a + b, double_col + a from v2
order by 2, 3, 4
---- LINEAGE
{
"queryText":"with v2 as\n (select\n double_col,\n count(int_col) over() a,\n sum(int_col + bigint_col) over(partition by bool_col) b\n from\n (select * from functional.alltypes) v1)\nselect double_col, a, b, a + b, double_col + a from v2\norder by 2, 3, 4",
"queryId":"0:0",
"hash":"6bf993cea0d1ab9e613674ef178916c9",
"user":"dummy_user",
"timestamp":1547867921,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
3,
5
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
6
],
"targets":[
4
],
"edgeType":"PREDICATE"
},
{
"sources":[
3,
5
],
"targets":[
7
],
"edgeType":"PROJECTION"
},
{
"sources":[
6
],
"targets":[
7
],
"edgeType":"PREDICATE"
},
{
"sources":[
1,
3
],
"targets":[
8
],
"edgeType":"PROJECTION"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"double_col"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.double_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"a"
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.int_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"b"
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.bigint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.bool_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"a + b"
},
{
"id":8,
"vertexType":"COLUMN",
"vertexId":"double_col + a"
}
]
}
====
select double_col, a, b, a + b, double_col + a from
(select
double_col,
count(int_col) over() a,
sum(int_col + bigint_col) over(partition by bool_col) b
from
(select * from functional.alltypes) v1) v2
order by 2, 3, 4
---- LINEAGE
{
"queryText":"select double_col, a, b, a + b, double_col + a from\n (select\n double_col,\n count(int_col) over() a,\n sum(int_col + bigint_col) over(partition by bool_col) b\n from\n (select * from functional.alltypes) v1) v2\norder by 2, 3, 4",
"queryId":"0:0",
"hash":"811403c86e86fe630dea7bd0a6c89273",
"user":"dummy_user",
"timestamp":1547867921,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
3,
5
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
6
],
"targets":[
4
],
"edgeType":"PREDICATE"
},
{
"sources":[
3,
5
],
"targets":[
7
],
"edgeType":"PROJECTION"
},
{
"sources":[
6
],
"targets":[
7
],
"edgeType":"PREDICATE"
},
{
"sources":[
1,
3
],
"targets":[
8
],
"edgeType":"PROJECTION"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"double_col"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.double_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"a"
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.int_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"b"
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.bigint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.bool_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"a + b"
},
{
"id":8,
"vertexType":"COLUMN",
"vertexId":"double_col + a"
}
]
}
====
# Union statements
select a.month, a.year, b.int_col, b.month
from
(select year, month from functional.alltypes
union all
select year, month from functional.alltypes) a
inner join
functional.alltypessmall b
on (a.month = b.month)
where b.month = 1
---- LINEAGE
{
"queryText":"select a.month, a.year, b.int_col, b.month\nfrom\n (select year, month from functional.alltypes\n union all\n select year, month from functional.alltypes) a\n inner join\n functional.alltypessmall b\n on (a.month = b.month)\nwhere b.month = 1",
"queryId":"0:0",
"hash":"e3000cd5edf2a02e1f5407810f3cc09a",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
5
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
6
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
1,
6
],
"targets":[
0,
2,
4
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"month"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.month",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"year"
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.year",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"int_col"
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.int_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.month",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
}
]
}
====
# Select statements with inline views
select t1.int_col, t2.month, t2.int_col + 1
from (
select int_col, count(*)
from functional.alltypessmall
where month = 1
group by int_col
having count(*) > 1
order by count(*) desc limit 5
) t1
join functional.alltypes t2 on (t1.int_col = t2.int_col)
where month = 1
---- LINEAGE
{
"queryText":"select t1.int_col, t2.month, t2.int_col + 1\nfrom (\n select int_col, count(*)\n from functional.alltypessmall\n where month = 1\n group by int_col\n having count(*) > 1\n order by count(*) desc limit 5\n ) t1\njoin functional.alltypes t2 on (t1.int_col = t2.int_col)\nwhere month = 1",
"queryId":"0:0",
"hash":"3f1ecf7239e205342aee4979e7cb4877",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
5
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
1,
3,
5,
6
],
"targets":[
0,
2,
4
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"int_col"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.int_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"month"
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.month",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"t2.int_col + 1"
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.int_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.month",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
}
]
}
====
select x.smallint_col, x.id, x.tinyint_col, c.id, x.int_col, x.float_col, c.string_col
from functional.alltypessmall c
join (
select a.smallint_col smallint_col, a.tinyint_col tinyint_col, a.day day,
a.int_col int_col, a.month month, b.float_col float_col, b.id id
from ( select * from functional.alltypesagg a where month=1 ) a
join functional.alltypessmall b on (a.smallint_col = b.id)
) x on (x.tinyint_col = c.id)
where x.day=1
and x.int_col > 899
and x.float_col > 4.5
and c.string_col < '7'
and x.int_col + x.float_col + cast(c.string_col as float) < 1000
---- LINEAGE
{
"queryText":"select x.smallint_col, x.id, x.tinyint_col, c.id, x.int_col, x.float_col, c.string_col\nfrom functional.alltypessmall c\njoin (\n select a.smallint_col smallint_col, a.tinyint_col tinyint_col, a.day day,\n a.int_col int_col, a.month month, b.float_col float_col, b.id id\n from ( select * from functional.alltypesagg a where month=1 ) a\n join functional.alltypessmall b on (a.smallint_col = b.id)\n ) x on (x.tinyint_col = c.id)\nwhere x.day=1\nand x.int_col > 899\nand x.float_col > 4.5\nand c.string_col < '7'\nand x.int_col + x.float_col + cast(c.string_col as float) < 1000",
"queryId":"0:0",
"hash":"4edf165aed5982ede63f7c91074f4b44",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
5
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
7
],
"targets":[
6
],
"edgeType":"PROJECTION"
},
{
"sources":[
9
],
"targets":[
8
],
"edgeType":"PROJECTION"
},
{
"sources":[
11
],
"targets":[
10
],
"edgeType":"PROJECTION"
},
{
"sources":[
1,
3,
5,
7,
9,
11,
12,
13
],
"targets":[
0,
2,
4,
6,
8,
10
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"smallint_col"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypesagg.smallint_col",
"metadata":{
"tableName":"functional.alltypesagg",
"tableCreateTime":1559151363
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"id"
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.id",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"tinyint_col"
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.alltypesagg.tinyint_col",
"metadata":{
"tableName":"functional.alltypesagg",
"tableCreateTime":1559151363
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"int_col"
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"functional.alltypesagg.int_col",
"metadata":{
"tableName":"functional.alltypesagg",
"tableCreateTime":1559151363
}
},
{
"id":8,
"vertexType":"COLUMN",
"vertexId":"float_col"
},
{
"id":9,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.float_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":10,
"vertexType":"COLUMN",
"vertexId":"string_col"
},
{
"id":11,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.string_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":12,
"vertexType":"COLUMN",
"vertexId":"functional.alltypesagg.day",
"metadata":{
"tableName":"functional.alltypesagg",
"tableCreateTime":1559151363
}
},
{
"id":13,
"vertexType":"COLUMN",
"vertexId":"functional.alltypesagg.month",
"metadata":{
"tableName":"functional.alltypesagg",
"tableCreateTime":1559151363
}
}
]
}
====
select c1, c2, c3
from
(select c1, c2, c3
from
(select int_col c1, sum(float_col) c2, min(float_col) c3
from functional_hbase.alltypessmall
group by 1) x
order by 2,3 desc
limit 5
) y
---- LINEAGE
{
"queryText":"select c1, c2, c3\nfrom\n (select c1, c2, c3\n from\n (select int_col c1, sum(float_col) c2, min(float_col) c3\n from functional_hbase.alltypessmall\n group by 1) x\n order by 2,3 desc\n limit 5\n) y",
"queryId":"0:0",
"hash":"8b4d1ab11721d9ebdf26666d4195eb18",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
1,
3
],
"targets":[
0,
2,
4
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"c1"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypessmall.int_col",
"metadata":{
"tableName":"functional_hbase.alltypessmall",
"tableCreateTime":1559151688
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"c2"
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypessmall.float_col",
"metadata":{
"tableName":"functional_hbase.alltypessmall",
"tableCreateTime":1559151688
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"c3"
}
]
}
====
select c1, x2
from (
select c1, min(c2) x2
from (
select c1, c2, c3
from (
select int_col c1, tinyint_col c2, min(float_col) c3
from functional_hbase.alltypessmall
group by 1, 2
order by 1,2
limit 1
) x
) x2
group by c1
) y
order by 2,1 desc
limit 0
---- LINEAGE
{
"queryText":"select c1, x2\nfrom (\n select c1, min(c2) x2\n from (\n select c1, c2, c3\n from (\n select int_col c1, tinyint_col c2, min(float_col) c3\n from functional_hbase.alltypessmall\n group by 1, 2\n order by 1,2\n limit 1\n ) x\n ) x2\n group by c1\n) y\norder by 2,1 desc\nlimit 0",
"queryId":"0:0",
"hash":"50d3b4f249f038b0711ea75c17640fc9",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
1,
3
],
"targets":[
0,
2
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"c1"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypessmall.int_col",
"metadata":{
"tableName":"functional_hbase.alltypessmall",
"tableCreateTime":1559151688
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"x2"
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypessmall.tinyint_col",
"metadata":{
"tableName":"functional_hbase.alltypessmall",
"tableCreateTime":1559151688
}
}
]
}
====
# Views
select int_col, string_col from functional.view_view
---- LINEAGE
{
"queryText":"select int_col, string_col from functional.view_view",
"queryId":"0:0",
"hash":"9073496459077de1332e5017977dedf5",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"int_col"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.int_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"string_col"
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.string_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
}
]
}
====
select t.id from (select id from functional.alltypes_view) t
where t.id < 10
---- LINEAGE
{
"queryText":"select t.id from (select id from functional.alltypes_view) t\nwhere t.id < 10",
"queryId":"0:0",
"hash":"8ba7998033f90e1e358f4fdc7ea4251b",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"id"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.id",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
}
]
}
====
# Subqueries
select string_col, float_col, bool_col
from functional.alltypes
where id in
(select id from functional.alltypesagg)
---- LINEAGE
{
"queryText":"select string_col, float_col, bool_col\nfrom functional.alltypes\nwhere id in\n (select id from functional.alltypesagg)",
"queryId":"0:0",
"hash":"e8ad1371d2a13e1ee9ec45689b62cdc9",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
5
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
6,
7
],
"targets":[
0,
2,
4
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"string_col"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.string_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"float_col"
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.float_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"bool_col"
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.bool_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.id",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"functional.alltypesagg.id",
"metadata":{
"tableName":"functional.alltypesagg",
"tableCreateTime":1559151363
}
}
]
}
====
select 1
from functional.alltypesagg a
where exists
(select id, count(int_col) over (partition by bool_col)
from functional.alltypestiny b
where a.tinyint_col = b.tinyint_col
group by id, int_col, bool_col)
and tinyint_col < 10
---- LINEAGE
{
"queryText":"select 1\nfrom functional.alltypesagg a\nwhere exists\n (select id, count(int_col) over (partition by bool_col)\n from functional.alltypestiny b\n where a.tinyint_col = b.tinyint_col\n group by id, int_col, bool_col)\nand tinyint_col < 10",
"queryId":"0:0",
"hash":"a7500c022d29c583c31b287868a848bf",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
1,
2
],
"targets":[
0
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"1"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypesagg.tinyint_col",
"metadata":{
"tableName":"functional.alltypesagg",
"tableCreateTime":1559151363
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.tinyint_col",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
}
]
}
====
select int_col + 1, tinyint_col - 1
from functional.alltypes a
where a.int_col <
(select max(int_col) from functional.alltypesagg g where g.bool_col = true)
and a.bigint_col > 10
---- LINEAGE
{
"queryText":"select int_col + 1, tinyint_col - 1\nfrom functional.alltypes a\nwhere a.int_col <\n (select max(int_col) from functional.alltypesagg g where g.bool_col = true)\nand a.bigint_col > 10",
"queryId":"0:0",
"hash":"5e6227f323793ea4441e2a3119af2f09",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
1,
4,
5,
6
],
"targets":[
0,
2
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"int_col + 1"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.int_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"tinyint_col - 1"
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.tinyint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.bigint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.alltypesagg.bool_col",
"metadata":{
"tableName":"functional.alltypesagg",
"tableCreateTime":1559151363
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"functional.alltypesagg.int_col",
"metadata":{
"tableName":"functional.alltypesagg",
"tableCreateTime":1559151363
}
}
]
}
====
# With clause
with t as (select int_col x, bigint_col y from functional.alltypes) select x, y from t
---- LINEAGE
{
"queryText":"with t as (select int_col x, bigint_col y from functional.alltypes) select x, y from t",
"queryId":"0:0",
"hash":"a7ab58d90540f28a8dfd69703632ad7a",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"x"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.int_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"y"
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.bigint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
}
]
}
====
with t1 as (select * from functional.alltypestiny)
insert into functional.alltypesinsert (id, int_col, string_col) partition(year, month)
select id, int_col, string_col, year, month from t1
---- LINEAGE
{
"queryText":"with t1 as (select * from functional.alltypestiny)\ninsert into functional.alltypesinsert (id, int_col, string_col) partition(year, month)\nselect id, int_col, string_col, year, month from t1",
"queryId":"0:0",
"hash":"0bc5b3e66cc72387f74893b1f1934946",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
5
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
6
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
7
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
8
],
"edgeType":"PROJECTION"
},
{
"sources":[
10
],
"targets":[
9
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
11
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
12
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
13
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
14
],
"edgeType":"PROJECTION"
},
{
"sources":[
16
],
"targets":[
15
],
"edgeType":"PROJECTION"
},
{
"sources":[
],
"targets":[
17
],
"edgeType":"PROJECTION"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"year",
"metadata":{
"tableName":"functional.alltypesinsert",
"tableCreateTime":1559151331
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.year",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"month",
"metadata":{
"tableName":"functional.alltypesinsert",
"tableCreateTime":1559151331
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.month",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"id",
"metadata":{
"tableName":"functional.alltypesinsert",
"tableCreateTime":1559151331
}
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.id",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"bool_col",
"metadata":{
"tableName":"functional.alltypesinsert",
"tableCreateTime":1559151331
}
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"tinyint_col",
"metadata":{
"tableName":"functional.alltypesinsert",
"tableCreateTime":1559151331
}
},
{
"id":8,
"vertexType":"COLUMN",
"vertexId":"smallint_col",
"metadata":{
"tableName":"functional.alltypesinsert",
"tableCreateTime":1559151331
}
},
{
"id":9,
"vertexType":"COLUMN",
"vertexId":"int_col",
"metadata":{
"tableName":"functional.alltypesinsert",
"tableCreateTime":1559151331
}
},
{
"id":10,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.int_col",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
},
{
"id":11,
"vertexType":"COLUMN",
"vertexId":"bigint_col",
"metadata":{
"tableName":"functional.alltypesinsert",
"tableCreateTime":1559151331
}
},
{
"id":12,
"vertexType":"COLUMN",
"vertexId":"float_col",
"metadata":{
"tableName":"functional.alltypesinsert",
"tableCreateTime":1559151331
}
},
{
"id":13,
"vertexType":"COLUMN",
"vertexId":"double_col",
"metadata":{
"tableName":"functional.alltypesinsert",
"tableCreateTime":1559151331
}
},
{
"id":14,
"vertexType":"COLUMN",
"vertexId":"date_string_col",
"metadata":{
"tableName":"functional.alltypesinsert",
"tableCreateTime":1559151331
}
},
{
"id":15,
"vertexType":"COLUMN",
"vertexId":"string_col",
"metadata":{
"tableName":"functional.alltypesinsert",
"tableCreateTime":1559151331
}
},
{
"id":16,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.string_col",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
},
{
"id":17,
"vertexType":"COLUMN",
"vertexId":"timestamp_col",
"metadata":{
"tableName":"functional.alltypesinsert",
"tableCreateTime":1559151331
}
}
]
}
====
# Nested analytic functions
select lead(a) over (partition by b order by c)
from
(select lead(id) over (partition by int_col order by bigint_col) as a,
max(id) over (partition by tinyint_col order by int_col) as b,
min(int_col) over (partition by string_col order by bool_col) as c
from functional.alltypes) v
---- LINEAGE
{
"queryText":"select lead(a) over (partition by b order by c)\nfrom\n (select lead(id) over (partition by int_col order by bigint_col) as a,\n max(id) over (partition by tinyint_col order by int_col) as b,\n min(int_col) over (partition by string_col order by bool_col) as c\n from functional.alltypes) v",
"queryId":"0:0",
"hash":"aa95e5e6f39fc80bb3c318a2515dc77d",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
1,
2,
3,
4,
5,
6
],
"targets":[
0
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"lead(a, 1, NULL) OVER(...)"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.id",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.bigint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.bool_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.int_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.string_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.tinyint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
}
]
}
====
# Create view statement (IMPALA-4219)
create view test_view_lineage as select id from functional.alltypestiny
---- LINEAGE
{
"queryText":"create view test_view_lineage as select id from functional.alltypestiny",
"queryId":"0:0",
"hash":"ff6b1ecb265afe4f03355a07238cfe37",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"id",
"metadata":{
"tableName":"default.test_view_lineage",
"tableCreateTime":-1
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.id",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
}
]
}
====
# Create view with nested inline views (IMPALA-4219)
create view test_view_lineage (a, b) as select c1, x2
from (
select c1, min(c2) x2
from (
select c1, c2, c3
from (
select int_col c1, tinyint_col c2, min(float_col) c3
from functional_hbase.alltypessmall
group by 1, 2
order by 1,2
limit 1
) x
) x2
group by c1
) y
order by 2,1 desc
limit 0
---- LINEAGE
{
"queryText":"create view test_view_lineage (a, b) as select c1, x2\nfrom (\n select c1, min(c2) x2\n from (\n select c1, c2, c3\n from (\n select int_col c1, tinyint_col c2, min(float_col) c3\n from functional_hbase.alltypessmall\n group by 1, 2\n order by 1,2\n limit 1\n ) x\n ) x2\n group by c1\n) y\norder by 2,1 desc\nlimit 0",
"queryId":"0:0",
"hash":"b96adf892b897da1e562c5be98724fb5",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
1,
3
],
"targets":[
0,
2
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"a",
"metadata":{
"tableName":"default.test_view_lineage",
"tableCreateTime":-1
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypessmall.int_col",
"metadata":{
"tableName":"functional_hbase.alltypessmall",
"tableCreateTime":1559151688
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"b",
"metadata":{
"tableName":"default.test_view_lineage",
"tableCreateTime":-1
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional_hbase.alltypessmall.tinyint_col",
"metadata":{
"tableName":"functional_hbase.alltypessmall",
"tableCreateTime":1559151688
}
}
]
}
====
# Create view with complex select statement (IMPALA-4219)
create view test_view_lineage (a1, a2, a3, a4, a5, a6, a7) as
select x.smallint_col, x.id, x.tinyint_col, c.id, x.int_col, x.float_col, c.string_col
from functional.alltypessmall c
join (
select a.smallint_col smallint_col, a.tinyint_col tinyint_col, a.day day,
a.int_col int_col, a.month month, b.float_col float_col, b.id id
from ( select * from functional.alltypesagg a where month=1 ) a
join functional.alltypessmall b on (a.smallint_col = b.id)
) x on (x.tinyint_col = c.id)
where x.day=1
and x.int_col > 899
and x.float_col > 4.5
and c.string_col < '7'
and x.int_col + x.float_col + cast(c.string_col as float) < 1000
---- LINEAGE
{
"queryText":"create view test_view_lineage (a1, a2, a3, a4, a5, a6, a7) as\n select x.smallint_col, x.id, x.tinyint_col, c.id, x.int_col, x.float_col, c.string_col\n from functional.alltypessmall c\n join (\n select a.smallint_col smallint_col, a.tinyint_col tinyint_col, a.day day,\n a.int_col int_col, a.month month, b.float_col float_col, b.id id\n from ( select * from functional.alltypesagg a where month=1 ) a\n join functional.alltypessmall b on (a.smallint_col = b.id)\n ) x on (x.tinyint_col = c.id)\n where x.day=1\n and x.int_col > 899\n and x.float_col > 4.5\n and c.string_col < '7'\n and x.int_col + x.float_col + cast(c.string_col as float) < 1000",
"queryId":"0:0",
"hash":"ffbe643df8f26e92907fb45de1aeda36",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
5
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
6
],
"edgeType":"PROJECTION"
},
{
"sources":[
8
],
"targets":[
7
],
"edgeType":"PROJECTION"
},
{
"sources":[
10
],
"targets":[
9
],
"edgeType":"PROJECTION"
},
{
"sources":[
12
],
"targets":[
11
],
"edgeType":"PROJECTION"
},
{
"sources":[
1,
3,
5,
8,
10,
12,
13,
14
],
"targets":[
0,
2,
4,
6,
7,
9,
11
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"a1",
"metadata":{
"tableName":"default.test_view_lineage",
"tableCreateTime":-1
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypesagg.smallint_col",
"metadata":{
"tableName":"functional.alltypesagg",
"tableCreateTime":1559151363
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"a2",
"metadata":{
"tableName":"default.test_view_lineage",
"tableCreateTime":-1
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.id",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"a3",
"metadata":{
"tableName":"default.test_view_lineage",
"tableCreateTime":-1
}
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.alltypesagg.tinyint_col",
"metadata":{
"tableName":"functional.alltypesagg",
"tableCreateTime":1559151363
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"a4",
"metadata":{
"tableName":"default.test_view_lineage",
"tableCreateTime":-1
}
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"a5",
"metadata":{
"tableName":"default.test_view_lineage",
"tableCreateTime":-1
}
},
{
"id":8,
"vertexType":"COLUMN",
"vertexId":"functional.alltypesagg.int_col",
"metadata":{
"tableName":"functional.alltypesagg",
"tableCreateTime":1559151363
}
},
{
"id":9,
"vertexType":"COLUMN",
"vertexId":"a6",
"metadata":{
"tableName":"default.test_view_lineage",
"tableCreateTime":-1
}
},
{
"id":10,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.float_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":11,
"vertexType":"COLUMN",
"vertexId":"a7",
"metadata":{
"tableName":"default.test_view_lineage",
"tableCreateTime":-1
}
},
{
"id":12,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.string_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":13,
"vertexType":"COLUMN",
"vertexId":"functional.alltypesagg.day",
"metadata":{
"tableName":"functional.alltypesagg",
"tableCreateTime":1559151363
}
},
{
"id":14,
"vertexType":"COLUMN",
"vertexId":"functional.alltypesagg.month",
"metadata":{
"tableName":"functional.alltypesagg",
"tableCreateTime":1559151363
}
}
]
}
====
# Create view with select statement containing an analytic function (IMPALA-4219)
create view test_view_lineage as
select * from (
select sum(a.tinyint_col) over (partition by a.smallint_col order by a.id),
count(b.string_col), b.timestamp_col
from functional.alltypes a join functional.alltypessmall b on (a.id = b.id)
where a.year = 2010 and b.float_col > 0
group by a.tinyint_col, a.smallint_col, a.id, b.string_col, b.timestamp_col, b.bigint_col
having count(a.int_col) > 10
order by b.bigint_col limit 10) t
---- LINEAGE
{
"queryText":"create view test_view_lineage as\n select * from (\n select sum(a.tinyint_col) over (partition by a.smallint_col order by a.id),\n count(b.string_col), b.timestamp_col\n from functional.alltypes a join functional.alltypessmall b on (a.id = b.id)\n where a.year = 2010 and b.float_col > 0\n group by a.tinyint_col, a.smallint_col, a.id, b.string_col, b.timestamp_col, b.bigint_col\n having count(a.int_col) > 10\n order by b.bigint_col limit 10) t",
"queryId":"0:0",
"hash":"d4b9e2d63548088f911816b2ae29d7c2",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
2,
3
],
"targets":[
0
],
"edgeType":"PREDICATE"
},
{
"sources":[
5
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
7
],
"targets":[
6
],
"edgeType":"PROJECTION"
},
{
"sources":[
1,
2,
3,
5,
7,
8,
9,
10,
11,
12
],
"targets":[
0,
4,
6
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"_c0",
"metadata":{
"tableName":"default.test_view_lineage",
"tableCreateTime":-1
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.tinyint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.id",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.smallint_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"_c1",
"metadata":{
"tableName":"default.test_view_lineage",
"tableCreateTime":-1
}
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.string_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"timestamp_col",
"metadata":{
"tableName":"default.test_view_lineage",
"tableCreateTime":-1
}
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.timestamp_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":8,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.int_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":9,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.year",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":10,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.bigint_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":11,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.float_col",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
},
{
"id":12,
"vertexType":"COLUMN",
"vertexId":"functional.alltypessmall.id",
"metadata":{
"tableName":"functional.alltypessmall",
"tableCreateTime":1559151325
}
}
]
}
====
# Alter view statement (IMPALA-4219)
alter view functional.alltypes_view as select id from functional.alltypestiny
---- LINEAGE
{
"queryText":"alter view functional.alltypes_view as select id from functional.alltypestiny",
"queryId":"0:0",
"hash":"8c9367afc562a4c04d2d40e1276646c2",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"id",
"metadata":{
"tableName":"functional.alltypes_view",
"tableCreateTime":1559151386
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.id",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
}
]
}
====
# Test references to struct fields.
select * from (
select int_struct_col.f1 + int_struct_col.f2 x from functional.allcomplextypes
where year = 2000
order by nested_struct_col.f2.f12.f21 limit 10
union all
select sum(f1) y from
(select complex_struct_col.f1 f1 from functional.allcomplextypes
group by 1) v1) v2
---- LINEAGE
{
"queryText":"select * from (\n select int_struct_col.f1 + int_struct_col.f2 x from functional.allcomplextypes\n where year = 2000\n order by nested_struct_col.f2.f12.f21 limit 10\n union all\n select sum(f1) y from\n (select complex_struct_col.f1 f1 from functional.allcomplextypes\n group by 1) v1) v2",
"queryId":"0:0",
"hash":"4fb3ceddbf596097335af607d528f5a7",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1,
2,
3
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
4,
5
],
"targets":[
0
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"x"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.complex_struct_col.f1",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.int_struct_col.f1",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.int_struct_col.f2",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.nested_struct_col.f2.f12.f21",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.year",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
}
]
}
====
# Test absolute collection table refs. Ensure that the vertex ids of sources are
# always an absolute explicit path.
select * from functional.allcomplextypes.int_array_col a inner join
functional.allcomplextypes.struct_map_col m on (a.item = m.f1)
---- LINEAGE
{
"queryText":"select * from functional.allcomplextypes.int_array_col a inner join\n functional.allcomplextypes.struct_map_col m on (a.item = m.f1)",
"queryId":"0:0",
"hash":"8c0c64f8a4c08b82ad343ab439101957",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
5
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
7
],
"targets":[
6
],
"edgeType":"PROJECTION"
},
{
"sources":[
1,
5
],
"targets":[
0,
2,
4,
6
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"item"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.int_array_col.item",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"key"
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.struct_map_col.key",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"f1"
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.struct_map_col.value.f1",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"f2"
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.struct_map_col.value.f2",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
}
]
}
====
# Test relative collection table refs. Ensure that the vertex ids of sources are
# always an absolute explicit path.
select * from functional.allcomplextypes t, t.int_array_col a, t.struct_map_col m
where a.item = m.f1
---- LINEAGE
{
"queryText":"select * from functional.allcomplextypes t, t.int_array_col a, t.struct_map_col m\n where a.item = m.f1",
"queryId":"0:0",
"hash":"1b0db371b32e90d33629ed7779332cf7",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
5
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
7
],
"targets":[
6
],
"edgeType":"PROJECTION"
},
{
"sources":[
9
],
"targets":[
8
],
"edgeType":"PROJECTION"
},
{
"sources":[
11
],
"targets":[
10
],
"edgeType":"PROJECTION"
},
{
"sources":[
13
],
"targets":[
12
],
"edgeType":"PROJECTION"
},
{
"sources":[
7,
11,
14,
15
],
"targets":[
0,
2,
4,
6,
8,
10,
12
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"id"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.id",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"year"
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.year",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"month"
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.month",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"item"
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.int_array_col.item",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":8,
"vertexType":"COLUMN",
"vertexId":"key"
},
{
"id":9,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.struct_map_col.key",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":10,
"vertexType":"COLUMN",
"vertexId":"f1"
},
{
"id":11,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.struct_map_col.value.f1",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":12,
"vertexType":"COLUMN",
"vertexId":"f2"
},
{
"id":13,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.struct_map_col.value.f2",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":14,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.int_array_col",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":15,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.struct_map_col",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
}
]
}
====
# Test relative collection table refs in inline views.
select a + b as ab, c, d, e from functional.allcomplextypes t,
(select sum(item) a from t.int_array_col
where item < 10) v1,
(select count(f1) b from t.struct_map_col
group by key) v2,
(select avg(value) over(partition by key) c from t.map_map_col.value) v3,
(select item d from t.int_array_col
union all
select value from t.int_map_col) v4,
(select f21 e from t.complex_nested_struct_col.f2.f12 order by key limit 10) v5
---- LINEAGE
{
"queryText":"select a + b as ab, c, d, e from functional.allcomplextypes t,\n (select sum(item) a from t.int_array_col\n where item < 10) v1,\n (select count(f1) b from t.struct_map_col\n group by key) v2,\n (select avg(value) over(partition by key) c from t.map_map_col.value) v3,\n (select item d from t.int_array_col\n union all\n select value from t.int_map_col) v4,\n (select f21 e from t.complex_nested_struct_col.f2.f12 order by key limit 10) v5",
"queryId":"0:0",
"hash":"4affc0d1e384475d1ff2fc2e19643064",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1,
2
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
4
],
"targets":[
3
],
"edgeType":"PROJECTION"
},
{
"sources":[
5
],
"targets":[
3
],
"edgeType":"PREDICATE"
},
{
"sources":[
1,
7
],
"targets":[
6
],
"edgeType":"PROJECTION"
},
{
"sources":[
9
],
"targets":[
8
],
"edgeType":"PROJECTION"
},
{
"sources":[
1,
10,
11
],
"targets":[
0,
3,
6,
8
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"ab"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.int_array_col.item",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.struct_map_col.value.f1",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"c"
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.map_map_col.value.value",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.map_map_col.value.key",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"d"
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.int_map_col.value",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":8,
"vertexType":"COLUMN",
"vertexId":"e"
},
{
"id":9,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.complex_nested_struct_col.f2.item.f12.value.f21",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":10,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.complex_nested_struct_col.f2.item.f12.key",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
},
{
"id":11,
"vertexType":"COLUMN",
"vertexId":"functional.allcomplextypes.struct_map_col.key",
"metadata":{
"tableName":"functional.allcomplextypes",
"tableCreateTime":1559151373
}
}
]
}
====
# IMPALA-4206: Test creating a view whose definition has a subquery and a view reference.
create view test_view_lineage as
select id from functional.alltypes_view v
where not exists (select 1 from functional.alltypes a where v.id = a.id)
---- LINEAGE
{
"queryText":"create view test_view_lineage as\nselect id from functional.alltypes_view v\nwhere not exists (select 1 from functional.alltypes a where v.id = a.id)",
"queryId":"0:0",
"hash":"e79b8abc8a682d9e0f6b2c30a6c885f3",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"id",
"metadata":{
"tableName":"default.test_view_lineage",
"tableCreateTime":-1
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.id",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
}
]
}
====
# Select query that accesses a Kudu table
select count(*) from functional_kudu.alltypes k join functional.alltypes h on k.id = h.id
where k.int_col < 10
---- LINEAGE
{
"queryText":"select count(*) from functional_kudu.alltypes k join functional.alltypes h on k.id = h.id\nwhere k.int_col < 10",
"queryId":"0:0",
"hash":"7b7c92d488186d869bb6b78c97666f41",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
1,
2,
3
],
"targets":[
0
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"count(*)"
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.id",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"functional_kudu.alltypes.id",
"metadata":{
"tableName":"functional_kudu.alltypes",
"tableCreateTime":1559150985
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional_kudu.alltypes.int_col",
"metadata":{
"tableName":"functional_kudu.alltypes",
"tableCreateTime":1559150985
}
}
]
}
====
# Insert into a Kudu table
insert into functional_kudu.testtbl select id, string_col as name, int_col as zip from
functional.alltypes a where a.id < 100
---- LINEAGE
{
"queryText":"insert into functional_kudu.testtbl select id, string_col as name, int_col as zip from\nfunctional.alltypes a where a.id < 100",
"queryId":"0:0",
"hash":"87a59bac56c6ad27f7af6e71af46d552",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
5
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
1
],
"targets":[
0,
2,
4
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"id",
"metadata":{
"tableName":"functional_kudu.testtbl",
"tableCreateTime":1559151047
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.id",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"name",
"metadata":{
"tableName":"functional_kudu.testtbl",
"tableCreateTime":1559151047
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.string_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"zip",
"metadata":{
"tableName":"functional_kudu.testtbl",
"tableCreateTime":1559151047
}
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.int_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
}
]
}
====
# Insert into a Kudu table with a column list specified
insert into functional_kudu.testtbl (name, id) select string_col as name, id from
functional.alltypes where id < 10
---- LINEAGE
{
"queryText":"insert into functional_kudu.testtbl (name, id) select string_col as name, id from\nfunctional.alltypes where id < 10",
"queryId":"0:0",
"hash":"0bccfdbf4118e6d5a3d94062ecb5130a",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
1
],
"targets":[
0,
2
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"id",
"metadata":{
"tableName":"functional_kudu.testtbl",
"tableCreateTime":1559151047
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.id",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"name",
"metadata":{
"tableName":"functional_kudu.testtbl",
"tableCreateTime":1559151047
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.string_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
}
]
}
====
# Upsert into a Kudu table with a column list specified
upsert into functional_kudu.testtbl (name, id) select string_col as name, id from
functional.alltypes where id < 10
---- LINEAGE
{
"queryText":"upsert into functional_kudu.testtbl (name, id) select string_col as name, id from\nfunctional.alltypes where id < 10",
"queryId":"0:0",
"hash":"f4c1e7b016e75012f7268f2f42ae5630",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
1
],
"targets":[
0,
2
],
"edgeType":"PREDICATE"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"id",
"metadata":{
"tableName":"functional_kudu.testtbl",
"tableCreateTime":1559151047
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.id",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"name",
"metadata":{
"tableName":"functional_kudu.testtbl",
"tableCreateTime":1559151047
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypes.string_col",
"metadata":{
"tableName":"functional.alltypes",
"tableCreateTime":1559151317
}
}
]
}
====
# CTAS a Kudu table
create table kudu_ctas primary key (id) partition by hash (id) partitions 3
stored as kudu as select id, bool_col, tinyint_col, smallint_col, int_col,
bigint_col, float_col, double_col, date_string_col, string_col
from functional.alltypestiny
---- LINEAGE
{
"queryText":"create table kudu_ctas primary key (id) partition by hash (id) partitions 3\nstored as kudu as select id, bool_col, tinyint_col, smallint_col, int_col,\nbigint_col, float_col, double_col, date_string_col, string_col\nfrom functional.alltypestiny",
"queryId":"0:0",
"hash":"de98b09af6b6ab0f0678c5fc0c4369b4",
"user":"dummy_user",
"timestamp":1547867922,
"edges":[
{
"sources":[
1
],
"targets":[
0
],
"edgeType":"PROJECTION"
},
{
"sources":[
3
],
"targets":[
2
],
"edgeType":"PROJECTION"
},
{
"sources":[
5
],
"targets":[
4
],
"edgeType":"PROJECTION"
},
{
"sources":[
7
],
"targets":[
6
],
"edgeType":"PROJECTION"
},
{
"sources":[
9
],
"targets":[
8
],
"edgeType":"PROJECTION"
},
{
"sources":[
11
],
"targets":[
10
],
"edgeType":"PROJECTION"
},
{
"sources":[
13
],
"targets":[
12
],
"edgeType":"PROJECTION"
},
{
"sources":[
15
],
"targets":[
14
],
"edgeType":"PROJECTION"
},
{
"sources":[
17
],
"targets":[
16
],
"edgeType":"PROJECTION"
},
{
"sources":[
19
],
"targets":[
18
],
"edgeType":"PROJECTION"
}
],
"vertices":[
{
"id":0,
"vertexType":"COLUMN",
"vertexId":"id",
"metadata":{
"tableName":"default.kudu_ctas",
"tableCreateTime":-1
}
},
{
"id":1,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.id",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
},
{
"id":2,
"vertexType":"COLUMN",
"vertexId":"bool_col",
"metadata":{
"tableName":"default.kudu_ctas",
"tableCreateTime":-1
}
},
{
"id":3,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.bool_col",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
},
{
"id":4,
"vertexType":"COLUMN",
"vertexId":"tinyint_col",
"metadata":{
"tableName":"default.kudu_ctas",
"tableCreateTime":-1
}
},
{
"id":5,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.tinyint_col",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
},
{
"id":6,
"vertexType":"COLUMN",
"vertexId":"smallint_col",
"metadata":{
"tableName":"default.kudu_ctas",
"tableCreateTime":-1
}
},
{
"id":7,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.smallint_col",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
},
{
"id":8,
"vertexType":"COLUMN",
"vertexId":"int_col",
"metadata":{
"tableName":"default.kudu_ctas",
"tableCreateTime":-1
}
},
{
"id":9,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.int_col",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
},
{
"id":10,
"vertexType":"COLUMN",
"vertexId":"bigint_col",
"metadata":{
"tableName":"default.kudu_ctas",
"tableCreateTime":-1
}
},
{
"id":11,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.bigint_col",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
},
{
"id":12,
"vertexType":"COLUMN",
"vertexId":"float_col",
"metadata":{
"tableName":"default.kudu_ctas",
"tableCreateTime":-1
}
},
{
"id":13,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.float_col",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
},
{
"id":14,
"vertexType":"COLUMN",
"vertexId":"double_col",
"metadata":{
"tableName":"default.kudu_ctas",
"tableCreateTime":-1
}
},
{
"id":15,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.double_col",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
},
{
"id":16,
"vertexType":"COLUMN",
"vertexId":"date_string_col",
"metadata":{
"tableName":"default.kudu_ctas",
"tableCreateTime":-1
}
},
{
"id":17,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.date_string_col",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
},
{
"id":18,
"vertexType":"COLUMN",
"vertexId":"string_col",
"metadata":{
"tableName":"default.kudu_ctas",
"tableCreateTime":-1
}
},
{
"id":19,
"vertexType":"COLUMN",
"vertexId":"functional.alltypestiny.string_col",
"metadata":{
"tableName":"functional.alltypestiny",
"tableCreateTime":1559151330
}
}
]
}
====