You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by jamal sasha <ja...@gmail.com> on 2013/10/02 21:59:19 UTC
Accessig paritcular folder
Hi,
I have data in this one folder like following:
data-------shard1---d1_1
| |_d2_1
Lshard2---d1_1
| |_d2_2
Lshard3---d1_1
| |_d2_3
Lshard4---d1_1
|_d2_4
Now, I want to search something in d1 (and excluding all the d2's) in it.
How do i do this in pig?
Thanks
Re: Accessig paritcular folder
Posted by Alan Gates <ga...@hortonworks.com>.
For any Pig loader that reads files from HDFS, filenames are passed directly to HDFS. This means HDFS style globs are supported, which means the answer to your question depends on the version of HDFS you have. For your version of Hadoop, take a look at the documentation for FileSystem.globStatus. It will explain the supported globs. Based on the documentation from Hadoop 1.2, I believe the following pattern would work:
A = load 'data/shard?/d1_1/[^_d2*]'
Alan.
On Oct 2, 2013, at 12:59 PM, jamal sasha wrote:
> Hi,
> I have data in this one folder like following:
>
> data-------shard1---d1_1
> | |_d2_1
> Lshard2---d1_1
> | |_d2_2
> Lshard3---d1_1
> | |_d2_3
> Lshard4---d1_1
> |_d2_4
>
>
> Now, I want to search something in d1 (and excluding all the d2's) in it.
> How do i do this in pig?
> Thanks
--
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to
which it is addressed and may contain information that is confidential,
privileged and exempt from disclosure under applicable law. If the reader
of this message is not the intended recipient, you are hereby notified that
any printing, copying, dissemination, distribution, disclosure or
forwarding of this communication is strictly prohibited. If you have
received this communication in error, please contact the sender immediately
and delete it from your system. Thank You.