@Test public void testEsSchemaRDD1WriteWithMappingExclude() throws Exception { DataFrame dataFrame = artistsAsDataFrame(); String target = "sparksql-test/scala-basic-write-exclude-mapping"; JavaEsSparkSQL.saveToEs(dataFrame, target, ImmutableMap.of(ES_MAPPING_EXCLUDE, "url")); assertTrue(RestUtils.exists(target)); assertThat(RestUtils.get(target + "/_search?"), not(containsString("url"))); }
@Test public void testEsdataFrame1Write() throws Exception { DataFrame dataFrame = artistsAsDataFrame(); String target = "sparksql-test/scala-basic-write"; JavaEsSparkSQL.saveToEs(dataFrame, target); assertTrue(RestUtils.exists(target)); assertThat(RestUtils.get(target + "/_search?"), containsString("345")); }
@Test public void testEsdataFrame1WriteWithId() throws Exception { DataFrame dataFrame = artistsAsDataFrame(); String target = "sparksql-test/scala-basic-write-id-mapping"; JavaEsSparkSQL.saveToEs(dataFrame, target, ImmutableMap.of(ES_MAPPING_ID, "id")); assertTrue(RestUtils.exists(target)); assertThat(RestUtils.get(target + "/_search?"), containsString("345")); assertThat(RestUtils.exists(target + "/1"), is(true)); }