Re: how to create all possible combinations from an array? how to join and explode row array?

2018-03-30 Thread Andy Davidson
t;).select("tbl1.b", "tbl2.b").distinct.show() > > +-+-+ > | b| b| > +-+-+ > | blue| red| > | red| blue| > | red| red| > | blue| blue| > |green|green| > +-+-+ > > > > From: Andy Davidson <a...@santacruzinte

Re: how to create all possible combinations from an array? how to join and explode row array?

2018-03-30 Thread Yong Zhang
| |sam |[gree] |[[gree,gree]] | +++- Yong From: Andy Davidson <a...@santacruzintegration.com> Sent: Friday, March 30, 2018 8:58 PM To: Andy Davidson; user Subject: Re: how to create all possible com

Re: how to create all possible combinations from an array? how to join and explode row array?

2018-03-30 Thread Brandon Geise
blue| red| | red| blue| | red| red| | blue| blue| |green|green| +-+-+ From: Andy Davidson <a...@santacruzintegration.com> Date: Friday, March 30, 2018 at 8:58 PM To: Andy Davidson <a...@santacruzintegration.com>, user <user@spark.apache.org> Subject: Re: how to create all possible

Re: how to create all possible combinations from an array? how to join and explode row array?

2018-03-30 Thread Andy Davidson
park" <user@spark.apache.org> Subject: how to create all possible combinations from an array? how to join and explode row array? > I have a dataframe and execute df.groupBy(³xyzy²).agg( collect_list(³abc²) > > This produces a column of type array. Now for each row I want to create

how to create all possible combinations from an array? how to join and explode row array?

2018-03-30 Thread Andy Davidson
I have a dataframe and execute df.groupBy(³xyzy²).agg( collect_list(³abc²) This produces a column of type array. Now for each row I want to create a multiple pairs/tuples from the array so that I can create a contingency table. Any idea how I can transform my data so that call crosstab() ? The