对于我通过spark scala从配置单元读取的每一行,我需要创建值A1,A2 ... An作为数据帧的列标题,然后需要按列标题分组并检查逻辑
例如:
在A1
下,我有A1_alpha
行1 = 1,行2的值为0,然后A1_alpha
的行3的值为1,如果是这种情况,那么我需要创建另一行也与-1类似。
最后,我需要构造一行,如果每一列的行值为
a1_alpha. a1_nu a1_alphanumeric
1. 0 1
0. 0. 1
1. 0. 1
-- -- ---
-1. 0. 1. //this is the final I need have as multiple rows
例如:
A1 A2
====== =======
row 1 : A1_alpha, A1_numeric, A1_alphanumeric. A2_alpha, A2_numeric ....
1 0 1 1 1
row 2: 0. 0. 1 0. 1
row 3: 1 0 1 1 1
___________________________________________________________________
-1 0 1 -1 1