嗨,我正在尝试使用U-SQL加入,三个输入文件都是文本文件,现在我得到了错误。我是个新手。当我试图加入的时候,它抛出了下面的错误。我已经尝试过了:使用Extractors.Csv(encoding:System.Text.Encoding.GetEncoding("Windows-1252"));,但出现了相同的错误。你能帮助修复这个错误吗:
{
"errorCode": "2703",
"message": "Error Id: E_CSC_USER_SYNTAXERROR, Error Message: syntax error. Expected one of: identifier quoted-identifier variable . Error Id: E_CSC_USER_RESERVEDKEYWORDASIDENTIFIER, Error Message: Reserved keyword FROM is used as an identifier.. Error Id: E_CSC_USER_SYNTAXERROR, Error Message: syntax error. Expected one of: '(' ANTISEMIJOIN BROADCASTLEFT BROADCASTRIGHT CROSS EXCEPT FULL FULLCROSS GROUP HASH HAVING INDEXLOOKUP INNER INTERSECT JOIN LEFT LOOP MERGE ON OPTION ORDER OUTER OUTER UNION PAIR PIVOT PRESORT RIGHT SAMPLE SEMIJOIN SERIAL UNION UNPIVOT WHERE WITH ';' ')' ',' . ",
"failureType": "UserError",
"target": "U-SQL1"
}U-SQL脚本
@customerData = EXTRACT
Customerid string,
Name string,
City string,
State string,
Country string,
Account_Created string
FROM "/a_test/customer_data/[dbo].[customerData].txt"
USING Extractors.Csv(skipFirstNRows:1);
@productData = EXTRACT
Product string,
Price string,
FROM "/a_test/product_data/[dbo].[productData].txt"
USING Extractors.Csv(skipFirstNRows:1);
@transactionData = EXTRACT
Transaction_date string,
Product string,
Payment_Type string,
Customerid string,
Name string,
City string,
Account_Created string,
Last_Login string,
Latitude string,
Longitude string
FROM "/a_test/transaction_data/[dbo].[transactionData].txt"
USING Extractors.Csv(skipFirstNRows:1);
@result =
SELECT
t.Customerid,
t.Transaction_date,
t.Product,
t.Payment_Type,
t.Name,
t.City,
c.State,
c.Country,
p.Price,
t.Latitude,
t.Longitude
FROM @transactionData AS t
INNER JOIN @productData AS p on t.Product = p.Product
INNER JOIN @customerData AS c on t.Customerid = c.Customerid
order by t.Customerid;
OUTPUT @result TO "/a_test/final_output"
USING Outputters.Csv();发布于 2018-11-27 20:47:19
@productData = EXTRACT
Product string,
Price string,
FROM "/a_test/product_data/[dbo].[productData].txt"
USING Extractors.Csv(skipFirstNRows:1);您在Price字符串列后有一个逗号(,),您应该删除该逗号。
https://stackoverflow.com/questions/53499158
复制相似问题