Java Code Examples for org.elasticsearch.hadoop.cfg.ConfigurationOptions#ES_WRITE_OPERATION

The following examples show how to use org.elasticsearch.hadoop.cfg.ConfigurationOptions#ES_WRITE_OPERATION . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractPigSaveJsonTest.java    From elasticsearch-hadoop with Apache License 2.0 5 votes vote down vote up
@Test
public void testCreateWithId() throws Exception {
    String script =
            "REGISTER "+ Provisioner.ESHADOOP_TESTING_JAR + ";" +
            loadSource() +
            "STORE A INTO '"+resource("json-pig-createwithid", "data", VERSION)+"' USING org.elasticsearch.hadoop.pig.EsStorage('"
                            + ConfigurationOptions.ES_WRITE_OPERATION + "=create','"
                            + ConfigurationOptions.ES_MAPPING_ID + "=number',"
                            + "'es.input.json=true');";
    pig.executeScript(script);
}
 
Example 2
Source File: AbstractPigSaveJsonTest.java    From elasticsearch-hadoop with Apache License 2.0 5 votes vote down vote up
@Test(expected = Exception.class)
public void testUpdateWithoutId() throws Exception {
    String script =
            "REGISTER "+ Provisioner.ESHADOOP_TESTING_JAR + ";" +
            loadSource() +
            "STORE A INTO '"+resource("json-pig-updatewoid", "data", VERSION)+"' USING org.elasticsearch.hadoop.pig.EsStorage('"
                            + ConfigurationOptions.ES_WRITE_OPERATION + "=update',"
                            + "'es.input.json=true');";
    pig.executeScript(script);
}
 
Example 3
Source File: AbstractPigSaveJsonTest.java    From elasticsearch-hadoop with Apache License 2.0 5 votes vote down vote up
@Test
public void testUpdateWithId() throws Exception {
    String script =
            "REGISTER "+ Provisioner.ESHADOOP_TESTING_JAR + ";" +
            loadSource() +
            "STORE A INTO '"+resource("json-pig-update", "data", VERSION)+"' USING org.elasticsearch.hadoop.pig.EsStorage('"
                            + ConfigurationOptions.ES_WRITE_OPERATION + "=upsert','"
                            + ConfigurationOptions.ES_MAPPING_ID + "=number',"
                            + "'es.input.json=true');";
    pig.executeScript(script);
}
 
Example 4
Source File: AbstractPigSaveJsonTest.java    From elasticsearch-hadoop with Apache License 2.0 5 votes vote down vote up
@Test(expected = EsHadoopIllegalStateException.class)
public void testUpdateWithoutUpsert() throws Exception {
    String script =
            "REGISTER "+ Provisioner.ESHADOOP_TESTING_JAR + ";" +
            loadSource() +
            "STORE A INTO '"+resource("json-pig-updatewoupsert", "data", VERSION)+"' USING org.elasticsearch.hadoop.pig.EsStorage('"
                            + ConfigurationOptions.ES_WRITE_OPERATION + "=update','"
                            + ConfigurationOptions.ES_MAPPING_ID + "=number',"
                            + "'es.input.json=true');";
    pig.executeScript(script);
}
 
Example 5
Source File: AbstractPigSaveTest.java    From elasticsearch-hadoop with Apache License 2.0 5 votes vote down vote up
@Test
public void testCreateWithId() throws Exception {
    String script =
            "REGISTER "+ Provisioner.ESHADOOP_TESTING_JAR + ";" +
            loadArtistSource() +
            "B = FOREACH A GENERATE id, name, TOBAG(url, picture) AS links;" +
            "STORE B INTO '"+resource("pig-createwithid", "data", VERSION)+"' USING org.elasticsearch.hadoop.pig.EsStorage('"
                            + ConfigurationOptions.ES_WRITE_OPERATION + "=create','"
                            + ConfigurationOptions.ES_MAPPING_ID + "=id');";
    pig.executeScript(script);
}
 
Example 6
Source File: AbstractPigSaveTest.java    From elasticsearch-hadoop with Apache License 2.0 5 votes vote down vote up
@Test(expected = Exception.class)
public void testUpdateWithoutId() throws Exception {
    String script =
            "REGISTER "+ Provisioner.ESHADOOP_TESTING_JAR + ";" +
            loadArtistSource() +
            "B = FOREACH A GENERATE id, name, TOBAG(url, picture) AS links;" +
            "STORE B INTO '"+resource("pig-updatewoid", "data", VERSION)+"' USING org.elasticsearch.hadoop.pig.EsStorage('"
                            + ConfigurationOptions.ES_WRITE_OPERATION + "=update');";
    pig.executeScript(script);
}
 
Example 7
Source File: AbstractPigSaveTest.java    From elasticsearch-hadoop with Apache License 2.0 5 votes vote down vote up
@Test
public void testUpdateWithId() throws Exception {
    String script =
            "REGISTER "+ Provisioner.ESHADOOP_TESTING_JAR + ";" +
            loadArtistSource() +
            "B = FOREACH A GENERATE id, name, TOBAG(url, picture) AS links;" +
            "STORE B INTO '"+resource("pig-update", "data", VERSION)+"' USING org.elasticsearch.hadoop.pig.EsStorage('"
                            + ConfigurationOptions.ES_WRITE_OPERATION + "=upsert','"
                            + ConfigurationOptions.ES_MAPPING_ID + "=id');";
    pig.executeScript(script);
}
 
Example 8
Source File: AbstractPigSaveTest.java    From elasticsearch-hadoop with Apache License 2.0 5 votes vote down vote up
@Test(expected = EsHadoopIllegalStateException.class)
public void testUpdateWithoutUpsert() throws Exception {
    String script =
            "REGISTER "+ Provisioner.ESHADOOP_TESTING_JAR + ";" +
            loadArtistSource() +
            "B = FOREACH A GENERATE id, name, TOBAG(url, picture) AS links;" +
            "STORE B INTO '"+resource("pig-updatewoupsert", "data", VERSION)+"' USING org.elasticsearch.hadoop.pig.EsStorage('"
                            + ConfigurationOptions.ES_WRITE_OPERATION + "=update','"
                            + ConfigurationOptions.ES_MAPPING_ID + "=id');";
    pig.executeScript(script);
}