use of datawave.query.config.ShardQueryConfiguration in project datawave by NationalSecurityAgency.
the class AllTermsIndexedVisitorTest method beforeClass.
@BeforeClass
public static void beforeClass() {
helper = new MockMetadataHelper();
helper.setIndexedFields(indexedFields);
config = new ShardQueryConfiguration();
}
use of datawave.query.config.ShardQueryConfiguration in project datawave by NationalSecurityAgency.
the class GeoWaveFunctionsDescriptorTest method testAntiMeridianSpanningMultipolygon.
@Test
public void testAntiMeridianSpanningMultipolygon() throws Exception {
String query = "geowave:intersects(GEO_FIELD, 'MULTIPOLYGON(((160 60, 180 60, 180 70, 160 70, 160 60)), ((-180 70, -180 60, -175 60, -175 70, -180 70)))')";
ShardQueryConfiguration config = new ShardQueryConfiguration();
// DEFAULT, maxEnvelopes = 4
String defaultExpandedQuery = convertFunctionToIndexQuery(query, config);
Assert.assertEquals(expandedWkt.get(0), defaultExpandedQuery);
// maxEnvelopes = 1
config.setGeoWaveMaxEnvelopes(1);
String oneEnvelopeExpandedQuery = convertFunctionToIndexQuery(query, config);
Assert.assertEquals(expandedWkt.get(1), oneEnvelopeExpandedQuery);
// maxEnvelopes = 2
config.setGeoWaveMaxEnvelopes(2);
String twoEnvelopesExpandedQuery = convertFunctionToIndexQuery(query, config);
Assert.assertEquals(expandedWkt.get(2), twoEnvelopesExpandedQuery);
// Test the the default number of envelopes produces a different expanded query than the single envelope expansion
Assert.assertNotEquals(defaultExpandedQuery, oneEnvelopeExpandedQuery);
// Test that the default number of envelopes produces the same expanded query as the two envelope expansion
Assert.assertEquals(defaultExpandedQuery, twoEnvelopesExpandedQuery);
}
use of datawave.query.config.ShardQueryConfiguration in project datawave by NationalSecurityAgency.
the class CompositeIndexTest method getResultsIterator.
private Iterator getResultsIterator(String queryString, ShardQueryLogic logic) throws Exception {
MultivaluedMap<String, String> params = new MultivaluedMapImpl<>();
params.putSingle(QUERY_STRING, queryString);
params.putSingle(QUERY_NAME, "geoQuery");
params.putSingle(QUERY_LOGIC_NAME, "EventQueryLogic");
params.putSingle(QUERY_PERSISTENCE, "PERSISTENT");
params.putSingle(QUERY_AUTHORIZATIONS, AUTHS);
params.putSingle(QUERY_EXPIRATION, "20200101 000000.000");
params.putSingle(QUERY_BEGIN, BEGIN_DATE);
params.putSingle(QUERY_END, END_DATE);
QueryParameters queryParams = new QueryParametersImpl();
queryParams.validate(params);
Set<Authorizations> auths = new HashSet<>();
auths.add(new Authorizations(AUTHS));
Query query = new QueryImpl();
query.initialize(USER, Arrays.asList(USER_DN), null, queryParams, null);
ShardQueryConfiguration config = ShardQueryConfiguration.create(logic, query);
logic.initialize(config, instance.getConnector("root", PASSWORD), query, auths);
logic.setupQuery(config);
return logic.getTransformIterator(query);
}
use of datawave.query.config.ShardQueryConfiguration in project datawave by NationalSecurityAgency.
the class GeoSortedQueryDataTest method initializeGeoQuery.
private Iterator<QueryData> initializeGeoQuery() throws Exception {
MultivaluedMap<String, String> params = new MultivaluedMapImpl<>();
params.putSingle(QUERY_STRING, "geowave:intersects(" + FIELD_NAME + ", '" + QUERY_WKT + "')");
params.putSingle(QUERY_NAME, "geoQuery");
params.putSingle(QUERY_LOGIC_NAME, "EventQueryLogic");
params.putSingle(QUERY_PERSISTENCE, "PERSISTENT");
params.putSingle(QUERY_AUTHORIZATIONS, AUTHS);
params.putSingle(QUERY_EXPIRATION, "20200101 000000.000");
params.putSingle(QUERY_BEGIN, BEGIN_DATE);
params.putSingle(QUERY_END, END_DATE);
QueryParameters queryParams = new QueryParametersImpl();
queryParams.validate(params);
Set<Authorizations> auths = new HashSet<>();
auths.add(new Authorizations(AUTHS));
Query query = new QueryImpl();
query.initialize(USER, Arrays.asList(USER_DN), null, queryParams, null);
ShardQueryConfiguration config = ShardQueryConfiguration.create(logic, query);
logic.initialize(config, instance.getConnector("root", PASSWORD), query, auths);
logic.setupQuery(config);
return config.getQueries();
}
use of datawave.query.config.ShardQueryConfiguration in project datawave by NationalSecurityAgency.
the class MultiValueCompositeIndexTest method getQueryRangesIterator.
private Iterator getQueryRangesIterator(String queryString, ShardQueryLogic logic) throws Exception {
MultivaluedMap<String, String> params = new MultivaluedMapImpl<>();
params.putSingle(QUERY_STRING, queryString);
params.putSingle(QUERY_NAME, "geoQuery");
params.putSingle(QUERY_LOGIC_NAME, "EventQueryLogic");
params.putSingle(QUERY_PERSISTENCE, "PERSISTENT");
params.putSingle(QUERY_AUTHORIZATIONS, AUTHS);
params.putSingle(QUERY_EXPIRATION, "20200101 000000.000");
params.putSingle(QUERY_BEGIN, BEGIN_DATE);
params.putSingle(QUERY_END, END_DATE);
QueryParameters queryParams = new QueryParametersImpl();
queryParams.validate(params);
Set<Authorizations> auths = new HashSet<>();
auths.add(new Authorizations(AUTHS));
Query query = new QueryImpl();
query.initialize(USER, Arrays.asList(USER_DN), null, queryParams, null);
ShardQueryConfiguration config = ShardQueryConfiguration.create(logic, query);
logic.initialize(config, instance.getConnector("root", PASSWORD), query, auths);
logic.setupQuery(config);
return config.getQueries();
}
Aggregations