asterixdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Heri Ramampiaro <heri...@gmail.com>
Subject Re: Parsing "path" expression from AQL
Date Tue, 16 Jun 2015 18:21:59 GMT
I did not look into the “parsing” code itself but I found out how the 
API for accessing the record field paths is implements. 

The current support convention for nested field name access seems to be:
$record_name.field1.field2

Issuing “$record_name.field1.field2”  will call “field-access-nested” function, 
which will produce a path as an ArrayList of strings [“field1”, “field2”].

The implementation of the above function can be found in: 

“edu.uci.ics.asterix.om.typecomputer.impl.FieldAccessNestedResultType”
“edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat”
“edu.uci.ics.asterix.runtime.evaluators.functions.FieldAccessNestedDescriptor"

-heri


> On Jun 16, 2015, at 11:05 AM, Ian Maxon <imaxon@uci.edu> wrote:
> 
> Oh, how is it done though? (For other folks that might be curious)
> 
> -Ian
> 
> On Mon, Jun 15, 2015 at 4:58 PM, Heri Ramampiaro <heri@idi.ntnu.no> wrote:
>> Sorry, forget my previous email. I found out how it is done:-)
>> 
>> Cheers,
>> -heri
>> 
>> 
>>> On Jun 15, 2015, at 4:23 PM, Heri Ramampiaro <heri@ntnu.no> wrote:
>>> 
>>> I am trying to implement a remove record field function that also can
> handle
>>> nested fields.
>>> 
>>> E.g.
>>> let $r := {
>>> "id": "2",
>>> "address": {
>>> "street": "21 Orlando ct.",
>>> "city": "Irvine",
>>> "state": "CA"
>>> }
>>> "related": ["VXQuery", "AQL"]
>>> }
>>> return remove-field($r, [“address.state”]);
>>> 
>>> Expected result:
>>> [
>>> {
>>> "id": "2",
>>> "address": {
>>> "street": "21 Orlando ct.",
>>> "city": "Irvine"
>>> }
>>> "related": ["VXQuery", "AQL"]
>>> }
>>> ]
>>> 
>>> My question is how is the parser implemented to access nested field
> names?
>>> (Or, where do I find the API for this?)
>>> 
>>> Thank you.
>>> 
>>> Best,
>>> -heri
>>> 
>>> 
>>> 
>> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message