【发布时间】:2018-04-28 06:14:09
【问题描述】:
UDT
[SqlUserDefinedType(typeof(StudentHistoryFormatter))]
public struct StudentHistory
{
public StudentHistory(int i, double? score, string status):this()
{
InstitutionId = i;
Score = score;
Status = status;
}
int InstitutionId { get; set; }
double? Score {get; set; }
string Status { get; set; }
public string Value()
{
return string.Format("{0},{1},{2}", InstitutionId, Score, Status);
}
}
为简单起见,我什至没有将类放在命名空间中。 我用 USQL 数据库注册了程序集
USQL
@history =
EXTRACT InstitutionId int,
Score double,
Status string
FROM @"CoreData\Institution\history.csv"
USING Extractors.Csv();
@historyMap =
SELECT InstitutionId,
ARRAY_AGG<StudentHistory>(new StudentHistory(InstitutionId, Score, Status)) AS History
FROM @history
GROUP BY InstitutionId;
错误
严重性代码描述项目文件行抑制状态 错误 E_CSC_USER_INVALIDCOLUMNTYPE:“Microsoft.Analytics.Types.Sql.SqlArray”不能用作列类型。 描述: 列类型必须是受支持的标量、复数或用户定义的类型。 解析度: 确保列类型是受支持的类型。对于用户定义的类型,请确保该类型已注册,类型名称是完全限定的,并且脚本引用了所需的程序集。
【问题讨论】:
-
不知道为什么我对这个问题投了反对票!
-
路过式投票是对 SO 的职业危害。我赞成它来平衡它:)
标签: u-sql