posthog icon indicating copy to clipboard operation
posthog copied to clipboard

fix: drop table not materialized view

Open pauldambra opened this issue 1 year ago â€ĸ 7 comments

When running tests with ./bin/tests -vv --lf path_to_tests.py we print lots of errors to the console while migrating

this fixes one of them

User
Code: 62.
DB::Exception: Syntax error: failed at position 6 ('MATERIALISED'): MATERIALISED VIEW IF EXISTS sessions_mv ON CLUSTER 'posthog'. Expected one of: DATABASE, VIEW, DICTIONARY, TEMPORARY, TABLE, FUNCTION, NAMED COLLECTION, INDEX, USER, ROLE, SETTINGS PROFILE, PROFILE, ROW POLICY, POLICY, QUOTA. Stack trace:

(splitting out from https://github.com/PostHog/posthog/pull/21684 to make sure it doesn't also introduce test failures that PR is hiding)

locally you can see this doesn't drop the view with

select session_id from sessions_mv;

DROP MATERIALISED VIEW IF EXISTS sessions_mv;

select session_id from sessions_mv;

you can select from the MV before and after

pauldambra avatar Apr 21 '24 09:04 pauldambra

@robbie-c I'm out on parent ops on monday morning... I'm reading the failures as the tests accidentally relied on the view not having been deleted - but I've also not read the tests or thought about it 🙈

I'm hoping your familiarity will highlight what's really happening :)

pauldambra avatar Apr 21 '24 09:04 pauldambra

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Apr 23 '24 11:04 posthog-bot

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Apr 23 '24 12:04 posthog-bot

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Apr 23 '24 12:04 posthog-bot

Size Change: +51 B (0%)

Total Size: 1.03 MB

â„šī¸ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.03 MB +51 B (0%)

compressed-size-action

github-actions[bot] avatar Apr 23 '24 12:04 github-actions[bot]

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

posthog-bot avatar Apr 23 '24 12:04 posthog-bot

This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in another week.

posthog-bot avatar May 01 '24 07:05 posthog-bot

This PR was closed due to lack of activity. Feel free to reopen if it's still relevant.

posthog-bot avatar May 09 '24 07:05 posthog-bot