You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by "Madhan Neethiraj (Jira)" <ji...@apache.org> on 2020/05/18 01:35:00 UTC

[jira] [Resolved] (ATLAS-359) Unable to store date arrays or dates as map values

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

Madhan Neethiraj resolved ATLAS-359.
------------------------------------
    Resolution: Cannot Reproduce

This issue doesn't reproduce any more.

> Unable to store date arrays or dates as map values
> --------------------------------------------------
>
>                 Key: ATLAS-359
>                 URL: https://issues.apache.org/jira/browse/ATLAS-359
>             Project: Atlas
>          Issue Type: Bug
>            Reporter: Dave Kantor
>            Priority: Minor
>
> POST http://localhost:21000/api/atlas/entities
> json:
> [{"jsonClass":"org.apache.atlas.typesystem.json.InstanceSerialization$_Reference","id":{"jsonClass":"org.apache.atlas.typesystem.json.InstanceSerialization$_Id","id":"-787535393397482","version":0,"typeName":"TypesPackage_Types"},"typeName":"TypesPackage_Types","values":{"intArrayAttr":[-2147483648,0,2147483647],"omCreationTimestamp":"2015-12-02T21:45:38.675Z","shortArrayAttr":[-32768,0,32767],"omOptimisticLockId":0,"booleanArrayAttr":[true,false,true],"omModificationTimestamp":"2015-12-02T21:45:38.674Z","byteArrayAttr":[-128,0,127],"bigDecimalArrayAttr":[1,0,10],"omModifiedByUser":"oms","stringArrayAttr":["item 1","item 2","item 2"],"dateArrayAttr":["2015-12-02T21:45:33.245Z","2015-12-02T21:45:33.245Z","2015-12-02T21:45:33.245Z"],"bigIntegerArrayAttr":[1,10,10],"omCreatedByUser":"oms","longArrayAttr":[-9223372036854775808,0,9223372036854775807],"floatArrayAttr":[1.4E-45,0,127],"doubleArrayAttr":[4.9E-324,0,1.7976931348623157E308]},"traitNames":[],"traits":{}}]
> This results in the following message appearing in the Atlas application.log.
> org.apache.atlas.repository.RepositoryException: org.apache.atlas.typesystem.types.ValueConversionException: Cannot convert value 'Wed Dec 02 15:45:33 CST 2015' to datatype date
> 	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository.createEntities(GraphBackedMetadataRepository.java:158)
> 	at org.apache.atlas.GraphTransactionInterceptor.invoke(GraphTransactionInterceptor.java:42)
> 	at org.apache.atlas.services.DefaultMetadataService.createEntities(DefaultMetadataService.java:251)
> 	at org.apache.atlas.web.resources.EntityResource.submit(EntityResource.java:113)
> 	at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:602)
> ...
> Caused by: org.apache.atlas.typesystem.types.ValueConversionException: Cannot convert value 'Wed Dec 02 15:45:33 CST 2015' to datatype date
> 	at org.apache.atlas.typesystem.types.DataTypes$DateType.convert(DataTypes.java:430)
> 	at org.apache.atlas.typesystem.types.DataTypes$DateType.convert(DataTypes.java:409)
> 	at org.apache.atlas.typesystem.types.DataTypes$ArrayType.convert(DataTypes.java:514)
> 	at org.apache.atlas.typesystem.types.DataTypes$ArrayType.convert(DataTypes.java:477)
> 	at org.apache.atlas.typesystem.persistence.StructInstance.set(StructInstance.java:119)
> 	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$GraphToTypedInstanceMapper.mapVertexToArrayInstance(GraphBackedMetadataRepository.java:1068)
> 	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$GraphToTypedInstanceMapper.mapVertexToAttribute(GraphBackedMetadataRepository.java:998)
> 	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)
> 	... 51 more
> Caused by: java.text.ParseException: Unparseable date: "Wed Dec 02 15:45:33 CST 2015"
> 	at java.text.DateFormat.parse(DateFormat.java:357)
> 	at org.apache.atlas.typesystem.types.DataTypes$DateType.convert(DataTypes.java:428)
> 	... 64 more
> What is very interesting is the the json shown in the Atlas log has the dates in a different format:
> 2015-12-02 15:45:38,731 DEBUG - [qtp170073146-31 - e44c1288-5927-4339-a72a-5573ca8a81b3:] ~ submitting entities {"jsonClass":"org.apache.atlas.typesystem.json.InstanceSerialization$_Reference","id":{"jsonClass":"org.apache.atlas.typesystem.json.InstanceSerialization$_Id","id":"-787535393397482","version":0,"typeName":"TypesPackage_Types"},"typeName":"TypesPackage_Types","values":{"intArrayAttr":[-2147483648,0,2147483647],"omCreationTimestamp":"2015-12-02T21:45:38.675Z","shortArrayAttr":[-32768,0,32767],"omOptimisticLockId":0,"booleanArrayAttr":[true,false,true],"omModificationTimestamp":"2015-12-02T21:45:38.674Z","byteArrayAttr":[-128,0,127],"bigDecimalArrayAttr":[1,0,10],"omModifiedByUser":"oms","stringArrayAttr":["item 1","item 2","item 2"],"dateArrayAttr":["2015-12-02T21:45:33.245Z","2015-12-02T21:45:33.245Z","2015-12-02T21:45:33.245Z"],"bigIntegerArrayAttr":[1,10,10],"omCreatedByUser":"oms","longArrayAttr":[-9223372036854775808,0,9223372036854775807],"floatArrayAttr":[1.4E-45,0,127],"doubleArrayAttr":[4.9E-324,0,1.7976931348623157E308]},"traitNames":[],"traits":{}}  (EntityResource:111)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)