我在创建表时考虑了documentation,但到目前为止没有提到示例,如何在创建表时添加外键。另外,我也检查了Alter语句的文档,但同样适用于此
CREATE TABLE Brand (
BrandId int,
Name string,
AddressId int,
SuperAdminDetails string,
CONSTRAINT FK_Address FOREIGN KEY (AddressId) REFERENCES Address(AddressId) ,
INDEX Brand_idx CLUSTERED (BrandId ASC)
PARTITIONED BY HASH (BrandId)
);
// ALTER TABLE Brand ADD CONSTRAINT FK_Address FOREIGN KEY (AddressId) REFERENCES Address(AddressId) ;
执行USQL以上时出错
答案 0 :(得分:1)
根据documentation的U-SQL目前不支持外键。如果您需要此功能,请考虑在Azure SQL数据库(支持外键)中托管数据,并使用federated queries查询其所在的数据。或者考虑提出反馈请求:
https://feedback.azure.com/forums/327234-data-lake/filters/hot?page=2