namhnguyen / asterixdb

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

the auto-generated field doesnt generate and a cannot be null error is returned #745

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Reproduction:
=============
The query below defines an auto-generated field for its primary key (table 
page_views), and uses it in the type however the result is:
"Field 0 can not be null [AsterixException]"

Expectation:
============
The auto-generated features generates an id for Field 0.
Note that the cc.log shows a "reading external data source exception" 
see stack below 

Query:
======

create type page_info_type as open {}

create type page_views_type as closed {
        id: uuid,
        user: string?,
        action: int32,
        timespent: int32,
        query_term: string?,
        ip_addr: int32,
        timestamp: int32,
        estimated_revenue: double?,
        page_info: page_info_type,
        page_links: {{ page_info_type}}?
}

create dataset page_views(page_views_type)
//primary key user;
primary key id autogenerated;

load dataset page_views using localfs
(("path"="127.0.0.1:///home/kereno/pig-trunk/workspace/Pig/AQL-format/part-m-000
00"),("format"="adm"));
//(("path"="127.0.0.1:///home/kereno/Desktop/page_views_test.adm"),("format"="ad
m"));

Stack trace of cc.log:
======================

SEVERE: Job failed on account of:
edu.uci.ics.hyracks.api.exceptions.HyracksDataException: exception during 
reading from external data source

edu.uci.ics.hyracks.api.exceptions.HyracksException: Job failed on account of:
edu.uci.ics.hyracks.api.exceptions.HyracksDataException: exception during 
reading from external data source

    at edu.uci.ics.hyracks.control.cc.job.JobRun.waitForCompletion(JobRun.java:207)
    at edu.uci.ics.hyracks.control.cc.work.WaitForJobCompletionWork$1.run(WaitForJobCompletionWork.java:44)
    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)
Caused by: edu.uci.ics.hyracks.api.exceptions.HyracksDataException: 
edu.uci.ics.hyracks.api.exceptions.HyracksDataException: exception during 
reading from external data source
    at edu.uci.ics.hyracks.control.common.utils.ExceptionUtils.setNodeIds(ExceptionUtils.java:41)
    at edu.uci.ics.hyracks.control.nc.Task.run(Task.java:291)
    ... 3 more
Caused by: edu.uci.ics.hyracks.api.exceptions.HyracksDataException: exception 
during reading from external data source
    at edu.uci.ics.asterix.metadata.feeds.ExternalDataScanOperatorDescriptor$1.initialize(ExternalDataScanOperatorDescriptor.java:57)
    at edu.uci.ics.hyracks.api.rewriter.runtime.SuperActivityOperatorNodePushable.initialize(SuperActivityOperatorNodePushable.java:81)
    at edu.uci.ics.hyracks.control.nc.Task.run(Task.java:234)
    ... 3 more
Caused by: edu.uci.ics.hyracks.api.exceptions.HyracksDataException: 
edu.uci.ics.hyracks.api.exceptions.HyracksDataException: 
edu.uci.ics.asterix.common.exceptions.AsterixException: Field 0 can not be null
    at edu.uci.ics.asterix.runtime.operators.file.AbstractTupleParser.parse(AbstractTupleParser.java:81)
    at edu.uci.ics.asterix.external.dataset.adapter.FileSystemBasedAdapter.start(FileSystemBasedAdapter.java:50)
    at edu.uci.ics.asterix.metadata.feeds.ExternalDataScanOperatorDescriptor$1.initialize(ExternalDataScanOperatorDescriptor.java:55)
    ... 5 more
Caused by: edu.uci.ics.hyracks.api.exceptions.HyracksDataException: 
edu.uci.ics.asterix.common.exceptions.AsterixException: Field 0 can not be null
    at edu.uci.ics.asterix.runtime.operators.file.ADMDataParser.parse(ADMDataParser.java:82)
    at edu.uci.ics.asterix.runtime.operators.file.AbstractTupleParser.parse(AbstractTupleParser.java:68)
    ... 7 more
Caused by: edu.uci.ics.asterix.common.exceptions.AsterixException: Field 0 can 
not be null
    at edu.uci.ics.asterix.runtime.operators.file.ADMDataParser.parseRecord(ADMDataParser.java:549)
    at edu.uci.ics.asterix.runtime.operators.file.ADMDataParser.admFromLexerStream(ADMDataParser.java:346)
    at edu.uci.ics.asterix.runtime.operators.file.ADMDataParser.parseAdmInstance(ADMDataParser.java:108)
    at edu.uci.ics.asterix.runtime.operators.file.ADMDataParser.parse(ADMDataParser.java:80)
    ... 8 more

Original issue reported on code.google.com by ker...@gmail.com on 27 Mar 2014 at 7:34

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
This is a known issue. Loading data will not generate UUIDs--only insert plans 
will do this (aka insert statement or feeds). Thanks for filing.

Original comment by zheilb...@gmail.com on 27 Mar 2014 at 10:19

GoogleCodeExporter commented 9 years ago
Now, loading data by using 'LOAD' statement will generated UUIDs if the schema 
has an auto-generated PK field. 

Original comment by wangs...@gmail.com on 10 Sep 2014 at 8:41