Strange aggregation errors after upgrading to self hosted v0.50.0

Existing questions on our Snowflake DB suddenly broken when we recently upgraded to v0.50.0 from v0.49.13

the most relevant logs I can see are

:middleware {:js-int-to-string? true, :userland-query? true, :add-default-userland-constraints? true},
   :info {:executed-by 12, :context :ad-hoc, :query-hash #object["[B" 0x22a219f2 "[B@22a219f2"]},
   :lib.convert/converted? true,
   :lib/metadata
   (metabase.lib.metadata.invocation-tracker/invocation-tracker-provider (metabase.lib.metadata.cached-provider/cached-metadata-provider (metabase.lib.metadata.jvm/->UncachedApplicationDatabaseMetadataProvider 9))),
   :constraints {:max-results 10000, :max-results-bare-rows 2000}},
  :errors
  ({:path [0 0 :stages 0 0 0 0 1 :mbql.stage/mbql 0 0 :aggregation 0 0 0 0 0 :sum 0 2 0 0 1],
    :in [:stages 0 :aggregation 0 2],
    :schema
    [:fn {:error/message "expression returning a number"} #object[metabase.lib.schema.expression$expression_schema$fn__14511 0x2de68b48 "metabase.lib.schema.expression$expression_schema$fn__14511@2de68b48"]],
    :value
    [:field
     {:lib/uuid "4b9e4ec5-6ee6-4b2f-b95c-d31fb530d00d",
      :metabase.lib.query/transformation-added-base-type true,
      :base-type :type/Float,
      :effective-type :type/*}
     7185]})}},
:data {:rows [], :cols []}}

And the error I see in the Metabase app itself is:

This happens when I try to select from a Snowflake table and aggregate using sum on a numeric (type/Float) field. Fields that have a type of type/Number in the underlying Snowflake table do not have this issue.

can you access the query definition and send us that?

Hey Luiggi -

By query definition do you mean the raw SQL that is generated via the visual editor? If so, here it is:

SELECT
  DATE_TRUNC(
    'week',
    "MY_NAMESPACE".""MY_TABLE""."DATE"
  ) AS "DATE",
  SUM(
    "MY_NAMESPACE".""MY_TABLE""."FLOAT_COLUMN"
  ) AS "sum"
FROM
  "ANALYTICS"."MY_NAMESPACE".""MY_TABLE""
GROUP BY
  DATE_TRUNC(
    'week',
    "MY_NAMESPACE".""MY_TABLE""."DATE"
  )
ORDER BY
  DATE_TRUNC(
    'week',
    "MY_NAMESPACE".""MY_TABLE""."DATE"
  ) ASC

the FLOAT_COLUMN was the issue that was failing after upgrading. Updating that column type on the Snowflake table to type/Number made it work again.

and also the visual query if possible, I want to try to build the same query

Sure - the visual bit looked like this (I manually edited the image to change table/column names)

Hey mshabib

You mentioned this is happening on existing questions from 49, does this happen with new questions created in 50?

I’m also assuming after you changed the type from Float to Number in Snowflake, you did a schema sync in Metabase?

Also, did the Semantic types for the fields in Admin Settings → Table Metadata change when you made the change from Float to Number?

Thanks

Yes this happened across the existing question on 49 and new question in 50. We did change from float to number, did a schema sync and that resolved the issue.

Interestingly enough the issue was not across all float columns, just one float column on one specific table.

Hey mshabib

If you have access to the Metabase application database, could you run a query on the metabase_field table to see if there are any differences between this one float and the others?

SELECT * FROM metabase_field

or to narrow it down to just the data type classifications

SELECT
  id, 
  name,
  active,
  created_at,
  updated_at,
  base_type,
  semantic_type,
  database_type,
  effective_type
FROM metabase_field