Examples of toES()


Examples of org.elasticsearch.hadoop.util.FieldAlias.toES()

            // TODO: it's worth benchmarking whether using an index/offset yields significantly better performance
            for (Comparable<?> field : entry.getFields()) {
                if (IS_ES_10) {
                    // check for multi-level alias
                    Object result = data;
                    for (String level : StringUtils.tokenize(alias.toES(field.toString()), ".")) {
                        lookupKey.set(level);
                        result = ((Map) result).get(lookupKey);
                        if (result == null) {
                            break;
                        }
View Full Code Here

Examples of org.elasticsearch.hadoop.util.FieldAlias.toES()

                        }
                    }
                    CascadingUtils.setObject(entry, field, result);
                }
                else {
                    lookupKey.set(alias.toES(field.toString()));
                    CascadingUtils.setObject(entry, field, data.get(lookupKey));
                }
            }
        }
        else {
View Full Code Here

Examples of org.elasticsearch.hadoop.util.FieldAlias.toES()

            // TODO: it's worth benchmarking whether using an index/offset yields significantly better performance
            for (Comparable<?> field : entry.getFields()) {
                if (IS_ES_10) {
                    Object result = data;
                    // check for multi-level alias
                    for (String level : StringUtils.tokenize(alias.toES(field.toString()), ".")) {
                        result = ((Map) result).get(level);
                        if (result == null) {
                            break;
                        }
                    }
View Full Code Here

Examples of org.elasticsearch.hadoop.util.FieldAlias.toES()

                    }
                    entry.setObject(field, result);
                }
                else {
                    //NB: coercion should be applied automatically by the TupleEntry
                    entry.setObject(field, data.get(alias.toES(field.toString())));
                }
            }
        }
        else {
            // no definition means no coercion
View Full Code Here

Examples of org.elasticsearch.hadoop.util.FieldAlias.toES()

    static Collection<String> fieldToAlias(Settings settings, Fields fields) {
        FieldAlias fa = alias(settings);
        List<String> names = asStrings(fields);
        for (int i = 0; i < names.size(); i++) {
            String original = names.get(i);
            String alias = fa.toES(original);
            if (alias != null) {
                names.set(i, alias);
            }
        }
        return names;
View Full Code Here

Examples of org.elasticsearch.hadoop.util.FieldAlias.toES()

    @Test
    public void testFieldMap() throws Exception {
        Properties tableProperties = new Properties();
        tableProperties.put(HiveConstants.MAPPING_NAMES, "timestamp:@timestamp , foo:123foo");
        FieldAlias alias = HiveUtils.alias(new PropertiesSettings(tableProperties));
        assertEquals("@timestamp", alias.toES("timestamp"));
        assertEquals("123foo", alias.toES("foo"));
        assertEquals("bar", alias.toES("BaR"));
    }

    @Test
View Full Code Here

Examples of org.elasticsearch.hadoop.util.FieldAlias.toES()

    public void testFieldMap() throws Exception {
        Properties tableProperties = new Properties();
        tableProperties.put(HiveConstants.MAPPING_NAMES, "timestamp:@timestamp , foo:123foo");
        FieldAlias alias = HiveUtils.alias(new PropertiesSettings(tableProperties));
        assertEquals("@timestamp", alias.toES("timestamp"));
        assertEquals("123foo", alias.toES("foo"));
        assertEquals("bar", alias.toES("BaR"));
    }

    @Test
    public void testFieldMapWithColumns() throws Exception {
View Full Code Here

Examples of org.elasticsearch.hadoop.util.FieldAlias.toES()

        Properties tableProperties = new Properties();
        tableProperties.put(HiveConstants.MAPPING_NAMES, "timestamp:@timestamp , foo:123foo");
        FieldAlias alias = HiveUtils.alias(new PropertiesSettings(tableProperties));
        assertEquals("@timestamp", alias.toES("timestamp"));
        assertEquals("123foo", alias.toES("foo"));
        assertEquals("bar", alias.toES("BaR"));
    }

    @Test
    public void testFieldMapWithColumns() throws Exception {
        Properties tableProperties = new Properties();
View Full Code Here

Examples of org.elasticsearch.hadoop.util.FieldAlias.toES()

    public void testFieldMapWithColumns() throws Exception {
        Properties tableProperties = new Properties();
        tableProperties.put(HiveConstants.MAPPING_NAMES, "timestamp:@timestamp , foo:123foo");
        tableProperties.put(HiveConstants.COLUMNS, "id,name,timestamp,foo");
        FieldAlias alias = HiveUtils.alias(new PropertiesSettings(tableProperties));
        assertEquals("@timestamp", alias.toES("timestamp"));
        assertEquals("123foo", alias.toES("foo"));
        assertEquals("bar", alias.toES("BaR"));
    }

    @Test
View Full Code Here

Examples of org.elasticsearch.hadoop.util.FieldAlias.toES()

        Properties tableProperties = new Properties();
        tableProperties.put(HiveConstants.MAPPING_NAMES, "timestamp:@timestamp , foo:123foo");
        tableProperties.put(HiveConstants.COLUMNS, "id,name,timestamp,foo");
        FieldAlias alias = HiveUtils.alias(new PropertiesSettings(tableProperties));
        assertEquals("@timestamp", alias.toES("timestamp"));
        assertEquals("123foo", alias.toES("foo"));
        assertEquals("bar", alias.toES("BaR"));
    }

    @Test
    public void testColumnToAlias() throws Exception {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.