lwhay / asterixdb

Automatically exported from code.google.com/p/asterixdb
0 stars 0 forks source link

a type containing more than on list of non-primitive type returns a NPE #761

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Creating a type which contains more than one list of a type you previously 
defined (non-primitive) generates an NPE.

Reproduction:
==============
drop dataverse kereno if exists;
create dataverse kereno;
use dataverse kereno;

create type page_info_type as closed {}

create type page_views_type as open {
        page_links: {{ page_info_type}}?,
        page_links_1: {{ page_info_type}}?
}

Returns null[]

Note that the definition below works fine:

drop dataverse kereno if exists;
create dataverse kereno;
use dataverse kereno;

create type page_views_type as open {
        page_links: {{ int32}}?,
        page_links_1: {{ int32}}?
}

Stack:
=====
SEVERE: edu.uci.ics.hyracks.api.exceptions.HyracksDataException: 
edu.uci.ics.asterix.metadata.MetadataException: 
edu.uci.ics.hyracks.api.exceptions.HyracksDataException: 
edu.uci.ics.asterix.metadata.MetadataException: java.lang.NullPointerException
edu.uci.ics.asterix.metadata.MetadataException: 
edu.uci.ics.hyracks.api.exceptions.HyracksDataException: 
edu.uci.ics.asterix.metadata.MetadataException: 
edu.uci.ics.hyracks.api.exceptions.HyracksDataException: 
edu.uci.ics.asterix.metadata.MetadataException: java.lang.NullPointerException
    at edu.uci.ics.asterix.metadata.MetadataNode.addDatatype(MetadataNode.java:257)
    at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
    at sun.rmi.transport.Transport$1.run(Transport.java:177)
    at sun.rmi.transport.Transport$1.run(Transport.java:174)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:160)
    at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:194)
    at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:148)
    at com.sun.proxy.$Proxy13.addDatatype(Unknown Source)
    at edu.uci.ics.asterix.metadata.MetadataManager.addDatatype(MetadataManager.java:349)
    at edu.uci.ics.asterix.aql.translator.AqlTranslator.handleCreateTypeStatement(AqlTranslator.java:803)
    at edu.uci.ics.asterix.aql.translator.AqlTranslator.compileAndExecute(AqlTranslator.java:228)
    at edu.uci.ics.asterix.api.http.servlet.APIServlet.doPost(APIServlet.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:546)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:483)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:970)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:411)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:904)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
    at org.eclipse.jetty.server.Server.handle(Server.java:347)
    at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:439)
    at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:924)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:781)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:220)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:43)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:545)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:43)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)
    at java.lang.Thread.run(Thread.java:722)
Caused by: edu.uci.ics.hyracks.api.exceptions.HyracksDataException: 
edu.uci.ics.asterix.metadata.MetadataException: 
edu.uci.ics.hyracks.api.exceptions.HyracksDataException: 
edu.uci.ics.asterix.metadata.MetadataException: java.lang.NullPointerException
    at edu.uci.ics.asterix.metadata.entitytupletranslators.DatatypeTupleTranslator.writeRecordType(DatatypeTupleTranslator.java:386)
    at edu.uci.ics.asterix.metadata.entitytupletranslators.DatatypeTupleTranslator.writeDerivedTypeRecord(DatatypeTupleTranslator.java:293)
    at edu.uci.ics.asterix.metadata.entitytupletranslators.DatatypeTupleTranslator.getTupleFromMetadataEntity(DatatypeTupleTranslator.java:228)
    at edu.uci.ics.asterix.metadata.MetadataNode.addDatatype(MetadataNode.java:252)
    at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
    at sun.rmi.transport.Transport$1.run(Transport.java:177)
    at sun.rmi.transport.Transport$1.run(Transport.java:174)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    ... 1 more
