Michael J. Carey created ASTERIXDB-2669:
-------------------------------------------

             Summary: Hyracks exception from OBJECT_REMOVE_FIELDS subquery
                 Key: ASTERIXDB-2669
                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2669
             Project: Apache AsterixDB
          Issue Type: Bug
          Components: *DB - AsterixDB, FUN - Functions, RT - Runtime, SQL - 
Translator SQL++
    Affects Versions: 0.9.4.1
            Reporter: Michael J. Carey
             Fix For: 0.9.5


This query does not work:
SELECT VALUE t FROM (SELECT VALUE OBJECT_REMOVE_FIELDS(t, ["message"]) FROM 
GleambookMessages t) t WHERE t.messageId >= 3;

It gives a semi-nasty-looking error message:
org.apache.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression
 cannot be cast to 
org.apache.hyracks.algebricks.core.algebra.expressions.VariableReferenceExpression
 [ClassCastException]

This variant of the query (with type-casting before the comparison) works:
SELECT VALUE t FROM (SELECT VALUE OBJECT_REMOVE_FIELDS(t, ["message"]) FROM 
GleambookMessages t) t WHERE int(t.messageId) >= 3;

Seems like this is a bug related to the compiler not knowing what to expect 
following the application of OBJECT_REMOVE_FIELDS - but it seems like it should 
indeed work as long as the data is okay (all numbers) at runtime.  In the event 
of "bad" data for the comparison at runtime, it seems like it should still work 
without an error, but should yield a bad comparison warning.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to