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] [Commented] (ATLAS-359) Unable to store date arrays or dates as map values
Date Thu, 03 Dec 2015 19:14:10 GMT

    [ https://issues.apache.org/jira/browse/ATLAS-359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15038377#comment-15038377
] 

David Kantor commented on ATLAS-359:
------------------------------------

Maps with date as the value type have the same issue as arrays of dates:

2015-12-03 09:55:11,124 DEBUG - [qtp-1028208982-31 - 58a1fae6-efbb-43ac-bcf2-1898ae2fdd64:]
~ submitting entities {"jsonClass":"org.apache.atlas.typesystem.json.InstanceSerialization$_Reference","id":{"jsonClass":"org.apache.atlas.typesystem.json.InstanceSerialization$_Id","id":"-33215842067527","version":0,"typeName":"TypesPackage_Types"},"typeName":"TypesPackage_Types","values":{"omCreationTimestamp":"2015-12-03T14:55:11.108Z","omModifiedByUser":"oms","stringDateMapAttr":{"key
1":"2015-12-03T14:55:11.093Z","key 2":"2015-12-03T14:55:11.093Z","key 3":"2015-12-03T14:55:11.093Z"},"omOptimisticLockId":0,"omCreatedByUser":"oms","omModificationTimestamp":"2015-12-03T14:55:11.108Z"},"traitNames":[],"traits":{}}
 (EntityResource:111)

2015-12-03 09:55:11,124 INFO  - [qtp-1028208982-31 - 58a1fae6-efbb-43ac-bcf2-1898ae2fdd64:]
~ adding entities={
	id : (type: TypesPackage_Types, id: <unassigned>)
	stringByteMapAttr : 	<null>
	doubleAttr : 	0.0
	intArrayAttr : 	<null>
	stringFloatMapAttr : 	<null>
	stringShortMapAttr : 	<null>
	stringDateMapAttr : 	{key 1=Thu Dec 03 09:55:11 EST 2015, key 2=Thu Dec 03 09:55:11 EST 2015,
key 3=Thu Dec 03 09:55:11 EST 2015}
	booleanArrayAttr : 	<null>
	byteArrayAttr : 	<null>
	stringIntMapAttr : 	<null>
	floatAttr : 	0.0
	dateAttr : 	<null>
	intAttr : 	0
	bigDecimalArrayAttr : 	<null>
	stringArrayAttr : 	<null>
	byteAttr : 	0
	stringStringMapAttr : 	<null>
	shortAttr : 	0
	floatArrayAttr : 	<null>
	stringBooleanMapAttr : 	<null>
	longAttr : 	0
	stringAttr : 	<null>
	shortArrayAttr : 	<null>
	stringBigDecimalMapAttr : 	<null>
	stringBigIntegerMapAttr : 	<null>
	stringDoubleMapAttr : 	<null>
	booleanAttr : 	false
	bigDecimalAttr : 	<null>
	dateArrayAttr : 	<null>
	stringLongMapAttr : 	<null>
	bigIntegerArrayAttr : 	<null>
	longArrayAttr : 	<null>
	doubleArrayAttr : 	<null>
	bigIntegerAttr : 	<null>
	deleted : 	false
	omContainerId : 	<null>
	omCreationTimestamp : 	2015-12-03T14:55:11.108Z
	omModifiedByUser : 	oms
	omOptimisticLockId : 	0
	omModificationTimestamp : 	2015-12-03T14:55:11.108Z
	omCreatedByUser : 	oms
	OMSBase_OMObject.TypesPackage_Types.deleted : 	false
} (GraphBackedMetadataRepository:152)


org.apache.atlas.repository.RepositoryException: org.apache.atlas.typesystem.types.ValueConversionException:
Cannot convert value 'Thu Dec 03 09:55:11 EST 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)
Caused by: org.apache.atlas.typesystem.types.ValueConversionException: Cannot convert value
'Thu Dec 03 09:55:11 EST 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$MapType.convert(DataTypes.java:606)
	at org.apache.atlas.typesystem.types.DataTypes$MapType.convert(DataTypes.java:562)
	at org.apache.atlas.typesystem.persistence.StructInstance.set(StructInstance.java:119)
	at org.apache.atlas.repository.graph.GraphBackedMetadataRepository$GraphToTypedInstanceMapper.mapVertexToMapInstance(GraphBackedMetadataRepository.java:1118)
	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)
	... 51 more
Caused by: java.text.ParseException: Unparseable date: "Thu Dec 03 09:55:11 EST 2015"
	at java.text.DateFormat.parse(DateFormat.java:357)
	at org.apache.atlas.typesystem.types.DataTypes$DateType.convert(DataTypes.java:428)
	... 64 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: David 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
(v6.3.4#6332)

Mime
View raw message