Skip to content

Commit

Permalink
fix(search): fix mapping builder bug (datahub-project#9062)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-leifker authored Oct 21, 2023
1 parent 4d35a25 commit 63599c9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private static Map<String, Object> getMappingsForField(@Nonnull final Searchable
} else if (fieldType == FieldType.DATETIME) {
mappingForField.put(TYPE, ESUtils.DATE_FIELD_TYPE);
} else if (fieldType == FieldType.OBJECT) {
mappingForField.put(TYPE, ESUtils.DATE_FIELD_TYPE);
mappingForField.put(TYPE, ESUtils.OBJECT_FIELD_TYPE);
} else {
log.info("FieldType {} has no mappings implemented", fieldType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -889,15 +889,17 @@ public void testCountByFilterAfterDelete() throws InterruptedException {
@Test(groups = {"getAggregatedStats"}, dependsOnGroups = {"upsert"})
public void testGetIndexSizes() {
List<TimeseriesIndexSizeResult> result = _elasticSearchTimeseriesAspectService.getIndexSizes();
//CHECKSTYLE:OFF
/*
Example result:
{aspectName=testentityprofile, sizeMb=52.234, indexName=es_timeseries_aspect_service_test_testentity_testentityprofileaspect_v1, entityName=testentity}
{aspectName=testentityprofile, sizeMb=0.208, indexName=es_timeseries_aspect_service_test_testentitywithouttests_testentityprofileaspect_v1, entityName=testentitywithouttests}
*/
// There may be other indices in there from other tests, so just make sure that index for entity + aspect is in there
assertTrue(result.size() > 1);
//CHECKSTYLE:ON
assertTrue(result.size() > 0);
assertTrue(
result.stream().anyMatch(idxSizeResult -> idxSizeResult.getIndexName().equals(
"es_timeseries_aspect_service_test_testentitywithouttests_testentityprofileaspect_v1")));
"es_timeseries_aspect_service_test_testentity_testentityprofileaspect_v1")));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.time.Duration;

public interface SearchTestContainer {
String SEARCH_JAVA_OPTS = "-Xms64m -Xmx384m -XX:MaxDirectMemorySize=368435456";
String SEARCH_JAVA_OPTS = "-Xms446m -Xmx446m -XX:MaxDirectMemorySize=368435456";
Duration STARTUP_TIMEOUT = Duration.ofMinutes(5); // usually < 1min

GenericContainer<?> startContainer();
Expand Down
1 change: 1 addition & 0 deletions smoke-test/tests/containers/containers_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ def test_update_container(frontend_session, ingest_cleanup_data):
"ownerUrn": new_owner,
"resourceUrn": container_urn,
"ownerEntityType": "CORP_USER",
"ownershipTypeUrn": "urn:li:ownershipType:__system__technical_owner"
}
},
}
Expand Down

0 comments on commit 63599c9

Please sign in to comment.