我使用javaHiveContextSpark 执行连接.
大表是1,76Gb,有1亿记录.
第二个表是273Mb,有1000万条记录.
我得到一个JavaSchemaRDD,我打电话count()给它:
String query="select attribute7,count(*) from ft,dt where ft.chiavedt=dt.chiavedt group by attribute7";
JavaSchemaRDD rdd=sqlContext.sql(query);
System.out.println("count="+rdd.count());
Run Code Online (Sandbox Code Playgroud)
如果我强制a broadcastHashJoin (SET spark.sql.autoBroadcastJoinThreshold=290000000)并在5节点上使用5个执行器,其中包含8个核心和20Gb内存,则会在100秒内执行.如果我不强制广播,它将在30秒内执行.
NB表格存储为Parquet文件.