Commit e181131d by Suma Shivaprasad

ATLAS-396 Creating an entity with non-existing type results in Unable to…

ATLAS-396 Creating an entity with non-existing type results in Unable to deserialize json error (guptaneeru via sumasai)
parent 648c8d8f
...@@ -7,12 +7,13 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset ...@@ -7,12 +7,13 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset
ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags) ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags)
ALL CHANGES: ALL CHANGES:
ATLAS_396 Creating an entity with non-existing type results in "Unable to deserialize json" error (guptaneeru via sumasai)
ATLAS-318 Config file conatining API endpoint + all api calls to be centralized (sanjayp via sumasai) ATLAS-318 Config file conatining API endpoint + all api calls to be centralized (sanjayp via sumasai)
ATLAS-471 Atlas Server could run out of memory due to Scala memory leak (yhemanth via sumasai) ATLAS-471 Atlas Server could run out of memory due to Scala memory leak (yhemanth via sumasai)
ATLAS-486 Updated pom.xml to fix scm url and upgrade plugin (sneethiraj via sumasai) ATLAS-486 Updated pom.xml to fix scm url and upgrade plugin (sneethiraj via sumasai)
ATLAS-457 Upgrade to 0.9 version of Kafka dependency (yhemanth via shwethags) ATLAS-457 Upgrade to 0.9 version of Kafka dependency (yhemanth via shwethags)
ATLAS-398 Delete trait that exists but not linked to entity results in "400 Bad request". It should result "404 not found" (ndjouhr via shwethags) ATLAS-398 Delete trait that exists but not linked to entity results in "400 Bad request". It should result "404 not found" (ndjouhr via shwethags)
ATLAS-287: UI: GUID on table details page ATLAS-287 UI: GUID on table details page (anilsg via sumasai)
ATLAS-372 Expose entity deletion through REST API (dkantor via shwethags) ATLAS-372 Expose entity deletion through REST API (dkantor via shwethags)
ATLAS-452 Exceptions while running HiveHookIT#testAlterTableRename (shwethags) ATLAS-452 Exceptions while running HiveHookIT#testAlterTableRename (shwethags)
ATLAS-388 UI : On creating Tag, the page to be reset for creating new Tag (Anilg via shwethags) ATLAS-388 UI : On creating Tag, the page to be reset for creating new Tag (Anilg via shwethags)
......
...@@ -309,11 +309,11 @@ public class DefaultMetadataService implements MetadataService { ...@@ -309,11 +309,11 @@ public class DefaultMetadataService implements MetadataService {
instances[index] = typedInstrance; instances[index] = typedInstrance;
} }
return instances; return instances;
} catch(ValueConversionException e) { } catch(ValueConversionException | TypeNotFoundException e) {
throw e; throw e;
} catch (Exception e) { // exception from deserializer } catch (Exception e) { // exception from deserializer
LOG.error("Unable to deserialize json={}", entityInstanceDefinition, e); LOG.error("Unable to deserialize json={}", entityInstanceDefinition, e);
throw new IllegalArgumentException("Unable to deserialize json"); throw new IllegalArgumentException("Unable to deserialize json", e);
} }
} }
......
...@@ -165,6 +165,17 @@ public class DefaultMetadataServiceTest { ...@@ -165,6 +165,17 @@ public class DefaultMetadataServiceTest {
entity.set("type", "VARCHAR(32)"); entity.set("type", "VARCHAR(32)");
return entity; return entity;
} }
@Test(expectedExceptions = TypeNotFoundException.class)
public void testCreateEntityWithUnknownDatatype() throws Exception {
Referenceable entity = new Referenceable("Unknown datatype");
String dbName = RandomStringUtils.randomAlphanumeric(10);
entity.set("name", dbName);
entity.set("description", "us db");
createInstance(entity);
Assert.fail(TypeNotFoundException.class.getSimpleName() +" was expected but none thrown.");
}
@Test @Test
public void testCreateEntityWithUniqueAttribute() throws Exception { public void testCreateEntityWithUniqueAttribute() throws Exception {
//name is the unique attribute //name is the unique attribute
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment