【发布时间】:2016-12-01 13:51:47
【问题描述】:
我正在尝试创建一个 USQL 作业并从要从中检索它们的 CSV 中定义我的列,但是我总是在 JOIN 部分遇到问题,因为我匹配的列属于不同类型。这很奇怪,因为我已将它们定义为同一类型。查看问题所在的屏幕截图:
这是完整的 USQL:
@guestCheck =
EXTRACT GuestCheckID int,
POSCheckGUID Guid,
POSCheckNumber int?,
OwnerEmployeeID int,
CreatedDateTime DateTime?,
ClosedDateTime DateTime?,
TicketReference string,
CheckAmount decimal?,
POSTerminalID int,
CheckState string,
LocationID int?,
TableID int?,
Covers int?,
PostedDateTime DateTime?,
OrderChannelID int?,
MealPeriodID int?,
RVCLocationID int?,
ReopenedTerminalID int?,
ReopenedEmployeeID int?,
ReopenedDateTime DateTime?,
ClosedBusDate int?,
PostedBusDate int?,
BusHour byte?,
TaxExempt bool?,
TaxExemptReference string
FROM "/GuestCheck/GuestCheck-incomplete.csv"
USING Extractors.Csv();
@guestCheckAncillaryAmount =
EXTRACT CheckAncillaryAmountID int,
GuestCheckID int,
GuestCheckItemID int?,
AncillaryAmountTypeID int,
Amount decimal,
FirstDetail int?,
LastDetail int?,
IsReturn bool?,
ReturnReasonID int?,
AncillaryReasonID int?,
AncillaryNote string,
ClosedBusDate int?,
PostedBusDate int?,
BusHour byte?,
LocationID int?,
RVCLocationID int?,
IsDelisted bool?,
Exempted bool?
FROM "/GuestCheck/GuestCheckAncillaryAmount.csv"
USING Extractors.Csv();
@ancillaryAmountType =
EXTRACT AncillaryAmountTypeID int,
AncillaryAmountCategoryID int,
CustomerID int,
CheckTitle string,
ReportTitle string,
Percentage decimal,
FixedAmount decimal,
IncludeOnCheck bool,
AutoCalculate bool,
StoreAtCheckLevel bool?,
DateTimeModified DateTime?,
CheckTitleToken Guid?,
ReportTitleToken Guid?,
DeletedFlag bool,
MaxUsageQty int?,
ApplyToBasePriceOnly bool?,
Exclusive bool,
IsItem bool,
MinValue decimal,
MaxValue decimal,
ItemGroupID int?,
LocationID int,
ApplicationOrder int?,
RequiresReason bool,
Exemptable bool?
FROM "/GuestCheck/AncillaryAmountType.csv"
USING Extractors.Csv();
@read =
SELECT t.POSCheckGUID,
t.POSCheckNumber,
t.CheckAmount,
aat.AncillaryAmountTypeID,
aat.CheckTitle,
gcd.Amount
FROM @guestCheck AS t
LEFT JOIN
@guestCheckAncillaryAmount AS gcd
ON t.GuestCheckID == gcd.GuestCheckID
LEFT JOIN
@ancillaryAmountType AS aat
ON gcd.AncillaryAmountTypeID == aat.AncillaryAmountTypeID
WHERE aat.AncillaryAmountCategoryID IN(2, 4, 8);
OUTPUT @read
TO "/GuestCheckOutput/output.csv"
USING Outputters.Csv();
【问题讨论】:
标签: sql analytics azure-data-lake u-sql