Question: Understanding the working of first() and last() functions (original) (raw)

ArcadeDB Version: ArcadeDB Server v23.3.1-SNAPSHOT (build 143b1a6/1677646375828/main)

JDK Version: JMX Metrics

OS: MacOS Ventura 13.2.1

Expected behavior

Instead of returning null, the first and last values of the multi-valued field (dataset_name/dataset_name_l) created in the subquery should be returned upon using the first() and last() functions respectively.

PS: I'm still learning about ArcadeDB referring to the official documentation. It's possible that I misunderstood something.

Actual behavior

Query 1: select name,first(dataset_name) from (select name,in('in_use').name as dataset_name from job)
Query 2: select name,first(dataset_name_l) from (select name,dataset_name.convert('list') as dataset_name_l from (select name,in('in_use').name as dataset_name from job))

There are a total of 7 job-type nodes and 15 dataset-type nodes. A job is attached to three dataset-type nodes in total (2 with 'in_use' and 1 with 'has_created' type edge). Please refer to the attached image for better visualization (image 1).

I want to check the working of the first() and last() functions. Both queries were created with the same intent. The subquery select name,in('in_use').name as dataset_name from job returns the expected result (image 2), however, while using the said functions to extract the first and last values, the result (images 3 & 4) comes out to be null with both queries.

Image 1:
image

Image 2:
image

Image 3:
image

Image 4:
image

Steps to reproduce