You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Bob Rumsby <br...@maprtech.com> on 2014/11/19 03:47:11 UTC

REPEATED_CONTAINS syntax

Can someone provide some details on the signature and use of this function?
I'm not sure how/where it is supposed to work. It seems to work only as
part of a condition, but I'm not sure what the requirements are.

(See https://issues.apache.org/jira/browse/DRILL-1727, opened by Tomer.)

Thanks,
Bob

Re: REPEATED_CONTAINS syntax

Posted by Ted Dunning <te...@gmail.com>.
kvgen might help a bit with this.



On Wed, Nov 19, 2014 at 5:22 PM, Neeraja Rentachintala <
nrentachintala@maprtech.com> wrote:

> This applies to array of scalars.
>
>
>
> > On Nov 19, 2014, at 7:39 AM, Andries Engelbrecht <
> aengelbrecht@maprtech.com> wrote:
> >
> > Hao,
> >
> > Does this only apply for arrays? Any similar functionality for maps?
> >
> > Thx
> >
> > Andries
>

Re: REPEATED_CONTAINS syntax

Posted by Neeraja Rentachintala <nr...@maprtech.com>.
This applies to array of scalars.



> On Nov 19, 2014, at 7:39 AM, Andries Engelbrecht <ae...@maprtech.com> wrote:
> 
> Hao,
> 
> Does this only apply for arrays? Any similar functionality for maps?
> 
> Thx
> 
> Andries

Re: REPEATED_CONTAINS syntax

Posted by Andries Engelbrecht <ae...@maprtech.com>.
Hao,

Does this only apply for arrays? Any similar functionality for maps?

Thx

Andries

Re: REPEATED_CONTAINS syntax

Posted by Bob Rumsby <br...@maprtech.com>.
Hao,
Thanks for the information. I opened a new bug about wildcards, which don't
seem to work with this function. Let me know if you have had any success
with other ways to use this function, or if you have good examples to share.

Bob

On Tue, Nov 18, 2014 at 10:43 PM, Hao Zhu <hz...@maprtech.com> wrote:

> a.json:
>
> {"data": ["apple","orange","abc"]}
>
> select repeated_count(data) from  dfs.tmp.`/drilltest/a.json`;
> +------------+
> |   EXPR$0   |
> +------------+
> | 3          |
> +------------+
>
> select repeated_contains(data,'apple') from  dfs.tmp.`/drilltest/a.json`;
> +------------+
> |   EXPR$0   |
> +------------+
> | true       |
> +------------+
>
> select repeated_contains(data,'nothing') from  dfs.tmp.`/drilltest/a.json`;
>
> +------------+
> |   EXPR$0   |
> +------------+
> | false      |
> +------------+
>
> Thanks,
> Hao
>
> On Tue, Nov 18, 2014 at 6:47 PM, Bob Rumsby <br...@maprtech.com> wrote:
>
> > Can someone provide some details on the signature and use of this
> function?
> > I'm not sure how/where it is supposed to work. It seems to work only as
> > part of a condition, but I'm not sure what the requirements are.
> >
> > (See https://issues.apache.org/jira/browse/DRILL-1727, opened by Tomer.)
> >
> > Thanks,
> > Bob
> >
>

Re: REPEATED_CONTAINS syntax

Posted by Hao Zhu <hz...@maprtech.com>.
a.json:

{"data": ["apple","orange","abc"]}

select repeated_count(data) from  dfs.tmp.`/drilltest/a.json`;
+------------+
|   EXPR$0   |
+------------+
| 3          |
+------------+

select repeated_contains(data,'apple') from  dfs.tmp.`/drilltest/a.json`;
+------------+
|   EXPR$0   |
+------------+
| true       |
+------------+

select repeated_contains(data,'nothing') from  dfs.tmp.`/drilltest/a.json`;

+------------+
|   EXPR$0   |
+------------+
| false      |
+------------+

Thanks,
Hao

On Tue, Nov 18, 2014 at 6:47 PM, Bob Rumsby <br...@maprtech.com> wrote:

> Can someone provide some details on the signature and use of this function?
> I'm not sure how/where it is supposed to work. It seems to work only as
> part of a condition, but I'm not sure what the requirements are.
>
> (See https://issues.apache.org/jira/browse/DRILL-1727, opened by Tomer.)
>
> Thanks,
> Bob
>