Skip to content
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

Ordinal positions differ with same set of columns #363

Open
joshelser opened this issue Sep 22, 2023 · 2 comments
Open

Ordinal positions differ with same set of columns #363

joshelser opened this issue Sep 22, 2023 · 2 comments

Comments

@joshelser
Copy link
Contributor

Saw this exactly once:

-- returns 78 to 81
call admin.run_as_app($$ SELECT COLUMN_NAME, DATA_TYPE, ORDINAL_POSITION FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'INTERNAL_REPORTING' AND TABLE_NAME = 'QUERY_HISTORY_COMPLETE_AND_DAILY' and column_name ilike '%hash%' order by ordinal_position $$);
-- returns 82 to 85
call admin.run_as_app($$ SELECT COLUMN_NAME, DATA_TYPE, ORDINAL_POSITION FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'INTERNAL_REPORTING_MV' AND TABLE_NAME = 'QUERY_HISTORY_COMPLETE_AND_DAILY'  and column_name ilike '%hash%' order by ordinal_position $$);

I don't know if this was due to something else I had done or if it's a less-than-likely situation where snowflake may skip ordinal positions.

@rymurr
Copy link
Contributor

rymurr commented Sep 23, 2023

What is the effect of this?

@joshelser
Copy link
Contributor Author

It caused an exception to be raised every time the 005_migrations.sql procedure ran because it would try to re-add the columns from internal_reporting.query_history_complete_and_daily to internal_reporting_mv.query_history_complete_and_daily, effectively breaking all future materializations (as we always try to migrate when the query history maintenance task is executed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants