Snowflake - LIMIT of Rows

Since the last version, the number of rows returned by Metabase is 1.

To force normal behavior, I had to add LIMIT 1000 in all my SQL statements.

{
“browser-info”: {
“language”: “en-US”,
“platform”: “MacIntel”,
“userAgent”: “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:82.0) Gecko/20100101 Firefox/82.0”,
“vendor”: “”
},
“system-info”: {
“file.encoding”: “UTF-8”,
“java.runtime.name”: “OpenJDK Runtime Environment”,
“java.runtime.version”: “11.0.7+10”,
“java.vendor”: “AdoptOpenJDK”,
“java.vendor.url”: “https://adoptopenjdk.net/”,
“java.version”: “11.0.7”,
“java.vm.name”: “OpenJDK 64-Bit Server VM”,
“java.vm.version”: “11.0.7+10”,
“os.name”: “Linux”,
“os.version”: “4.15.0-1100-azure”,
“user.language”: “en”,
“user.timezone”: “GMT”
},
“metabase-info”: {
“databases”: [
“h2”,
“snowflake”
],
“hosting-env”: “unknown”,
“application-database”: “postgres”,
“application-database-details”: {
“database”: {
“name”: “PostgreSQL”,
“version”: “10.11”
},
“jdbc-driver”: {
“name”: “PostgreSQL JDBC Driver”,
“version”: “42.2.8”
}
},
“run-mode”: “prod”,
“version”: {
“date”: “2020-12-03”,
“tag”: “v0.37.3”,
“branch”: “release-x.37.x”,
“hash”: “2f1e783”
},
“settings”: {
“report-timezone”: null
}
}
}

Hi @meandu
Which version were you using previously?
I’m guessing you are querying Snowflake?
Can you provide steps-to-reproduce? Sample schema, query etc.
Sounds very similar to Weird Unexplainable Error When Querying Table On Metabase

HIi @flamber, we have the same issue with Snowflake.
For example query on this screenshot returns only one row instead of 8.
This issue seems to be reproduced only with grouping by dates(day, month etc.).
We didn't change our Metabase version recently.

{
"browser-info": {
"language": "en-US",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.8+10",
"java.vendor": "AdoptOpenJDK",
"java.vendor.url": "https://adoptopenjdk.net/",
"java.version": "11.0.8",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.8+10",
"os.name": "Linux",
"os.version": "4.14.186-146.268.amzn2.x86_64",
"user.language": "en",
"user.timezone": "UTC"
},
"metabase-info": {
"databases": [
"snowflake"
],
"hosting-env": "unknown",
"application-database": "postgres",
"application-database-details": {
"database": {
"name": "PostgreSQL",
"version": "9.5.22"
},
"jdbc-driver": {
"name": "PostgreSQL JDBC Driver",
"version": "42.2.8"
}
},
"run-mode": "prod",
"version": {
"date": "2020-08-04",
"tag": "v0.36.3",
"branch": "release-0.36.x",
"hash": "a792f14"
},
"settings": {
"report-timezone": "US/Eastern"
}
}
}

@martasakal @meandu I have opened an issue, while this is being debugged:
https://github.com/metabase/metabase/issues/13995 - upvote by clicking :+1: on the first post

We’re encountering the same issue.

The same “select * from table_name” returns a much smaller number of rows when queried from Metabase in comparison to when queried from Snowflake directly. This happens for both “Ask a question”, and “Native query”

Tried to update to the latest version of the application - didn’t help
Tried increasing the resources on the machine (AWS) - didn’t help
Tried re-syncing the schemas and disabling the cache - didn’t help
Tried dropping the table and rebuilding it again - didn’t help
Made sure warehouse is not limited from Snowflake side - it is not limited

@dringel Let’s continue all information in the issue.

Hey, we’ve figured out that’s a Snowflake issue.
There are no issues if we are using Snowflake web UI, but if it’s the connection through JDBC driver -
every time the same query returns a different result. Snowflake know about that issue and working on it. Hope that’s help
UPD: looks like they’ve fixed it

1 Like

It is the same issue for us, related to Snowflake.

My only workaround was to ‘hardcode’ LIMIT 1000 in my queries.

Our Docker is just set to metabase/latest (so it automatically upgrades).

@meandu The issue has been fixed by Snowflake - it was a problem in their systems, which was reverted earlier today.

Yes, solved. Thank you all!