-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add imdb SQL benchmark #22680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Omega359
wants to merge
1
commit into
apache:main
Choose a base branch
from
Omega359:sql-benchmarks/imdb
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add imdb SQL benchmark #22680
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,35 @@ | ||
| name Q01a | ||
| group imdb | ||
|
|
||
| echo Loading imdb tables | ||
|
|
||
| load sql_benchmarks/imdb/init/load_${IMDB_FILE_TYPE:-parquet}.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from title; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| SELECT MIN(mc.note) AS production_note, | ||
| MIN(t.title) AS movie_title, | ||
| MIN(t.production_year) AS movie_year | ||
| FROM company_type AS ct, | ||
| info_type AS it, | ||
| movie_companies AS mc, | ||
| movie_info_idx AS mi_idx, | ||
| title AS t | ||
| WHERE ct.kind = 'production companies' | ||
| AND it.info = 'top 250 rank' | ||
| AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' | ||
| AND (mc.note LIKE '%(co-production)%' | ||
| OR mc.note LIKE '%(presents)%') | ||
| AND ct.id = mc.company_type_id | ||
| AND t.id = mc.movie_id | ||
| AND t.id = mi_idx.movie_id | ||
| AND mc.movie_id = mi_idx.movie_id | ||
| AND it.id = mi_idx.info_type_id; | ||
|
|
||
| result sql_benchmarks/imdb/results/01a.csv | ||
|
|
||
|
|
||
| cleanup sql_benchmarks/imdb/init/cleanup.sql | ||
This file contains hidden or 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,34 @@ | ||
| name Q01b | ||
| group imdb | ||
|
|
||
| echo Loading imdb tables | ||
|
|
||
| load sql_benchmarks/imdb/init/load_${IMDB_FILE_TYPE:-parquet}.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from title; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| SELECT MIN(mc.note) AS production_note, | ||
| MIN(t.title) AS movie_title, | ||
| MIN(t.production_year) AS movie_year | ||
| FROM company_type AS ct, | ||
| info_type AS it, | ||
| movie_companies AS mc, | ||
| movie_info_idx AS mi_idx, | ||
| title AS t | ||
| WHERE ct.kind = 'production companies' | ||
| AND it.info = 'bottom 10 rank' | ||
| AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' | ||
| AND t.production_year BETWEEN 2005 AND 2010 | ||
| AND ct.id = mc.company_type_id | ||
| AND t.id = mc.movie_id | ||
| AND t.id = mi_idx.movie_id | ||
| AND mc.movie_id = mi_idx.movie_id | ||
| AND it.id = mi_idx.info_type_id; | ||
|
|
||
| result sql_benchmarks/imdb/results/01b.csv | ||
|
|
||
| cleanup sql_benchmarks/imdb/init/cleanup.sql |
This file contains hidden or 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,35 @@ | ||
| name Q01c | ||
| group imdb | ||
|
|
||
| echo Loading imdb tables | ||
|
|
||
| load sql_benchmarks/imdb/init/load_${IMDB_FILE_TYPE:-parquet}.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from title; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| SELECT MIN(mc.note) AS production_note, | ||
| MIN(t.title) AS movie_title, | ||
| MIN(t.production_year) AS movie_year | ||
| FROM company_type AS ct, | ||
| info_type AS it, | ||
| movie_companies AS mc, | ||
| movie_info_idx AS mi_idx, | ||
| title AS t | ||
| WHERE ct.kind = 'production companies' | ||
| AND it.info = 'top 250 rank' | ||
| AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' | ||
| AND (mc.note LIKE '%(co-production)%') | ||
| AND t.production_year >2010 | ||
| AND ct.id = mc.company_type_id | ||
| AND t.id = mc.movie_id | ||
| AND t.id = mi_idx.movie_id | ||
| AND mc.movie_id = mi_idx.movie_id | ||
| AND it.id = mi_idx.info_type_id; | ||
|
|
||
| result sql_benchmarks/imdb/results/01c.csv | ||
|
|
||
| cleanup sql_benchmarks/imdb/init/cleanup.sql |
This file contains hidden or 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,34 @@ | ||
| name Q01d | ||
| group imdb | ||
|
|
||
| echo Loading imdb tables | ||
|
|
||
| load sql_benchmarks/imdb/init/load_${IMDB_FILE_TYPE:-parquet}.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from title; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| SELECT MIN(mc.note) AS production_note, | ||
| MIN(t.title) AS movie_title, | ||
| MIN(t.production_year) AS movie_year | ||
| FROM company_type AS ct, | ||
| info_type AS it, | ||
| movie_companies AS mc, | ||
| movie_info_idx AS mi_idx, | ||
| title AS t | ||
| WHERE ct.kind = 'production companies' | ||
| AND it.info = 'bottom 10 rank' | ||
| AND mc.note NOT LIKE '%(as Metro-Goldwyn-Mayer Pictures)%' | ||
| AND t.production_year >2000 | ||
| AND ct.id = mc.company_type_id | ||
| AND t.id = mc.movie_id | ||
| AND t.id = mi_idx.movie_id | ||
| AND mc.movie_id = mi_idx.movie_id | ||
| AND it.id = mi_idx.info_type_id; | ||
|
|
||
| result sql_benchmarks/imdb/results/01d.csv | ||
|
|
||
| cleanup sql_benchmarks/imdb/init/cleanup.sql |
This file contains hidden or 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,30 @@ | ||
| name Q02a | ||
| group imdb | ||
|
|
||
| echo Loading imdb tables | ||
|
|
||
| load sql_benchmarks/imdb/init/load_${IMDB_FILE_TYPE:-parquet}.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from title; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| SELECT MIN(t.title) AS movie_title | ||
| FROM company_name AS cn, | ||
| keyword AS k, | ||
| movie_companies AS mc, | ||
| movie_keyword AS mk, | ||
| title AS t | ||
| WHERE cn.country_code ='[de]' | ||
| AND k.keyword ='character-name-in-title' | ||
| AND cn.id = mc.company_id | ||
| AND mc.movie_id = t.id | ||
| AND t.id = mk.movie_id | ||
| AND mk.keyword_id = k.id | ||
| AND mc.movie_id = mk.movie_id; | ||
|
|
||
| result sql_benchmarks/imdb/results/02a.csv | ||
|
|
||
| cleanup sql_benchmarks/imdb/init/cleanup.sql |
This file contains hidden or 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,30 @@ | ||
| name Q02b | ||
| group imdb | ||
|
|
||
| echo Loading imdb tables | ||
|
|
||
| load sql_benchmarks/imdb/init/load_${IMDB_FILE_TYPE:-parquet}.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from title; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| SELECT MIN(t.title) AS movie_title | ||
| FROM company_name AS cn, | ||
| keyword AS k, | ||
| movie_companies AS mc, | ||
| movie_keyword AS mk, | ||
| title AS t | ||
| WHERE cn.country_code ='[nl]' | ||
| AND k.keyword ='character-name-in-title' | ||
| AND cn.id = mc.company_id | ||
| AND mc.movie_id = t.id | ||
| AND t.id = mk.movie_id | ||
| AND mk.keyword_id = k.id | ||
| AND mc.movie_id = mk.movie_id; | ||
|
|
||
| result sql_benchmarks/imdb/results/02b.csv | ||
|
|
||
| cleanup sql_benchmarks/imdb/init/cleanup.sql |
This file contains hidden or 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,30 @@ | ||
| name Q02c | ||
| group imdb | ||
|
|
||
| echo Loading imdb tables | ||
|
|
||
| load sql_benchmarks/imdb/init/load_${IMDB_FILE_TYPE:-parquet}.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from title; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| SELECT MIN(t.title) AS movie_title | ||
| FROM company_name AS cn, | ||
| keyword AS k, | ||
| movie_companies AS mc, | ||
| movie_keyword AS mk, | ||
| title AS t | ||
| WHERE cn.country_code ='[sm]' | ||
| AND k.keyword ='character-name-in-title' | ||
| AND cn.id = mc.company_id | ||
| AND mc.movie_id = t.id | ||
| AND t.id = mk.movie_id | ||
| AND mk.keyword_id = k.id | ||
| AND mc.movie_id = mk.movie_id; | ||
|
|
||
| result sql_benchmarks/imdb/results/02c.csv | ||
|
|
||
| cleanup sql_benchmarks/imdb/init/cleanup.sql |
This file contains hidden or 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,30 @@ | ||
| name Q02d | ||
| group imdb | ||
|
|
||
| echo Loading imdb tables | ||
|
|
||
| load sql_benchmarks/imdb/init/load_${IMDB_FILE_TYPE:-parquet}.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from title; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| SELECT MIN(t.title) AS movie_title | ||
| FROM company_name AS cn, | ||
| keyword AS k, | ||
| movie_companies AS mc, | ||
| movie_keyword AS mk, | ||
| title AS t | ||
| WHERE cn.country_code ='[us]' | ||
| AND k.keyword ='character-name-in-title' | ||
| AND cn.id = mc.company_id | ||
| AND mc.movie_id = t.id | ||
| AND t.id = mk.movie_id | ||
| AND mk.keyword_id = k.id | ||
| AND mc.movie_id = mk.movie_id; | ||
|
|
||
| result sql_benchmarks/imdb/results/02d.csv | ||
|
|
||
| cleanup sql_benchmarks/imdb/init/cleanup.sql |
This file contains hidden or 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,36 @@ | ||
| name Q03a | ||
| group imdb | ||
|
|
||
| echo Loading imdb tables | ||
|
|
||
| load sql_benchmarks/imdb/init/load_${IMDB_FILE_TYPE:-parquet}.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from title; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| SELECT MIN(t.title) AS movie_title | ||
| FROM keyword AS k, | ||
| movie_info AS mi, | ||
| movie_keyword AS mk, | ||
| title AS t | ||
| WHERE k.keyword LIKE '%sequel%' | ||
| AND mi.info IN ('Sweden', | ||
| 'Norway', | ||
| 'Germany', | ||
| 'Denmark', | ||
| 'Swedish', | ||
| 'Denish', | ||
| 'Norwegian', | ||
| 'German') | ||
| AND t.production_year > 2005 | ||
| AND t.id = mi.movie_id | ||
| AND t.id = mk.movie_id | ||
| AND mk.movie_id = mi.movie_id | ||
| AND k.id = mk.keyword_id; | ||
|
|
||
| result sql_benchmarks/imdb/results/03a.csv | ||
|
|
||
| cleanup sql_benchmarks/imdb/init/cleanup.sql |
This file contains hidden or 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,29 @@ | ||
| name Q03b | ||
| group imdb | ||
|
|
||
| echo Loading imdb tables | ||
|
|
||
| load sql_benchmarks/imdb/init/load_${IMDB_FILE_TYPE:-parquet}.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from title; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| SELECT MIN(t.title) AS movie_title | ||
| FROM keyword AS k, | ||
| movie_info AS mi, | ||
| movie_keyword AS mk, | ||
| title AS t | ||
| WHERE k.keyword LIKE '%sequel%' | ||
| AND mi.info IN ('Bulgaria') | ||
| AND t.production_year > 2010 | ||
| AND t.id = mi.movie_id | ||
| AND t.id = mk.movie_id | ||
| AND mk.movie_id = mi.movie_id | ||
| AND k.id = mk.keyword_id; | ||
|
|
||
| result sql_benchmarks/imdb/results/03b.csv | ||
|
|
||
| cleanup sql_benchmarks/imdb/init/cleanup.sql |
This file contains hidden or 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,38 @@ | ||
| name Q03c | ||
| group imdb | ||
|
|
||
| echo Loading imdb tables | ||
|
|
||
| load sql_benchmarks/imdb/init/load_${IMDB_FILE_TYPE:-parquet}.sql | ||
|
|
||
| assert I | ||
| SELECT COUNT(*) > 0 from title; | ||
| ---- | ||
| true | ||
|
|
||
| run | ||
| SELECT MIN(t.title) AS movie_title | ||
| FROM keyword AS k, | ||
| movie_info AS mi, | ||
| movie_keyword AS mk, | ||
| title AS t | ||
| WHERE k.keyword LIKE '%sequel%' | ||
| AND mi.info IN ('Sweden', | ||
| 'Norway', | ||
| 'Germany', | ||
| 'Denmark', | ||
| 'Swedish', | ||
| 'Denish', | ||
| 'Norwegian', | ||
| 'German', | ||
| 'USA', | ||
| 'American') | ||
| AND t.production_year > 1990 | ||
| AND t.id = mi.movie_id | ||
| AND t.id = mk.movie_id | ||
| AND mk.movie_id = mi.movie_id | ||
| AND k.id = mk.keyword_id; | ||
|
|
||
| result sql_benchmarks/imdb/results/03c.csv | ||
|
|
||
| cleanup sql_benchmarks/imdb/init/cleanup.sql |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could fix the filtering logic to accept an arbitrary string? Or match either with or without the suffix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the code it seems we could do something like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that seems smarter. I encountered the issue isolating an OOM with a query and as it was before I couldn't run the individual benchmark. I'll update this tomorrow.