You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Gourav Sengupta <go...@gmail.com> on 2022/03/01 08:54:46 UTC

Re: can dataframe API deal with subquery

Hi,

why would you want to do that?

Regards,
Gourav

On Sat, Feb 26, 2022 at 8:00 AM <ca...@free.fr> wrote:

> such as this table definition:
>
> > desc people;
> +-----------+---------------------------+----------+
> | col_name  |         data_type         | comment  |
> +-----------+---------------------------+----------+
> | name      | string                    |          |
> | born      | date                      |          |
> | sex       | struct<id:int,fm:string>  |          |
> | contact   | map<string,string>        |          |
> | jobs      | array<string>             |          |
> +-----------+---------------------------+----------+
>
> And this sql statement:
>
>   with t1 as (
>   select name,
>   case when sex.id=0 then "female" else "male" end as sex,
>   jobs[1] as lastjob
>   from people)
>   select * from t1 limit 10;
>
>
> how does dataframe run with this kind of subquery?
>
> Thank you.
>
> ---------------------------------------------------------------------
> To unsubscribe e-mail: user-unsubscribe@spark.apache.org
>
>