Caused by: edu.uci.ics.asterix.metadata.MetadataException: 
edu.uci.ics.hyracks.api.exceptions.HyracksDataException: 
edu.uci.ics.asterix.metadata.MetadataException: java.lang.NullPointerException
    at edu.uci.ics.asterix.metadata.MetadataNode.addDatatype(MetadataNode.java:257)
    at edu.uci.ics.asterix.metadata.entitytupletranslators.DatatypeTupleTranslator.handleNestedDerivedType(DatatypeTupleTranslator.java:433)
    at edu.uci.ics.asterix.metadata.entitytupletranslators.DatatypeTupleTranslator.writeRecordType(DatatypeTupleTranslator.java:380)
    ... 17 more
Caused by: edu.uci.ics.hyracks.api.exceptions.HyracksDataException: 
edu.uci.ics.asterix.metadata.MetadataException: java.lang.NullPointerException
    at edu.uci.ics.asterix.metadata.entitytupletranslators.DatatypeTupleTranslator.writeUnionType(DatatypeTupleTranslator.java:353)
    at edu.uci.ics.asterix.metadata.entitytupletranslators.DatatypeTupleTranslator.writeDerivedTypeRecord(DatatypeTupleTranslator.java:298)
    at edu.uci.ics.asterix.metadata.entitytupletranslators.DatatypeTupleTranslator.getTupleFromMetadataEntity(DatatypeTupleTranslator.java:228)
    at edu.uci.ics.asterix.metadata.MetadataNode.addDatatype(MetadataNode.java:252)
    ... 19 more
Caused by: edu.uci.ics.asterix.metadata.MetadataException: 
java.lang.NullPointerException
    at edu.uci.ics.asterix.metadata.MetadataNode.addDatatype(MetadataNode.java:257)
    at edu.uci.ics.asterix.metadata.entitytupletranslators.DatatypeTupleTranslator.handleNestedDerivedType(DatatypeTupleTranslator.java:433)
    at edu.uci.ics.asterix.metadata.entitytupletranslators.DatatypeTupleTranslator.writeUnionType(DatatypeTupleTranslator.java:347)
    ... 22 more
Caused by: java.lang.NullPointerException
    at edu.uci.ics.asterix.metadata.entitytupletranslators.DatatypeTupleTranslator.writeCollectionType(DatatypeTupleTranslator.java:319)
    at edu.uci.ics.asterix.metadata.entitytupletranslators.DatatypeTupleTranslator.writeDerivedTypeRecord(DatatypeTupleTranslator.java:303)
    at edu.uci.ics.asterix.metadata.entitytupletranslators.DatatypeTupleTranslator.getTupleFromMetadataEntity(DatatypeTupleTranslator.java:228)
    at edu.uci.ics.asterix.metadata.MetadataNode.addDatatype(MetadataNode.java:252)
    ... 24 more

Original issue reported on code.google.com by ker...@gmail.com on 25 Apr 2014 at 12:09

GoogleCodeExporter commented 9 years ago

Original comment by ildar.absalyamov on 25 Oct 2014 at 8:40

GoogleCodeExporter commented 9 years ago
What do you observe if we define a primitive type field, like this in 
page_info_type definition. Note that in Keren's example page_info_type does not 
have any fields defined inside it.

create type page_info_type as closed {id : int32}

create type page_views_type as open {
        page_links: {{ page_info_type}}?,
        page_links_1: {{ page_info_type}}?
}

Original comment by khfaraaz82 on 25 Oct 2014 at 10:08

GoogleCodeExporter commented 9 years ago
The structure of a nested type page_info_type does not change anything.
The issue is triggered whenever a type (page_views_type) contains more the one 
non-primitive field of the same type.
Check out the reason in 
https://code.google.com/p/asterixdb/source/detail?r=2b02ee5c96c74f930e1d02f72d6d
59b8a297ceb3&name=ildar/bugFixes

Original comment by ildar.absalyamov on 25 Oct 2014 at 10:42

GoogleCodeExporter commented 9 years ago

Original comment by ildar.absalyamov on 6 Nov 2014 at 6:35