atlas-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Kantor (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (ATLAS-362) Non-String map keys allowed in type definition but cause error when storing entity
Date Thu, 03 Dec 2015 19:45:10 GMT

     [ https://issues.apache.org/jira/browse/ATLAS-362?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

David Kantor updated ATLAS-362:
-------------------------------
    Description: 
Atlas currently lets you define map types as having an arbitrary type for the key and the
value.  A type with map attribute with a non-string key can be registered without any problem.
 However, if you use anything other than a string as the key type and try to store a value
in the map type you get an exception.  Atlas should either correctly handle non-string keys
or throw an exception when trying to register an entity with a map attributes that uses a
non-string key type.

In our case, we created a type with an attribute of type map<byte,byte> without any
error.  However, storing entities with this attribute set fails with the following exception:

 java.lang.ClassCastException: java.lang.Byte incompatible with java.lang.String
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$GraphToTypedInstanceMapper.mapVertexToMapInstance(GraphBackedMetadataRepository.java:1111)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$GraphToTypedInstanceMapper.mapVertexToAttribute(GraphBackedMetadataRepository.java:1002)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$GraphToTypedInstanceMapper.mapVertexToInstance(GraphBackedMetadataRepository.java:971)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$GraphToTypedInstanceMapper.mapGraphToTypedInstance(GraphBackedMetadataRepository.java:950)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$TypedInstanceToGraphMapper.getFullTextForVertex(GraphBackedMetadataRepository.java:522)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$TypedInstanceToGraphMapper.addFullTextProperty(GraphBackedMetadataRepository.java:515)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$TypedInstanceToGraphMapper.mapTypedInstanceToGraph(GraphBackedMetadataRepository.java:499)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$TypedInstanceToGraphMapper.access$100(GraphBackedMetadataRepository.java:471)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository.createEntities(GraphBackedMetadataRepository.java:154)
	at org.apache.atlas.GraphTransactionInterceptor.invoke(GraphTransactionInterceptor.java:42)
	at org.apache.atlas.services.DefaultMetadataService.createEntities(DefaultMetadataService.java:251)

  was:
Atlas currently lets you define map types as having an arbitrary type for the key and the
value.  A type with map attribute with a non-string key in a  can be registered without any
problem.  However, if you use anything other than a string as the key type and try to store
a value in the map type you get an exception.  Atlas should either correctly handle non-string
keys or throw an exception when trying to register an entity with a map attributes that uses
a non-string key type.

In our case, we created a type with an attribute of type map<byte,byte> without any
error.  However, storing entities with this attribute set fails with the following exception:

 java.lang.ClassCastException: java.lang.Byte incompatible with java.lang.String
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$GraphToTypedInstanceMapper.mapVertexToMapInstance(GraphBackedMetadataRepository.java:1111)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$GraphToTypedInstanceMapper.mapVertexToAttribute(GraphBackedMetadataRepository.java:1002)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$GraphToTypedInstanceMapper.mapVertexToInstance(GraphBackedMetadataRepository.java:971)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$GraphToTypedInstanceMapper.mapGraphToTypedInstance(GraphBackedMetadataRepository.java:950)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$TypedInstanceToGraphMapper.getFullTextForVertex(GraphBackedMetadataRepository.java:522)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$TypedInstanceToGraphMapper.addFullTextProperty(GraphBackedMetadataRepository.java:515)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$TypedInstanceToGraphMapper.mapTypedInstanceToGraph(GraphBackedMetadataRepository.java:499)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$TypedInstanceToGraphMapper.access$100(GraphBackedMetadataRepository.java:471)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository.createEntities(GraphBackedMetadataRepository.java:154)
	at org.apache.atlas.GraphTransactionInterceptor.invoke(GraphTransactionInterceptor.java:42)
	at org.apache.atlas.services.DefaultMetadataService.createEntities(DefaultMetadataService.java:251)


> Non-String map keys allowed in type definition but cause error when storing entity
> ----------------------------------------------------------------------------------
>
>                 Key: ATLAS-362
>                 URL: https://issues.apache.org/jira/browse/ATLAS-362
>             Project: Atlas
>          Issue Type: Bug
>    Affects Versions: 0.6-incubating
>            Reporter: David Kantor
>            Priority: Minor
>
> Atlas currently lets you define map types as having an arbitrary type for the key and
the value.  A type with map attribute with a non-string key can be registered without any
problem.  However, if you use anything other than a string as the key type and try to store
a value in the map type you get an exception.  Atlas should either correctly handle non-string
keys or throw an exception when trying to register an entity with a map attributes that uses
a non-string key type.
> In our case, we created a type with an attribute of type map<byte,byte> without
any error.  However, storing entities with this attribute set fails with the following exception:
>  java.lang.ClassCastException: java.lang.Byte incompatible with java.lang.String
> 	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$GraphToTypedInstanceMapper.mapVertexToMapInstance(GraphBackedMetadataRepository.java:1111)
> 	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$GraphToTypedInstanceMapper.mapVertexToAttribute(GraphBackedMetadataRepository.java:1002)
> 	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$GraphToTypedInstanceMapper.mapVertexToInstance(GraphBackedMetadataRepository.java:971)
> 	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$GraphToTypedInstanceMapper.mapGraphToTypedInstance(GraphBackedMetadataRepository.java:950)
> 	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$TypedInstanceToGraphMapper.getFullTextForVertex(GraphBackedMetadataRepository.java:522)
> 	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$TypedInstanceToGraphMapper.addFullTextProperty(GraphBackedMetadataRepository.java:515)
> 	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$TypedInstanceToGraphMapper.mapTypedInstanceToGraph(GraphBackedMetadataRepository.java:499)
> 	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$TypedInstanceToGraphMapper.access$100(GraphBackedMetadataRepository.java:471)
> 	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository.createEntities(GraphBackedMetadataRepository.java:154)
> 	at org.apache.atlas.GraphTransactionInterceptor.invoke(GraphTransactionInterceptor.java:42)
> 	at org.apache.atlas.services.DefaultMetadataService.createEntities(DefaultMetadataService.java:251)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message