my previous version 0.49 and running this query can get a result.
First, you are going to want to edit that diagnostic info and remove PII, your user’s names and email addresses are in that file.
Second, can you explain what query you’re referring to? I can see a lot of exceptions about missing parameters. Double check that your questions migrated correctly.
Thanks @dwhitemv .
Below is my pay load (against my MySQL 5.7 instance), sorry for the messy format.
{"lib/type":"mbql/query","stages":[{"lib/type":"mbql.stage/native","template-tags":{"start_date":{"type":"date","id":"33d097da-d8fd-68b2-aca3-fa2ebbfb907f","name":"start_date","display-name":"开始日期","default":null},"end_date":{"type":"date","id":"e39d683c-ba91-ee12-6654-717edd9b14ea","name":"end_date","display-name":"结束日期","default":null}},"native":"select\n \"汇总\" as \"\",\n i.公司仓期初库存成本,\n i.总仓期初库存成本,\n io2.采购入库成本,\n io2.商场调拨成本,\n io2.公司仓销售成本,\n io2.商场仓销售成本,\n i.公司仓期末库存成本,\n i.总仓期末库存成本,\n bci.公司仓当前库存成本,\n bci.总仓当前库存成本\nfrom \n (\n select \n 1 as 'group',\n sum(case when warehouse in ('永万仓', '三亚百货仓(一仓)', '三亚维达(二仓)', '000000') AND date = DATE_SUB({{start_date}}, INTERVAL 1 DAY) then costAmount else 0 end) as '公司仓期初库存成本',\n sum(case when warehouse in ('永万仓', '三亚百货仓(一仓)', '三亚维达(二仓)', '000000') AND date = {{end_date}} then costAmount else 0 end) as '公司仓期末库存成本',\n sum(case when date = DATE_SUB({{start_date}}, INTERVAL 1 DAY) then costAmount else 0 end) as '总仓期初库存成本',\n sum(case when date = {{end_date}} then costAmount else 0 end) as '总仓期末库存成本'\n from inventoryHist\n where \n date in ({{end_date}}, DATE_SUB({{start_date}}, INTERVAL 1 DAY))\n ) as i\nleft join\n (\n select \n 1 as 'group',\n sum(case when o.businessType = '采购入库' and o.inboundWarehouse in ('永万仓', '三亚百货仓(一仓)', '三亚维达(二仓)', '000000') then d.costAmount else 0 end) as '采购入库成本',\n sum(case when o.businessType = '调拨送货' and o.outboundWarehouse in ('永万仓', '三亚百货仓(一仓)', '三亚维达(二仓)', '000000') then d.costAmount else 0 end) as '商场调拨成本',\n sum(case when o.businessType = '客户销售' and o.outboundWarehouse in ('永万仓', '三亚百货仓(一仓)', '三亚维达(二仓)', '000000') then d.costAmount else 0 end) as '公司仓销售成本',\n sum(case when o.businessType = '客户销售' and o.outboundWarehouse not in ('永万仓', '三亚百货仓(一仓)', '三亚维达(二仓)', '000000') then d.costAmount else 0 end) as '商场仓销售成本'\n from transactionOrderDetailHist as d\n join transactionOrderHist as o on d.orderRowId = o.rowId AND o.businessType in ('调拨送货', '客户销售', '采购入库') AND o.effectiveTime between {{start_date}} and DATE_ADD({{end_date}}, INTERVAL 1 DAY)\n ) as io2 on io2.group = i.group\nleft join \n (\n select \n 1 as 'group',\n sum(case when warehouse in ('永万仓', '三亚百货仓(一仓)', '三亚维达(二仓)', '000000') then costAmount else 0 end) as '公司仓当前库存成本',\n sum(costAmount) as '总仓当前库存成本'\n from currentInv\n ) as bci on bci.group = i.group"}],"database":2,"parameters":[{"id":"33d097da-d8fd-68b2-aca3-fa2ebbfb907f","type":"date/single","value":"2026-04-01","target":["variable",["template-tag","start_date"]]},{"id":"e39d683c-ba91-ee12-6654-717edd9b14ea","type":"date/single","value":"2026-04-19","target":["variable",["template-tag","end_date"]]}]}
And I can see the response using chrome inspect - network. But the front end just gets an error (type as “component-crash”) and unable to render the report.
This is the query
select
"汇总" as "",
i.公司仓期初库存成本,
i.总仓期初库存成本,
io2.采购入库成本,
io2.商场调拨成本,
io2.公司仓销售成本,
io2.商场仓销售成本,
i.公司仓期末库存成本,
i.总仓期末库存成本,
bci.公司仓当前库存成本,
bci.总仓当前库存成本
from
(
select
1 as 'group',
sum(
case
when warehouse in ('永万仓', '三亚百货仓(一仓)', '三亚维达(二仓)', '000000')
AND date = DATE_SUB(date '2026-04-01', INTERVAL 1 DAY) then costAmount
else 0
end
) as '公司仓期初库存成本',
sum(
case
when warehouse in ('永万仓', '三亚百货仓(一仓)', '三亚维达(二仓)', '000000')
AND date = date '2026-04-19' then costAmount
else 0
end
) as '公司仓期末库存成本',
sum(
case
when date = DATE_SUB(date '2026-04-01', INTERVAL 1 DAY) then costAmount
else 0
end
) as '总仓期初库存成本',
sum(
case
when date = date '2026-04-19' then costAmount
else 0
end
) as '总仓期末库存成本'
from
inventoryHist
where
date in (
date '2026-04-19',
DATE_SUB(date '2026-04-01', INTERVAL 1 DAY)
)
) as i
left join (
select
1 as 'group',
sum(
case
when o.businessType = '采购入库'
and o.inboundWarehouse in ('永万仓', '三亚百货仓(一仓)', '三亚维达(二仓)', '000000') then d.costAmount
else 0
end
) as '采购入库成本',
sum(
case
when o.businessType = '调拨送货'
and o.outboundWarehouse in ('永万仓', '三亚百货仓(一仓)', '三亚维达(二仓)', '000000') then d.costAmount
else 0
end
) as '商场调拨成本',
sum(
case
when o.businessType = '客户销售'
and o.outboundWarehouse in ('永万仓', '三亚百货仓(一仓)', '三亚维达(二仓)', '000000') then d.costAmount
else 0
end
) as '公司仓销售成本',
sum(
case
when o.businessType = '客户销售'
and o.outboundWarehouse not in ('永万仓', '三亚百货仓(一仓)', '三亚维达(二仓)', '000000') then d.costAmount
else 0
end
) as '商场仓销售成本'
from
transactionOrderDetailHist as d
join transactionOrderHist as o on d.orderRowId = o.rowId
AND o.businessType in ('调拨送货', '客户销售', '采购入库')
AND o.effectiveTime between date '2026-04-01'
and DATE_ADD(date '2026-04-19', INTERVAL 1 DAY)
) as io2 on io2.group = i.group
left join (
select
1 as 'group',
sum(
case
when warehouse in ('永万仓', '三亚百货仓(一仓)', '三亚维达(二仓)', '000000') then costAmount
else 0
end
) as '公司仓当前库存成本',
sum(costAmount) as '总仓当前库存成本'
from
currentInv
) as bci on bci.group = i.group
I used AI to figure the root cause.
Metabase v0.60.1: Empty string column alias causes component-crash in table visualization
Issue: A native SQL query with a column aliased as "" (empty string) consistently triggers a frontend component-crash error. The query itself executes successfully on the backend (returns data in ~5s and XLSX export works fine), but the table visualization fails to render.
Root Cause: The table visualization component appears unable to handle empty string column names. Changing the alias from "" to a non-empty value (e.g., "Type" or "Summary") immediately resolves the crash.
Additional Context: We initially suspected NULL values from LEFT JOIN aggregations and wrapped columns with COALESCE(..., 0). While this improved query performance dramatically (from ~99s to ~4.7s), it did not fix the frontend crash. The empty alias was the actual trigger.
Workaround/Solution: Ensure all columns in native SQL queries have non-empty aliases when using table visualization.
Environment: Metabase v0.60.1, Chrome 147, macOS.
I think your bigger problem is using an unsupported version of MySQL. 5.7 is EoL.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
