-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from edin-dal/new-queries
Added new JOB queries
- Loading branch information
Showing
7 changed files
with
361 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
let t = load[<id: @vec {int -> int}, title: @vec {int -> string}, imdb_index: @vec {int -> string}, kind_id: @vec {int -> int}, production_year: @vec {int -> int}, imdb_id: @vec {int -> string}, phonetic_code: @vec {int -> string}, episode_of_id: @vec {int -> int}, season_nr: @vec {int -> int}, episode_nr: @vec {int -> int}, series_years: @vec {int -> string}, md5sum: @vec {int -> string}, size: int>]("datasets/job/title.csv") | ||
let miidx = load[<id: @vec {int -> int}, movie_id: @vec {int -> int}, info_type_id: @vec {int -> int}, info: @vec {int -> string}, note: @vec {int -> string}, size: int>]("datasets/job/movie_info_idx.csv") | ||
let mi = load[<id: @vec {int -> int}, movie_id: @vec {int -> int}, info_type_id: @vec {int -> int}, info: @vec {int -> string}, note: @vec {int -> string}, size: int>]("datasets/job/movie_info.csv") | ||
let mc = load[<id: @vec {int -> int}, movie_id: @vec {int -> int}, company_id: @vec {int -> int}, company_type_id: @vec {int -> int}, note: @vec {int -> string}, size: int>]("datasets/job/movie_companies.csv") | ||
let kt = load[<id: @vec {int -> int}, kind: @vec {int -> string}, size: int>]("datasets/job/13a/kt.csv") | ||
let it2 = load[<id: @vec {int -> int}, info: @vec {int -> string}, size: int>]("datasets/job/13a/it2.csv") | ||
let it = load[<id: @vec {int -> int}, info: @vec {int -> string}, size: int>]("datasets/job/13a/it.csv") | ||
let ct = load[<id: @vec {int -> int}, kind: @vec {int -> string}, size: int>]("datasets/job/13a/ct.csv") | ||
let cn = load[<id: @vec {int -> int}, name: @vec {int -> string}, country_code: @vec {int -> string}, imdb_id: @vec {int -> string}, name_pcode_nf: @vec {int -> string}, name_pcode_sf: @vec {int -> string}, md5sum: @vec {int -> string}, size: int>]("datasets/job/13a/cn.csv") | ||
|
||
let miidx_trie0 = sum(<i, _> <- range(miidx.size)) @phmap(miidx.size) { miidx.movie_id(i) -> @smallvecdict(4) { i -> 1 } } in | ||
let interm0_trie0 = sum(<t_off, _> <- range(t.size)) | ||
let x0 = t.id(t_off) in | ||
if (x0 ∈ miidx_trie0) then | ||
let miidx_trie1 = miidx_trie0(x0) in | ||
sum(<miidx_off, _> <- miidx_trie1) | ||
@phmap(promote[min_sum](1000000) + promote[min_sum](t.size)) { t.id(t_off) -> @smallvecdict(4) { <col1=t.title(t_off), col2=t.kind_id(t_off), col3=miidx.info(miidx_off), col4=miidx.info_type_id(miidx_off)> -> 1 } } | ||
in | ||
|
||
let mc_trie0 = sum(<i, _> <- range(mc.size)) @phmap(mc.size) { mc.movie_id(i) -> @smallvecdict(4) { i -> 1 } } in | ||
let kt_trie0 = sum(<i, _> <- range(kt.size)) @phmap(kt.size) { unique(kt.id(i)) -> 1 } in | ||
let it2_trie0 = sum(<i, _> <- range(it2.size)) @phmap(it2.size) { unique(it2.id(i)) -> 1 } in | ||
let it_trie0 = sum(<i, _> <- range(it.size)) @phmap(it.size) { unique(it.id(i)) -> 1 } in | ||
let ct_trie0 = sum(<i, _> <- range(ct.size)) @phmap(ct.size) { unique(ct.id(i)) -> 1 } in | ||
let cn_trie0 = sum(<i, _> <- range(cn.size)) @phmap(cn.size) { unique(cn.id(i)) -> 1 } in | ||
sum(<mi_off, _> <- range(mi.size)) | ||
let x0 = mi.movie_id(mi_off) in | ||
if (x0 ∈ interm0_trie0) then | ||
if (x0 ∈ mc_trie0) then | ||
let interm0_trie1 = interm0_trie0(x0) in | ||
let mc_trie1 = mc_trie0(x0) in | ||
sum(<interm0_tuple, _> <- interm0_trie1) | ||
let x1 = interm0_tuple.col2 in | ||
if (x1 ∈ kt_trie0) then | ||
let kt_trie1 = kt_trie0(x1) in | ||
let x2 = mi.info_type_id(mi_off) in | ||
if (x2 ∈ it2_trie0) then | ||
let it2_trie1 = it2_trie0(x2) in | ||
let x3 = interm0_tuple.col4 in | ||
if (x3 ∈ it_trie0) then | ||
let it_trie1 = it_trie0(x3) in | ||
sum(<mc_off, _> <- mc_trie1) | ||
let x4 = mc.company_type_id(mc_off) in | ||
if (x4 ∈ ct_trie0) then | ||
let ct_trie1 = ct_trie0(x4) in | ||
let x5 = mc.company_id(mc_off) in | ||
if (x5 ∈ cn_trie0) then | ||
let cn_trie1 = cn_trie0(x5) in | ||
let mn_mi = <info=mi.info(mi_off)> in | ||
let mn_interm0 = <col1=interm0_tuple.col1, col3=interm0_tuple.col3> in | ||
promote[min_sum](<col2=mn_mi.info, col5=mn_interm0.col1, col6=mn_interm0.col3>) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
let t = load[<id: @vec {int -> int}, title: @vec {int -> string}, imdb_index: @vec {int -> string}, kind_id: @vec {int -> int}, production_year: @vec {int -> int}, imdb_id: @vec {int -> string}, phonetic_code: @vec {int -> string}, episode_of_id: @vec {int -> int}, season_nr: @vec {int -> int}, episode_nr: @vec {int -> int}, series_years: @vec {int -> string}, md5sum: @vec {int -> string}, size: int>]("datasets/job/title.csv") | ||
let miidx = load[<id: @vec {int -> int}, movie_id: @vec {int -> int}, info_type_id: @vec {int -> int}, info: @vec {int -> string}, note: @vec {int -> string}, size: int>]("datasets/job/movie_info_idx.csv") | ||
let mi = load[<id: @vec {int -> int}, movie_id: @vec {int -> int}, info_type_id: @vec {int -> int}, info: @vec {int -> string}, note: @vec {int -> string}, size: int>]("datasets/job/movie_info.csv") | ||
let mc = load[<id: @vec {int -> int}, movie_id: @vec {int -> int}, company_id: @vec {int -> int}, company_type_id: @vec {int -> int}, note: @vec {int -> string}, size: int>]("datasets/job/movie_companies.csv") | ||
let kt = load[<id: @vec {int -> int}, kind: @vec {int -> string}, size: int>]("datasets/job/13d/kt.csv") | ||
let it2 = load[<id: @vec {int -> int}, info: @vec {int -> string}, size: int>]("datasets/job/13d/it2.csv") | ||
let it = load[<id: @vec {int -> int}, info: @vec {int -> string}, size: int>]("datasets/job/13d/it.csv") | ||
let ct = load[<id: @vec {int -> int}, kind: @vec {int -> string}, size: int>]("datasets/job/13d/ct.csv") | ||
let cn = load[<id: @vec {int -> int}, name: @vec {int -> string}, country_code: @vec {int -> string}, imdb_id: @vec {int -> string}, name_pcode_nf: @vec {int -> string}, name_pcode_sf: @vec {int -> string}, md5sum: @vec {int -> string}, size: int>]("datasets/job/13d/cn.csv") | ||
|
||
let miidx_trie0 = sum(<i, _> <- range(miidx.size)) @phmap(miidx.size) { miidx.movie_id(i) -> @smallvecdict(4) { i -> 1 } } in | ||
let interm0_trie0 = sum(<t_off, _> <- range(t.size)) | ||
let x0 = t.id(t_off) in | ||
if (x0 ∈ miidx_trie0) then | ||
let miidx_trie1 = miidx_trie0(x0) in | ||
sum(<miidx_off, _> <- miidx_trie1) | ||
@phmap(promote[min_sum](1000000) + promote[min_sum](t.size)) { t.id(t_off) -> @smallvecdict(4) { <col1=t.title(t_off), col2=t.kind_id(t_off), col3=miidx.info(miidx_off), col4=miidx.info_type_id(miidx_off)> -> 1 } } | ||
in | ||
|
||
let mc_trie0 = sum(<i, _> <- range(mc.size)) @phmap(mc.size) { mc.movie_id(i) -> @smallvecdict(4) { i -> 1 } } in | ||
let kt_trie0 = sum(<i, _> <- range(kt.size)) @phmap(kt.size) { unique(kt.id(i)) -> 1 } in | ||
let it2_trie0 = sum(<i, _> <- range(it2.size)) @phmap(it2.size) { unique(it2.id(i)) -> 1 } in | ||
let it_trie0 = sum(<i, _> <- range(it.size)) @phmap(it.size) { unique(it.id(i)) -> 1 } in | ||
let ct_trie0 = sum(<i, _> <- range(ct.size)) @phmap(ct.size) { unique(ct.id(i)) -> 1 } in | ||
let cn_trie0 = sum(<i, _> <- range(cn.size)) @phmap(cn.size) { cn.id(i) -> @smallvecdict(4) { i -> 1 } } in | ||
sum(<mi_off, _> <- range(mi.size)) | ||
let x0 = mi.movie_id(mi_off) in | ||
if (x0 ∈ interm0_trie0) then | ||
if (x0 ∈ mc_trie0) then | ||
let interm0_trie1 = interm0_trie0(x0) in | ||
let mc_trie1 = mc_trie0(x0) in | ||
sum(<interm0_tuple, _> <- interm0_trie1) | ||
let x1 = interm0_tuple.col2 in | ||
if (x1 ∈ kt_trie0) then | ||
let kt_trie1 = kt_trie0(x1) in | ||
let x2 = mi.info_type_id(mi_off) in | ||
if (x2 ∈ it2_trie0) then | ||
let it2_trie1 = it2_trie0(x2) in | ||
let x3 = interm0_tuple.col4 in | ||
if (x3 ∈ it_trie0) then | ||
let it_trie1 = it_trie0(x3) in | ||
sum(<mc_off, _> <- mc_trie1) | ||
let x4 = mc.company_type_id(mc_off) in | ||
if (x4 ∈ ct_trie0) then | ||
let ct_trie1 = ct_trie0(x4) in | ||
let x5 = mc.company_id(mc_off) in | ||
if (x5 ∈ cn_trie0) then | ||
let cn_trie1 = cn_trie0(x5) in | ||
let mn_interm0 = <col1=interm0_tuple.col1, col3=interm0_tuple.col3> in | ||
let mn_cn = sum(<cn_off, _> <- cn_trie1) promote[min_sum](<name=cn.name(cn_off)>) in | ||
promote[min_sum](<col4=mn_interm0.col1, col5=mn_interm0.col3, col8=mn_cn.name>) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
let t = load[<id: @vec {int -> int}, title: @vec {int -> string}, imdb_index: @vec {int -> string}, kind_id: @vec {int -> int}, production_year: @vec {int -> int}, imdb_id: @vec {int -> string}, phonetic_code: @vec {int -> string}, episode_of_id: @vec {int -> int}, season_nr: @vec {int -> int}, episode_nr: @vec {int -> int}, series_years: @vec {int -> string}, md5sum: @vec {int -> string}, size: int>]("datasets/job/title.csv") | ||
let miidx = load[<id: @vec {int -> int}, movie_id: @vec {int -> int}, info_type_id: @vec {int -> int}, info: @vec {int -> string}, note: @vec {int -> string}, size: int>]("datasets/job/movie_info_idx.csv") | ||
let mi = load[<id: @vec {int -> int}, movie_id: @vec {int -> int}, info_type_id: @vec {int -> int}, info: @vec {int -> string}, note: @vec {int -> string}, size: int>]("datasets/job/movie_info.csv") | ||
let mc = load[<id: @vec {int -> int}, movie_id: @vec {int -> int}, company_id: @vec {int -> int}, company_type_id: @vec {int -> int}, note: @vec {int -> string}, size: int>]("datasets/job/movie_companies.csv") | ||
let kt = load[<id: @vec {int -> int}, kind: @vec {int -> string}, size: int>]("datasets/job/13a/kt.csv") | ||
let it2 = load[<id: @vec {int -> int}, info: @vec {int -> string}, size: int>]("datasets/job/13a/it2.csv") | ||
let it = load[<id: @vec {int -> int}, info: @vec {int -> string}, size: int>]("datasets/job/13a/it.csv") | ||
let ct = load[<id: @vec {int -> int}, kind: @vec {int -> string}, size: int>]("datasets/job/13a/ct.csv") | ||
let cn = load[<id: @vec {int -> int}, name: @vec {int -> string}, country_code: @vec {int -> string}, imdb_id: @vec {int -> string}, name_pcode_nf: @vec {int -> string}, name_pcode_sf: @vec {int -> string}, md5sum: @vec {int -> string}, size: int>]("datasets/job/13a/cn.csv") | ||
|
||
let t_trie0 = sum(<i, _> <- range(t.size)) @phmap(t.size) { t.id(i) -> @smallvecdict(4) { i -> 1 } } in | ||
let miidx_trie0 = sum(<i, _> <- range(miidx.size)) @phmap(miidx.size) { miidx.movie_id(i) -> @smallvecdict(4) { i -> 1 } } in | ||
let interm0_trie0 = sum(<x0, t_trie1> <- t_trie0) | ||
if (x0 ∈ miidx_trie0) then | ||
let miidx_trie1 = miidx_trie0(x0) in | ||
sum(<t_off, _> <- t_trie1) | ||
sum(<miidx_off, _> <- miidx_trie1) | ||
{ t.id(t_off) -> { t.kind_id(t_off) -> { miidx.info_type_id(miidx_off) -> @smallvecdict(0) { <col0=t.id(t_off), col1=t.title(t_off), col2=t.kind_id(t_off), col3=miidx.info(miidx_off), col4=miidx.info_type_id(miidx_off)> -> 1 } } } } | ||
in | ||
|
||
let mi_trie0 = sum(<i, _> <- range(mi.size)) { mi.movie_id(i) -> { mi.info_type_id(i) -> @smallvecdict(0) { i -> 1 } } } in | ||
let mc_trie0 = sum(<i, _> <- range(mc.size)) { mc.movie_id(i) -> { mc.company_type_id(i) -> { mc.company_id(i) -> 1 } } } in | ||
let kt_trie0 = sum(<i, _> <- range(kt.size)) { kt.id(i) -> 1 } in | ||
let it2_trie0 = sum(<i, _> <- range(it2.size)) { it2.id(i) -> 1 } in | ||
let it_trie0 = sum(<i, _> <- range(it.size)) { it.id(i) -> 1 } in | ||
let ct_trie0 = sum(<i, _> <- range(ct.size)) { ct.id(i) -> 1 } in | ||
let cn_trie0 = sum(<i, _> <- range(cn.size)) { cn.id(i) -> 1 } in | ||
sum(<x0, mi_trie1> <- mi_trie0) | ||
if (x0 ∈ interm0_trie0) then | ||
if (x0 ∈ mc_trie0) then | ||
let interm0_trie1 = interm0_trie0(x0) in | ||
let mc_trie1 = mc_trie0(x0) in | ||
sum(<x1, interm0_trie2> <- interm0_trie1) | ||
if (x1 ∈ kt_trie0) then | ||
let kt_trie1 = kt_trie0(x1) in | ||
sum(<x2, mi_trie2> <- mi_trie1) | ||
if (x2 ∈ it2_trie0) then | ||
let it2_trie1 = it2_trie0(x2) in | ||
sum(<x3, interm0_trie3> <- interm0_trie2) | ||
if (x3 ∈ it_trie0) then | ||
let it_trie1 = it_trie0(x3) in | ||
sum(<x4, mc_trie2> <- mc_trie1) | ||
if (x4 ∈ ct_trie0) then | ||
let ct_trie1 = ct_trie0(x4) in | ||
sum(<x5, mc_trie3> <- mc_trie2) | ||
if (x5 ∈ cn_trie0) then | ||
let cn_trie1 = cn_trie0(x5) in | ||
let mn_mi = sum(<mi_off, _> <- mi_trie2) promote[min_sum](<info=mi.info(mi_off)>) in | ||
let mn_interm0 = sum(<interm0_tuple, _> <- interm0_trie3) promote[min_sum](<col1=interm0_tuple.col1, col3=interm0_tuple.col3>) in | ||
promote[min_sum](<col2=mn_mi.info, col5=mn_interm0.col1, col6=mn_interm0.col3>) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
let t = load[<id: @vec {int -> int}, title: @vec {int -> string}, imdb_index: @vec {int -> string}, kind_id: @vec {int -> int}, production_year: @vec {int -> int}, imdb_id: @vec {int -> string}, phonetic_code: @vec {int -> string}, episode_of_id: @vec {int -> int}, season_nr: @vec {int -> int}, episode_nr: @vec {int -> int}, series_years: @vec {int -> string}, md5sum: @vec {int -> string}, size: int>]("datasets/job/title.csv") | ||
let miidx = load[<id: @vec {int -> int}, movie_id: @vec {int -> int}, info_type_id: @vec {int -> int}, info: @vec {int -> string}, note: @vec {int -> string}, size: int>]("datasets/job/movie_info_idx.csv") | ||
let mi = load[<id: @vec {int -> int}, movie_id: @vec {int -> int}, info_type_id: @vec {int -> int}, info: @vec {int -> string}, note: @vec {int -> string}, size: int>]("datasets/job/movie_info.csv") | ||
let mc = load[<id: @vec {int -> int}, movie_id: @vec {int -> int}, company_id: @vec {int -> int}, company_type_id: @vec {int -> int}, note: @vec {int -> string}, size: int>]("datasets/job/movie_companies.csv") | ||
let kt = load[<id: @vec {int -> int}, kind: @vec {int -> string}, size: int>]("datasets/job/13d/kt.csv") | ||
let it2 = load[<id: @vec {int -> int}, info: @vec {int -> string}, size: int>]("datasets/job/13d/it2.csv") | ||
let it = load[<id: @vec {int -> int}, info: @vec {int -> string}, size: int>]("datasets/job/13d/it.csv") | ||
let ct = load[<id: @vec {int -> int}, kind: @vec {int -> string}, size: int>]("datasets/job/13d/ct.csv") | ||
let cn = load[<id: @vec {int -> int}, name: @vec {int -> string}, country_code: @vec {int -> string}, imdb_id: @vec {int -> string}, name_pcode_nf: @vec {int -> string}, name_pcode_sf: @vec {int -> string}, md5sum: @vec {int -> string}, size: int>]("datasets/job/13d/cn.csv") | ||
|
||
let t_trie0 = sum(<i, _> <- range(t.size)) @phmap(t.size) { t.id(i) -> @smallvecdict(4) { i -> 1 } } in | ||
let miidx_trie0 = sum(<i, _> <- range(miidx.size)) @phmap(miidx.size) { miidx.movie_id(i) -> @smallvecdict(4) { i -> 1 } } in | ||
let interm0_trie0 = sum(<x0, t_trie1> <- t_trie0) | ||
if (x0 ∈ miidx_trie0) then | ||
let miidx_trie1 = miidx_trie0(x0) in | ||
sum(<t_off, _> <- t_trie1) | ||
sum(<miidx_off, _> <- miidx_trie1) | ||
{ t.id(t_off) -> { t.kind_id(t_off) -> { miidx.info_type_id(miidx_off) -> @smallvecdict(0) { <col0=t.id(t_off), col1=t.title(t_off), col2=t.kind_id(t_off), col3=miidx.info(miidx_off), col4=miidx.info_type_id(miidx_off)> -> 1 } } } } | ||
in | ||
|
||
let mi_trie0 = sum(<i, _> <- range(mi.size)) { mi.movie_id(i) -> { mi.info_type_id(i) -> 1 } } in | ||
let mc_trie0 = sum(<i, _> <- range(mc.size)) { mc.movie_id(i) -> { mc.company_type_id(i) -> { mc.company_id(i) -> 1 } } } in | ||
let kt_trie0 = sum(<i, _> <- range(kt.size)) { kt.id(i) -> 1 } in | ||
let it2_trie0 = sum(<i, _> <- range(it2.size)) { it2.id(i) -> 1 } in | ||
let it_trie0 = sum(<i, _> <- range(it.size)) { it.id(i) -> 1 } in | ||
let ct_trie0 = sum(<i, _> <- range(ct.size)) { ct.id(i) -> 1 } in | ||
let cn_trie0 = sum(<i, _> <- range(cn.size)) @phmap(cn.size) { cn.id(i) -> @smallvecdict(4) { i -> 1 } } in | ||
sum(<x0, mi_trie1> <- mi_trie0) | ||
if (x0 ∈ interm0_trie0) then | ||
if (x0 ∈ mc_trie0) then | ||
let interm0_trie1 = interm0_trie0(x0) in | ||
let mc_trie1 = mc_trie0(x0) in | ||
sum(<x1, interm0_trie2> <- interm0_trie1) | ||
if (x1 ∈ kt_trie0) then | ||
let kt_trie1 = kt_trie0(x1) in | ||
sum(<x2, mi_trie2> <- mi_trie1) | ||
if (x2 ∈ it2_trie0) then | ||
let it2_trie1 = it2_trie0(x2) in | ||
sum(<x3, interm0_trie3> <- interm0_trie2) | ||
if (x3 ∈ it_trie0) then | ||
let it_trie1 = it_trie0(x3) in | ||
sum(<x4, mc_trie2> <- mc_trie1) | ||
if (x4 ∈ ct_trie0) then | ||
let ct_trie1 = ct_trie0(x4) in | ||
sum(<x5, mc_trie3> <- mc_trie2) | ||
if (x5 ∈ cn_trie0) then | ||
let cn_trie1 = cn_trie0(x5) in | ||
let mn_interm0 = sum(<interm0_tuple, _> <- interm0_trie3) promote[min_sum](<col1=interm0_tuple.col1, col3=interm0_tuple.col3>) in | ||
let mn_cn = sum(<cn_off, _> <- cn_trie1) promote[min_sum](<name=cn.name(cn_off)>) in | ||
promote[min_sum](<col4=mn_interm0.col1, col5=mn_interm0.col3, col8=mn_cn.name>) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.