Search in sources :

Example 1 with DateType

use of datawave.data.type.DateType in project datawave by NationalSecurityAgency.

the class ShardQueryConfigurationTest method testGetSetIndexedFieldDataTypes.

@Test
public void testGetSetIndexedFieldDataTypes() {
    Assert.assertEquals("", config.getIndexedFieldDataTypesAsString());
    Set<String> indexedFields = Sets.newHashSet("fieldA", "fieldB");
    Multimap<String, Type<?>> queryFieldsDatatypes = ArrayListMultimap.create();
    queryFieldsDatatypes.put("fieldA", new DateType());
    queryFieldsDatatypes.put("fieldB", new StringType());
    config.setIndexedFields(indexedFields);
    config.setQueryFieldsDatatypes(queryFieldsDatatypes);
    String expected = "fieldA:datawave.data.type.DateType;fieldB:datawave.data.type.StringType;";
    Assert.assertEquals(expected, config.getIndexedFieldDataTypesAsString());
}
Also used : NoOpType(datawave.data.type.NoOpType) StringType(datawave.data.type.StringType) GeometryType(datawave.data.type.GeometryType) DiscreteIndexType(datawave.data.type.DiscreteIndexType) Type(datawave.data.type.Type) DateType(datawave.data.type.DateType) StringType(datawave.data.type.StringType) DateType(datawave.data.type.DateType) Test(org.junit.Test)

Example 2 with DateType

use of datawave.data.type.DateType in project datawave by NationalSecurityAgency.

the class ShardQueryConfigurationTest method testGetSetNormalizedFieldNormalizers.

@Test
public void testGetSetNormalizedFieldNormalizers() {
    Assert.assertEquals("", config.getNormalizedFieldNormalizersAsString());
    Set<String> normalizedFields = Sets.newHashSet("fieldA", "fieldB");
    Multimap<String, Type<?>> normalizedFieldsDatatypes = ArrayListMultimap.create();
    normalizedFieldsDatatypes.put("fieldA", new DateType());
    normalizedFieldsDatatypes.put("fieldB", new StringType());
    config.setIndexedFields(normalizedFields);
    config.setNormalizedFieldsDatatypes(normalizedFieldsDatatypes);
    String expected = "fieldA:datawave.data.type.DateType;fieldB:datawave.data.type.StringType;";
    Assert.assertEquals(expected, config.getNormalizedFieldNormalizersAsString());
}
Also used : NoOpType(datawave.data.type.NoOpType) StringType(datawave.data.type.StringType) GeometryType(datawave.data.type.GeometryType) DiscreteIndexType(datawave.data.type.DiscreteIndexType) Type(datawave.data.type.Type) DateType(datawave.data.type.DateType) StringType(datawave.data.type.StringType) DateType(datawave.data.type.DateType) Test(org.junit.Test)

Aggregations

DateType (datawave.data.type.DateType)2 DiscreteIndexType (datawave.data.type.DiscreteIndexType)2 GeometryType (datawave.data.type.GeometryType)2 NoOpType (datawave.data.type.NoOpType)2 StringType (datawave.data.type.StringType)2 Type (datawave.data.type.Type)2 Test (org.junit.Test)2