【问题标题】:How to remove extra entries from the tuple in apache pig如何从 apache pig 中的元组中删除额外的条目
【发布时间】:2020-02-04 02:07:12
【问题描述】:

如何解决元组中多余的逗号或条目的问题

ab = load "/path/file1.txt" USING PigStorage(',') AS (id1:chararray, id2:chararray, dt:chararray, qty:int);

电流输出:- (F1,S9,12/09/2011,2,,,)

预期输出:- (F1,S9,12/09/2011,2)

我应该对我的 file.txt 或其他内容中的文本进行更改吗?

【问题讨论】:

  • 欢迎来到 Stack Overflow!!!您还可以共享输入文件内容吗?文件.txt

标签: apache-pig


【解决方案1】:

在 LOAD 语句中的单引号('')之间写入路径。

例子:

ab = load '/path/file1.txt' USING PigStorage(',') AS (id1:chararray, id2:chararray, dt:chararray, qty:int);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-04-19
    • 1970-01-01
    • 2022-01-14
    • 2016-12-29
    • 1970-01-01
    • 2016-06-30
    • 1970-01-01
    相关资源
    最近更新 更多