提问人:jhowe 提问时间:9/21/2023 更新时间:9/21/2023 访问量:22
Dremio IllegalStateException:不允许聚合函数“single_value”中的工作区变量“value”具有可变长度类型
Dremio IllegalStateException: Workspace variable 'value' in aggregation function 'single_value' is not allowed to have variable length type
问:
我有一个从ERP应用程序(使用SQL Server)获取的查询,我正在尝试将其转换为Dremio。它只是将来自各种视图的描述字段文本(NVARCHAR,各种长度)合并在一起。如何通过标题中的此错误消息?我已经尝试了各种方法,例如在源视图、子查询中将 CAST 转换为 VARCHAR,但似乎没有任何效果......
(CAST((
SELECT T.NAME
FROM DIMATTRIBUTEBANKACCOUNTTABLE T
WHERE T2.VIEWNAME = 'DimAttributeBankAccountTable'
AND T.RECID = T1.ENTITYINSTANCE
UNION ALL
SELECT T.NAME
FROM DIMATTRIBUTEOMBUSINESSUNIT T
WHERE T2.VIEWNAME = 'DimAttributeOMBusinessUnit'
AND T.RECID = T1.ENTITYINSTANCE
UNION ALL
SELECT T.NAME
FROM DIMATTRIBUTECUSTGROUP T
WHERE T2.VIEWNAME = 'DimAttributeCustGroup'
AND T.RECID = T1.ENTITYINSTANCE
UNION ALL
SELECT T.NAME
FROM DIMATTRIBUTECUSTTABLE T
WHERE T2.VIEWNAME = 'DimAttributeCustTable'
AND T.RECID = T1.ENTITYINSTANCE
UNION ALL
SELECT T.NAME
FROM DIMATTRIBUTEOMDEPARTMENT T
WHERE T2.VIEWNAME = 'DimAttributeOMDepartment'
AND T.RECID = T1.ENTITYINSTANCE
UNION ALL
SELECT T.NAME
FROM DIMATTRIBUTEASSETGROUP T
WHERE T2.VIEWNAME = 'DimAttributeAssetGroup'
AND T.RECID = T1.ENTITYINSTANCE
UNION ALL
SELECT T.NAME
FROM DIMATTRIBUTEASSETTABLE T
WHERE T2.VIEWNAME = 'DimAttributeAssetTable'
AND T.RECID = T1.ENTITYINSTANCE
UNION ALL
SELECT T.NAME
FROM DIMATTRIBUTEASSETLEASELEASEDETAILS T
WHERE T2.VIEWNAME = 'DimAttributeAssetLeaseLeaseDetails'
AND T.RECID = T1.ENTITYINSTANCE
UNION ALL
SELECT T.NAME
FROM DIMATTRIBUTECOMPANYINFO T
WHERE T2.VIEWNAME = 'DimAttributeCompanyInfo'
AND T.RECID = T1.ENTITYINSTANCE
UNION ALL
SELECT T.NAME
FROM DIMATTRIBUTEMAINACCOUNT T
WHERE T2.VIEWNAME = 'DimAttributeMainAccount'
AND T.RECID = T1.ENTITYINSTANCE
UNION ALL
SELECT T.NAME
FROM DIMATTRIBUTEVENDGROUP T
WHERE T2.VIEWNAME = 'DimAttributeVendGroup'
AND T.RECID = T1.ENTITYINSTANCE
UNION ALL
SELECT T.NAME
FROM DIMATTRIBUTEVENDTABLE T
WHERE T2.VIEWNAME = 'DimAttributeVendTable'
AND T.RECID = T1.ENTITYINSTANCE
UNION ALL
SELECT T.NAME
FROM DIMATTRIBUTEHCMWORKER T
WHERE T2.VIEWNAME = 'DimAttributeHcmWorker'
AND T.RECID = T1.ENTITYINSTANCE
) AS VARCHAR(60))
) AS DESCRIPTION
尝试将 CAST(T.NAME AS VARCHAR(60)) 添加到子查询,但未解决错误。
答: 暂无答案
评论