0

This is dataframe i created from json file in spark (scala)

| A | B | C |

| 1 | a | x |

| 2 | b | x |

now i want the following result as my final result,

| A | B | C | D |

| 1 | a | x | 1ax |

| 2 | b | y | 2bx | where ABC and ABCD is a header of json dataset, 1 and 2 are data in that heard respectively . and i want to join or concatenate to get header D with data as 1ax and 2by. any help ??

text
  • 93
  • 1
  • 1
  • 5
  • @zero323 its different – text Jun 30 '16 at 17:45
  • If it is different please check [how to ask](https://stackoverflow.com/help/how-to-ask) and how to create a [mcve] and edit this question accordingly. – zero323 Jun 30 '16 at 17:48
  • @zero323 sir i guess my question is clear. i wanted to create a new header as D. and data for my header D should be mapped by using join or concatenate function. sry if it wasnt clear. i am new to it – text Jun 30 '16 at 17:54
  • No reason to apologize. Instead just provide example input (ascii table is not a one), expected output and your attempts so far. In other words [_pretend you're talking to a busy colleague_](https://stackoverflow.com/help/how-to-ask). For now it looks like you want concatenate columns what is an *exact* duplicate of the linked question. – zero323 Jun 30 '16 at 17:58
  • @zero323 thank u sir .. i was clear does the same rule applies if we need to concatenate using 3 column ?? – text Jun 30 '16 at 18:29

0 Answers0