-
-
Notifications
You must be signed in to change notification settings - Fork 297
feat(pg): Add support for Postgres materialized views (relkind = 'm') and test #2279
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
Draft
kunalsinghdadhwal
wants to merge
15
commits into
maplibre:main
Choose a base branch
from
kunalsinghdadhwal:fix/materialized-views
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.
+53
−16
Draft
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
931b899
Add support for Postgres materialized views (relkind = 'm') and test …
kunalsinghdadhwal 5c131da
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 5b8b21e
Merge branch 'main' into fix/materialized-views
kunalsinghdadhwal 4dae341
Changed Option<bool> to Option<Char> in TableInfo Struct
kunalsinghdadhwal 0bf3dce
Apply suggestion from @CommanderStorm
CommanderStorm 05bb10e
Merge branch 'main' into fix/materialized-views
CommanderStorm 487805c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 4f731e0
change the collum to be named relkind
CommanderStorm 729108e
fix more of the tests
CommanderStorm aec861f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 3a0a9fb
Update martin/src/config/file/tiles/postgres/resolver/scripts/query_a…
CommanderStorm ce58dca
Added 'r' as per suggestion
kunalsinghdadhwal aaa135d
Merge branch 'main' into fix/materialized-views
kunalsinghdadhwal 933a68c
Refactor materialized view creation for comments
nyurik f9f381d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 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
Some comments aren't visible on the classic Files Changed page.
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
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
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,18 @@ | ||
| CREATE TABLE fixtures_comments ( | ||
| id serial PRIMARY KEY, | ||
| txt text, | ||
| geom GEOMETRY (POINT, 4326) | ||
| ); | ||
|
|
||
| INSERT INTO fixtures_comments (txt, geom) VALUES | ||
| ('a', ST_GEOMFROMTEXT('POINT(-122.4194 37.7749)', 4326)), | ||
| ('b', ST_GEOMFROMTEXT('POINT(-73.935242 40.730610)', 4326)); | ||
|
|
||
| CREATE MATERIALIZED VIEW fixtures_mv_comments AS | ||
| SELECT | ||
| id, | ||
| txt, | ||
| geom | ||
| FROM fixtures_comments; | ||
|
|
||
| COMMENT ON MATERIALIZED VIEW fixtures_mv_comments IS 'fixture: materialized view comments'; | ||
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 |
|---|---|---|
|
|
@@ -244,6 +244,7 @@ validate_log() { | |
| remove_lines "$LOG_FILE" 'PostgreSQL 11.10.0 is older than the recommended minimum 12.0.0' | ||
| remove_lines "$LOG_FILE" 'In the used version, some geometry may be hidden on some zoom levels.' | ||
| remove_lines "$LOG_FILE" 'Unable to deserialize SQL comment on public.points2 as tilejson, the automatically generated tilejson would be used: expected value at line 1 column 1' | ||
| remove_lines "$LOG_FILE" 'Unable to deserialize SQL comment on public.fixtures_mv_comments as tilejson, the automatically generated tilejson would be used: expected value at line 1 column 1' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should not be ignored i think |
||
|
|
||
| echo "Checking for no other warnings or errors in the log" | ||
| if grep -e ' ERROR ' -e ' WARN ' "$LOG_FILE"; then | ||
|
|
@@ -420,6 +421,10 @@ test_pbf antimeridian_4_0_5 antimeridian/4/0/5 | |
| test_jsn tbl_comment MixPoints | ||
| test_jsn fnc_comment function_Mixed_Name | ||
|
|
||
| >&2 echo "***** Test server response for materialized view *****" | ||
| test_jsn mv_comment fixtures_mv_comments | ||
| test_pbf mv_comment_0_0_0 fixtures_mv_comments/0/0/0 | ||
|
|
||
| >&2 echo "***** Test server response for the same name in different schemas *****" | ||
| test_jsn same_name_different_schema_table1 table_name_existing_two_schemas | ||
| test_pbf same_name_different_schema_table1_0_0_0 table_name_existing_two_schemas/0/0/0 | ||
|
|
@@ -438,6 +443,8 @@ kill_process "$MARTIN_PROC_ID" Martin | |
|
|
||
| test_log_has_str "$LOG_FILE" 'WARN martin::config::file::tiles::postgres::resolver::query_tables] Table public.table_source has no spatial index on column geom' | ||
| test_log_has_str "$LOG_FILE" 'WARN martin::config::file::tiles::postgres::resolver::query_tables] Table public.table_source_geog has no spatial index on column geog' | ||
| test_log_has_str "$LOG_FILE" 'WARN martin::config::file::tiles::postgres::resolver::query_tables] Table public.fixtures_comments has no spatial index on column geom' | ||
| test_log_has_str "$LOG_FILE" 'WARN martin::config::file::tiles::postgres::resolver::query_tables] Table public.fixtures_mv_comments has no spatial index on column geom' | ||
| test_log_has_str "$LOG_FILE" 'WARN martin_core::resources::fonts] Ignoring duplicate font Overpass Mono Regular from tests' | ||
| test_log_has_str "$LOG_FILE" 'was renamed to `stamen_toner__raster_CC-BY-ODbL_z3`' | ||
| test_log_has_str "$LOG_FILE" 'was renamed to `table_source_multiple_geom.1`' | ||
|
|
@@ -552,6 +559,8 @@ test_metrics "metrics_1" | |
| kill_process "$MARTIN_PROC_ID" Martin | ||
| test_log_has_str "$LOG_FILE" 'WARN martin::config::file::tiles::postgres::resolver::query_tables] Table public.table_source has no spatial index on column geom' | ||
| test_log_has_str "$LOG_FILE" 'WARN martin::config::file::tiles::postgres::resolver::query_tables] Table public.table_source_geog has no spatial index on column geog' | ||
| test_log_has_str "$LOG_FILE" 'WARN martin::config::file::tiles::postgres::resolver::query_tables] Table public.fixtures_comments has no spatial index on column geom' | ||
| test_log_has_str "$LOG_FILE" 'WARN martin::config::file::tiles::postgres::resolver::query_tables] Table public.fixtures_mv_comments has no spatial index on column geom' | ||
| test_log_has_str "$LOG_FILE" 'WARN martin_core::resources::fonts] Ignoring duplicate font Overpass Mono Regular from tests' | ||
| test_log_has_str "$LOG_FILE" "WARN martin::config::file::main] Ignoring unrecognized configuration key 'warning'. Please check your configuration file for typos." | ||
| test_log_has_str "$LOG_FILE" "WARN martin::config::file::main] Ignoring unrecognized configuration key 'observability.warning'. Please check your configuration file for typos." | ||
|
|
||
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.
we should make this into a proper json comment, just like other SQL, rather than ignoring this warning below