首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >U-SQL联接失败

U-SQL联接失败
EN

Stack Overflow用户
提问于 2018-11-27 19:56:58
回答 1查看 253关注 0票数 0

嗨,我正在尝试使用U-SQL加入,三个输入文件都是文本文件,现在我得到了错误。我是个新手。当我试图加入的时候,它抛出了下面的错误。我已经尝试过了:使用Extractors.Csv(encoding:System.Text.Encoding.GetEncoding("Windows-1252"));,但出现了相同的错误。你能帮助修复这个错误吗:

代码语言:javascript
复制
{
    "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脚本

代码语言:javascript
复制
@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();
EN

回答 1

Stack Overflow用户

发布于 2018-11-27 20:47:19

代码语言:javascript
复制
@productData = EXTRACT 
Product string,
Price string,
FROM "/a_test/product_data/[dbo].[productData].txt"
USING Extractors.Csv(skipFirstNRows:1);

您在Price字符串列后有一个逗号(,),您应该删除该逗号。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53499158

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档