This snippet will not work in Elasticsearch 6.x. The invocation of schema_data.saveAsNewAPIHadoopFile() will result in the following message:
Rejecting mapping update to [agile_data_science] as the final mapping would have more than 1 type: [executives, test];
You can work around the problem by either downgrading Elasticsearch to 5.x or saving to the same type in the previous example (test).
See also: https://www.elastic.co/blog/index-type-parent-child-join-now-future-in-elasticsearch as well as this issue: https://github.com/rjurney/Agile_Data_Code_2/issues/68
Share this highlighthttp://www.safaribooksonline.com/a/agile-data-science/20494828/