Snowflake Columns Not Being Synced Properly

Hi,

I am connected to our Snowflake data warehouse. All of my tables work great except for one table which seems to be treating many of the column names as lowercase instead of upper case. I have tried to run a re-scan as well as discard cached field value on the entire database, the table, and also the specific columns but the names will not update. Does anyone know how I can accomplish this? Here is an example of the error that I am getting when using the “Ask a Question - Custom Question”

SQL compilation error: error line 1 at position 7 invalid identifier ‘ZENDESK.FACT_TICKETS.“id”’

This field should be called “ID”

Hi @jacobr
I think you’re seeing this issue:
https://github.com/metabase/metabase/issues/9511
Are you seeing any errors in the log while sync/scan?

Hey @flamber

Thanks for the quick reply! It is much appreciated!

It seems like my issue is a little different because all of my tables are being read in, it’s just that some of the fields are lower case and some are uppercase. I looked at the logs and I don’t see any error when running the scan. It does look like the scan found over 700 fields but updated 0, so it doesn’t see a need to update the fields.

I know that in snowflake you can actually create columns with the name in quotes and lowercase letters and then to query that column you will have to use that casing, but if there are no quotes around the column name at the time of creation then it changes it to uppercase.

I think that my table just needs to do a full sync because the ddl in snowflake shows the following:

create or replace TABLE FACT_TICKETS (
ID NUMBER(13,0) NOT NULL,
CHANNEL VARCHAR(100),
FROM_TICKET_ID NUMBER(13,0),

so I think the columns should pull through as upper case.

I have also verified that it is only a few columns in the table that are lowercase for some reason. Using only columns that appear upper case in the data model works fine.

@jacobr
You might need to manually do something, since it looks like there’s an issue when trying to re-sync after a case change:
https://github.com/metabase/metabase/issues/7923
I’m not sure if you should delete the old cache or perhaps even delete and re-add the database for it to see that change.

Hi!
I Have the same problem here! But it’s with Postgres

I’m already droped my table, resync, create again and resync, but still the same problem! And its just one table!

@geovani Perhaps it’s better to start a new topic, since this was fairly specific to Snowflake.
And please include “Diagnostic Info” from Admin > Troubleshooting. And any errors you might see during the sync process in Admin > Troubleshooting > Logs.

I would be very interested to see if you are able to come up with a solution here because we are still unable to properly use one of our tables.

@jacobr, I ‘fix’ this finding and deleting data from metabase_field and metabase_fieldvalues tables :sweat_smile:

First, I search my problematic table in metabase_table, then search for all data in metabase_filed using the table id, and than found all data in metabase_fieldvalues using filed ID.

After remove this data, I just resync again and now all collumns names was ok :sweat_smile:

I don’t remeber if I removed the data from matabase_table too, meabe I did (probably).

Awesome! Looks like it worked for me as well!

1 Like