br1ghtyang / asterixdb

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

Integer types are dynamically determined #577

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
See the following example and the comments inlined:

drop dataverse foo if exists;
create dataverse foo;
use dataverse foo;

create type footype as open {
id: int64
};

create dataset foo(footype) primary key id;

// This works since the number is large enough that it needs to be an int64 
// and so it is converted into an int64
insert into dataset foo({"id": 4444444444});

// This does not work since the number is small enough that it can fit in an 
int32
// which is the default type for ints
insert into dataset foo({"id": 1});

What should happen is that an int is statically parsed into some type (int64 
perhaps so that we can easily ingest JSON), unless explicitly specified to be 
another type.

Original issue reported on code.google.com by zheilb...@gmail.com on 24 Jul 2013 at 11:43

GoogleCodeExporter commented 8 years ago

Original comment by zheilb...@gmail.com on 24 Jul 2013 at 11:43

GoogleCodeExporter commented 8 years ago

Original comment by zheilb...@gmail.com on 24 Jul 2013 at 11:44

GoogleCodeExporter commented 8 years ago

Original comment by salsuba...@gmail.com on 24 Jul 2013 at 11:45

GoogleCodeExporter commented 8 years ago
Actually let me merge that one into this since it has more info.

Original comment by salsuba...@gmail.com on 24 Jul 2013 at 11:46

GoogleCodeExporter commented 8 years ago
Issue 213 has been merged into this issue.

Original comment by salsuba...@gmail.com on 24 Jul 2013 at 11:47

GoogleCodeExporter commented 8 years ago
Right, was in the middle of saying that actually... especially since 213 is 
filed for an obsolete branch

Original comment by zheilb...@gmail.com on 24 Jul 2013 at 11:52

GoogleCodeExporter commented 8 years ago
Here is a test case:

drop dataverse TestVerse if exists;

create dataverse TestVerse;
use dataverse TestVerse;

create type Int64TestType as open {
        myint: int64
};

create dataset Int64Test(Int64TestType)
   primary key myint;

insert into dataset Int64Test (
       {"myint": 13}               // feeling unlucky
);

The error message is as follows right now - and also it's grammatically 
incorrect. :-)

type mismatch: miss a required closed field myint:int64 [IllegalStateException]

Original comment by dtab...@gmail.com on 23 Aug 2013 at 8:24

GoogleCodeExporter commented 8 years ago
Remember to verify this bug on both JavaCC and Diego's lexer/parser paths.

Original comment by zheilb...@gmail.com on 4 Oct 2013 at 10:12

GoogleCodeExporter commented 8 years ago
Issue 578 has been merged into this issue.

Original comment by zheilb...@gmail.com on 4 Oct 2013 at 10:15

GoogleCodeExporter commented 8 years ago

Original comment by zheilb...@gmail.com on 18 Oct 2013 at 4:31

GoogleCodeExporter commented 8 years ago

Original comment by jarod...@gmail.com on 18 Oct 2013 at 5:19

GoogleCodeExporter commented 8 years ago
No rush, but can you give me an ETA on when this will come back into master? It 
turns out that I need the type promotion functionality for an issue I'm working 
on.

Original comment by zheilb...@gmail.com on 23 Oct 2013 at 4:40

GoogleCodeExporter commented 8 years ago
Will merge the change back tonight. Sorry for the delay~

Original comment by jarod...@gmail.com on 23 Oct 2013 at 5:37

GoogleCodeExporter commented 8 years ago
No problem. Thanks!

Original comment by zheilb...@gmail.com on 23 Oct 2013 at 5:39

GoogleCodeExporter commented 8 years ago

Original comment by jarod...@gmail.com on 24 Oct 2013 at 12:43