Closed neuecc closed 10 years ago
sample query
select tbl1.repository.url, tbl2.repository_url
from [publicdata:samples.github_nested] as tbl1
join (select * from [publicdata:samples.github_timeline] limit 1000) as tbl2 on tbl1.repository.url = tbl2.repository_url
limit 1
// Pattern1
.From(repositoryA)
.Join(repositoryB, (x, y) => x.repository.url == y.repository_url, (x, y) => new { tbl1 = x, tbl2 = y})
.Limit(1)
.Select(x => new { x.tbl1.repository.url, x.tbl2.repository_url })
// Pattern2 (aliasSelector first!)
.From(repositoryA)
.Join(repositoryB, (tbl1, tbl2) => new { tbl1, tbl2}, x => x.tbl1.repository.url == x.tbl2.repository_url)
.Limit(1)
.Select(x => new { x.tbl1.repository.url, x.tbl2.repository_url })
// Utility?
// JoinUtil.On(bool mergeCondition, TResult aliasSelector)
.Join(repositoryB, (tbl1, tbl2) => JoinUtil.On(tbl1.repository.url == tbl2.repository_url, new { tbl1, tbl2 })
// Chain Style? ... bad. Join(repositoryB, aliasSelector).ON(condition)
// more arg ... better Join(repositoryB, aliasSelector, condition)
JOIN clause https://developers.google.com/bigquery/query-reference#joins
BigQuery supports multiple JOIN operations.
Method Signature?