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

Cannot see newly added column to MySQL in Metabase #6553

Closed
alirezastack opened this issue Dec 11, 2017 · 14 comments
Closed

Cannot see newly added column to MySQL in Metabase #6553

alirezastack opened this issue Dec 11, 2017 · 14 comments

Comments

@alirezastack
Copy link

Metabase version: 0.27.1

I have 49 columns in my table and when I get data in Metabase the newly added column is not shown.

I have used Sync database schema now button in admin panel to sync the schema change, but it is not shown. I thought there may be a limitation on count of columns, so I hid some of the columns, but I cannot see the new column.

The interesting part is that when I click View the SQL command is change the query and include the column name in SELECT query it is displayed.

In developer tools there is no problem that could lead to anything? How should I solve this problem?

@salsakran
Copy link
Contributor

Can you check if the column is in the metabase application database under the "metabase_field" table?

@alirezastack
Copy link
Author

@salsakran where is metabase_field?
It is not in Admin Panel -> Data Model section of the table in my database. It is not listed in filtered by section of New Custom Question.

@alirezastack
Copy link
Author

Isn't there anyone who could know the issue? Or more information to solve this problem? This problem has not been solved yet.
@salsakran any more info needed?

@alirezastack
Copy link
Author

alirezastack commented Jan 22, 2018

I went through this all over again and something new has happened! I dropped the whole database (well not because of this bug :) ) and added that specific table with years separated and the general one something like my_table, my_table_2017, my_table_2018 that specific field is displayed on 2017, 2018 tables but again not in my_table?

Is there something in metabase side that I could reset to force update the table structure?
Or a way to remove that from data model and reread it again to solve this problem?

@alirezastack
Copy link
Author

This is again interesting that when I rename the table the field gets back, but when I again rename it into its original name the problem rise again!

@FleetOpsLiam
Copy link

wondering if you're querying a view or the actual table? Have found that if the view is a 'select * from table' and you simply update the underlying table then the stats on view don't change and conversely metabase scan sees no changes for the associated view... ?

@srb45
Copy link

srb45 commented Jan 23, 2019

I think it can be easily solved.
I faced the exact same problem today. In a table, I added 2 columns and renamed 1 column. The changes were not reflecting in the Raw Data view.

It seems that the Sync database schema now option fixes this issue. To find the above Sync option, go to Settings -> Admin -> Databases -> MyDB
Trigger the sync and wait for a few minutes and refresh the Metabase website.

Notes
It takes some time. (10-15 minutes in my case).
Also, a refresh of Metabase website is required, just navigating to the "Question" page by pressing back doesn't reflect the changes.

@KotKrzysztof
Copy link

@srb45 Thanks man 👍

@piebar
Copy link

piebar commented Mar 14, 2019

No! This doesn't resolve my problem. I have already tried resyncing my database schema many times now. I have even tried dropping my table and bringing it back again. In my next step I have even tried creating a "select *" view of the same table and re-tried to get my newly added fields but it didn't result positive. The problem that I figured out was the SQL statement that Metabase throws to scan any table. I carefully monitored all the statements that Metabase fires to scan a table and I couldn't find any statement to scan my newly added fields.

Probable causes for the same might lie around:-

  1. Any upper limit to the number of fields that Metabase scans for a table.
  2. Or any temporary cache that it creates as per table names.

P.s. Metabase version - 0.31.1 . We use Presto as our query engine. I am able to query those fields through a native query option but to set those fields as filters in my question I require them to be scanned by Metabase. I can't risk changing table name as I have a lot of dependencies on the same. And my table contains >70 columns as it's an aggregated table.

Please help here!

@parimalak
Copy link

i solved it by rescanning the cached field values settings-->Admin-->database-->table-->settings

@calz1
Copy link

calz1 commented Oct 18, 2019

We've got a similar problem still on v0.33.3. We renamed some columns in PostgreSQL from mixed case to lower case and Metabase isn't detecting the new names. We triggered a database sync and refreshed the field values and it still throws errors when browsing the tables due to the name mismatch.

@flamber
Copy link
Contributor

flamber commented Oct 18, 2019

@calz1 There's also a specific issue about sync not seeing case changes - #7923.

#7612 - newly added columns doesn't appear in question, when question is re-ordered before the new column is added to database
#10330 - browser refresh is needed to after sync of newly added/removed tables/columns
#11354 - making sync progress indicator
#12567 - problem with syncing MySQL views
PR #12595 (0.35.4) will fix problems, where the entire sync process could be crashed

@robdaemon
Copy link
Contributor

If anyone experiencing this has logs from the sync process on systems having this issue would help a lot.

@flamber
Copy link
Contributor

flamber commented Jul 2, 2020

Closing in favor of all the other issues referenced, and the sync process has been improved a lot since this issue was created.

@flamber flamber closed this as completed Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants