ilovesoup / asterixdb

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

Non-integer array indexing #863

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
type the following query in AsterixDB.
["e1", "e2", "e3"][2.33];

What is the expected output?

Illegal use of double to access an array index.

What do you see instead?

"e3"

Please use labels and text to provide additional information.

This issue is breaking one of my tests. It is also very new (must have been 
introduced in one of the latest commits.

Original issue reported on code.google.com by jules.te...@gmail.com on 13 Mar 2015 at 7:36

GoogleCodeExporter commented 9 years ago
This is an expected behavior. Whenever there is a type mismatch in a query 
plan, a type casting happens now. For example, if a query is "... where 
$r.price >= 9.2" and the type of price field is INT, query compiler convert 
9.9d to 9. This type casting happens among all numeric types.

Original comment by wangs...@gmail.com on 14 Mar 2015 at 12:16