br1ghtyang / asterixdb

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

Quantified statements break against open types #209

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Asterix_stabilization Rev: 769
Hyracks_stabilization Rev: 1965

Quantified statements (both existential and universal) break, when run against 
datasets, defined using open types. Both throw the following Algebricks layer 
exception, during compilation:

edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException

Same queries work properly, if run against same data, but defined using 
*closed* types.

How to reproduce:
Use attached DDL-Load file and ".adm" file to create and load data, into 
datasets.
Make sure you change the path in load statement, within DDL-Load file properly, 
so it points to the place, where you stored sample data file. Then run the 
following queries:

-----
Query 1 (Existential Quantifier)

for $fbu in dataset('FacebookUsers')
where
      (some $e in $fbu.employment
      satisfies is-null($e.end-date)) and
      $fbu.user-since >= datetime('2005-12-14T10:48:45') and
      $fbu.user-since <=  datetime('2010-12-14T10:49:45')
return $fbu

Expected result:

{ "id": 2, "id-copy": 2, "alias": "Perla", "name": "PerlaHil", "user-since": 
datetime("2009-06-04T06:46:29.000Z"), "user-since-copy": 
datetime("2009-06-04T06:46:29.000Z"), "friend-ids": {{ 12367795, 16048573, 
9412806, 210757, 9557850, 299600, 2575837, 9079726, 4989734, 16267347, 548630, 
5873345, 14712533, 2829379, 4091981, 17867397, 3205524, 16709211, 10190795, 
17699282 }}, "employment": [ { "organization-name": "Scotcity", "start-date": 
date("2010-10-23"), "end-date": null } ] }
{ "id": 6, "id-copy": 6, "alias": "Norwood", "name": "NorwoodGeyer", 
"user-since": datetime("2009-01-07T09:42:28.000Z"), "user-since-copy": 
datetime("2009-01-07T09:42:28.000Z"), "friend-ids": {{ 11373045, 3084165, 
16120207, 6619325, 16800164, 13632625, 7037794, 6997670, 14521797, 16481071, 
3450722, 7872712, 4592908, 7556022, 8757970, 937259, 17923056, 12139141, 
12153883, 2747400, 8252275, 15565481, 13505113, 12059878 }}, "employment": [ { 
"organization-name": "Vaiatech", "start-date": date("2007-10-03"), "end-date": 
null } ] }
----

Query 2 (Universal Quantifier)

for $fbu in dataset('FacebookUsers')
where
      (every $e in $fbu.employment
      satisfies not(is-null($e.end-date))) and
      $fbu.user-since >= datetime('2005-07-16T20:34:48') and
      $fbu.user-since <= datetime('2011-07-16T20:35:48')
return $fbu

Expected Result:

{ "id": 4, "id-copy": 4, "alias": "Devin", "name": "DevinBloise", "user-since": 
datetime("2010-02-03T23:22:25.000Z"), "user-since-copy": 
datetime("2010-02-03T23:22:25.000Z"), "friend-ids": {{ 4375322, 2816514, 
2117944, 7752198, 4110987, 3275268, 1818693, 4117641, 17526387, 8083801, 
6757975, 4830501, 14441984, 2382876 }}, "employment": [ { "organization-name": 
"Ganjatax", "start-date": date("2004-02-13"), "end-date": date("2005-05-15") } 
] }
--------------

Original issue reported on code.google.com by pouria.p...@gmail.com on 10 Oct 2012 at 9:03

Attachments:

GoogleCodeExporter commented 8 years ago
Pouria hit the issue, during benchmarking.
Issue needs to be assigned to an owner.

Original comment by pouria.p...@gmail.com on 19 Nov 2012 at 7:31

GoogleCodeExporter commented 8 years ago
Alex, since you have already worked on the quantified expression 
tests/functionailty ( some $x in... ; every $x in ...), can you please take a 
look at this one. Pouria is blocked on this one. Thanks.

Original comment by khfaraaz82 on 19 Nov 2012 at 8:37

GoogleCodeExporter commented 8 years ago

Original comment by khfaraaz82 on 19 Nov 2012 at 8:39

GoogleCodeExporter commented 8 years ago
The core of this issue is with chained field accesses to open fields. A field 
access on type ANY should work, and return a type ANY, but currently an 
exception is thrown in this scenario.

This issue is a subset of issue 207 which has been FixedInBranch.

Original comment by alexande...@gmail.com on 6 Dec 2012 at 7:09