我构建了两个数据帧.我们如何加入多个Spark数据帧?
例如 :
PersonDf,ProfileDf使用公共列personId作为(键).现在,我们怎样才能有一个数据帧合并PersonDf和ProfileDf?
我是Spark世界的新手。我们如何持久化数据框,以便我们可以在各个组件之间使用它。
我有一个Kafka流,通过该流,我通过Rdd.Tried RegisterAsTempTable生成Dataframe,但是该表在另一个程序中不可访问。
我想通过sqlContext在另一个类中访问此Dataframe,并将查询结果用于进一步的计算。
scala apache-spark spark-streaming apache-spark-sql spark-dataframe
我在Spring启动应用程序中使用H2数据库.但是无法在浏览器中打开http:// localhost:8080/console.My Pom.xml如下:
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.192</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
Spring boot配置:
Springboot配置文件
@Configuration
public class WebConfiguration {
@Bean
ServletRegistrationBean h2servletRegistration(){
ServletRegistrationBean registrationBean = new ServletRegistrationBean( new WebServlet());
registrationBean.addUrlMappings("/console/*");
return registrationBean;
}
}
Run Code Online (Sandbox Code Playgroud)