Some columns doesn't appear in Data Model just in native Query

Hello everyone.

I use Metabase connected to a MYSQL database and have a problem with some tables.
If I execute a “select * from table X” on the native query, the metabase will return all columns. But if I go to Admin> Data Model> And look for the same table, the metabase won’t return some columns.

I already “re-scan” the table and discard the cached field values, but the trouble persist.
{
browser-info: {
language: en-GB,
platform: Win32,
userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36,
vendor: Google Inc.
},
system-info: {
java.runtime.name: OpenJDK Runtime Environment,
java.runtime.version: 11.0.3+7,
java.vendor: AdoptOpenJDK,
java.vendor.url: https://adoptopenjdk.net/,
java.version: 11.0.3,
java.vm.name: OpenJDK 64-Bit Server VM,
java.vm.version: 11.0.3+7,
os.name: Linux,
os.version: 3.10.0-1062.7.1.el7.x86_64,
user.language: en,
user.timezone: GMT
},
metabase-info: {
databases: [
mysql
],
hosting-env: unknown,
application-database: postgres,
run-mode: prod,
version: {
date: 2019-12-19,
tag: v0.34.0,
branch: release-0.34.x,
hash: 1335215
},
settings: {
report-timezone: null
}
}
}
Does anyone have the same problem?

Hi @yuriandreoli
Are you saying that you’re missing some columns (random, different column types) - or - are you missing all columns in some tables?
When you do a sync+scan (Admin > Databases), then check the log (Admin > Troubleshooting > Logs) for errors during the process.

Thanks for your reply @flamber.
Its just some columns in some tables (in native SQL they appear, but in Data Model, no).

I saw the log but didn’t found any error.

@yuriandreoli Okay, I would recommend upgrading to 0.34.2, since it fixes some other issues - not related to this.
Which version of MySQL are you using?
Do you see a pattern of which columns that are missing?
Are the missing columns a specific type? Or perhaps contains spaces in the name or another special character?

I’m running 0.34.2, i updated after posted the topic :smiley:
I did a sheet to compare and didn’t found any pattern (columns in red just appear in SQL):


image

@yuriandreoli Did you perhaps set Visibility to “Do Not Include” for those columns at some point? There’s an issue where hiding a column, completely hides it even in the Data Model and the only way of getting it back is to modify the metadata manually.
https://github.com/metabase/metabase/issues/10297
Otherwise I’m not sure what’s going on. Which version of MySQL?

1 Like

Thats it, I set “do not include” and generate this bug.
Fixed following the recomendation: I modified the id in URL and then go back to Data Model and set the column like “everywhere” :heart_eyes:

Thanks so much!