@Test public void testIndexPatternFormatMapping() throws Exception { assertThat( RestUtils.getMapping("pig/pattern-format-2001-10-06").skipHeaders().toString(), is( "pattern-format-2001-10-06=[id=LONG, name=STRING, picture=STRING, timestamp=DATE, url=STRING]")); }
@Test public void testWriteToESWithAliasMapping() throws Exception { assertThat( RestUtils.getMapping("cascading-hadoop/alias").toString(), VERSION.onOrAfter(V_5_X) ? is("alias=[address=TEXT, name=TEXT, picture=TEXT]") : is("alias=[address=STRING, name=STRING, picture=STRING]")); }
@Test public void testWriteToESMapping() throws Exception { assertThat( RestUtils.getMapping("cascading-hadoop/artists").toString(), VERSION.onOrAfter(V_5_X) ? is("artists=[name=TEXT, picture=TEXT, url=TEXT]") : is("artists=[name=STRING, picture=STRING, url=STRING]")); }
@Test public void testIndexPatternMapping() throws Exception { assertThat( RestUtils.getMapping("cascading-hadoop/pattern-12").toString(), VERSION.onOrAfter(V_5_X) ? is("pattern-12=[id=TEXT, name=TEXT, picture=TEXT, url=TEXT]") : is("pattern-12=[id=STRING, name=STRING, picture=STRING, url=STRING]")); }
@Test public void testIndexPatternWithFormatMapping() throws Exception { assertThat( RestUtils.getMapping("cascading-hadoop/pattern-format-2012-10-06").toString(), VERSION.onOrAfter(V_5_X) ? is("pattern-format-2012-10-06=[id=TEXT, name=TEXT, picture=TEXT, ts=DATE, url=TEXT]") : is( "pattern-format-2012-10-06=[id=STRING, name=STRING, picture=STRING, ts=DATE, url=STRING]")); }
@Test public void testTupleMapping() throws Exception { assertThat( RestUtils.getMapping("pig/tupleartists").skipHeaders().toString(), is("tupleartists=[links=STRING, name=STRING]")); }
@Test public void testParentChildMapping() throws Exception { assertThat( RestUtils.getMapping("pig/child").skipHeaders().toString(), is("child=[id=LONG, links=STRING, name=STRING]")); }
@Test public void testUpdateWithIdMapping() throws Exception { assertThat( RestUtils.getMapping("pig/update").skipHeaders().toString(), is("update=[id=LONG, links=STRING, name=STRING]")); }
@Test public void testEmptyComplexStructuresMapping() throws Exception { assertThat( RestUtils.getMapping("pig/emptyconst").skipHeaders().toString(), is("emptyconst=[]")); }
@Test public void testCaseSensitivityMapping() throws Exception { assertThat( RestUtils.getMapping("pig/casesensitivity").skipHeaders().toString(), is("casesensitivity=[Name=STRING, pIctUre=STRING, uRL=STRING]")); }
@Test public void testFieldAliasMapping() throws Exception { assertThat( RestUtils.getMapping("pig/fieldalias").skipHeaders().toString(), is("fieldalias=[@timestamp=DATE, name=STRING, picture=STRING, url=STRING]")); }
@Test public void testTimestampMapping() throws Exception { String mapping = RestUtils.getMapping("pig/timestamp").skipHeaders().toString(); assertThat(mapping, startsWith("timestamp=[name=STRING, org.apache.pig.builtin.todate_")); assertThat(mapping, endsWith("=DATE, url=STRING]")); }