join in a dataframe spark java

前端 未结 2 1955
长发绾君心
长发绾君心 2021-02-09 11:57

First of all, thank you for the time in reading my question.

My question is the following: In Spark with Java, i load in two dataframe the data of two csv files.

2条回答
  •  被撕碎了的回忆
    2021-02-09 12:42

    First, thank you very much for your response.

    I have tried both of my solutions but none of them work, I get the following error: The method dfairport_city_state (String) is undefined for the type ETL_Airport

    I can not access a specific column of the dataframe for join.

    EDIT: Already got to do the join, I put here the solution in case someone else helps;)

    Thanks for everything and best regards

    //Join de tablas en las que comparten ciudad
    Dataset  joined = dfairport.join(dfairport_city_state, dfairport.col("leg_city").equalTo(dfairport_city_state.col("city")));
    

提交回复
热议问题