You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@asterixdb.apache.org by Haminou Mohammed <ha...@stud.hs-hannover.de> on 2017/11/27 17:55:02 UTC

Query problem + Java API

Hi all,

In a project we are working on we came across a problem and thought the community might help us solve it quickly. 

We have a dataset which looks like this (attached is also a screenshot): 

create type imagesMultiset as{
	imageURL: string,
	imageLabel: {{ string }}
}

create type imageDataType as{
	imageId: uuid,
	imageData: {{ imagesMultiset }}
}

create dataset imagesData(imageDataType)
	primary key imageId;

create dataset imagesDataBenchmark(imageDataType)
	primary key imageId;

The question is how to query the data in the imageLabel (e.g. select * from imagesData where imageLabel = “Michael Jackson”). We receive an empty results executing the query.

SELECT  *   FROM imagesDataBenchmark
WHERE imageLabel = "Golfen";

Furthermore is there a Java API available? According the documentation AsterixDB only provide the HTTP API but I found some Java stuff on Github.

Thank you very much in advance.


Haminou Mohammed

Student Angewandte Informatik
Hochschule Hannover
Fakultät IV
Ricklinger Stadtweg 20
mailto:haminou.mohammed@stud.hs-hannover.de



Re: Query problem + Java API

Posted by Mike Carey <dt...@gmail.com>.
PS - And to answer the other side of the question (Java API), no, today 
one needs to use one's favorite Java/HTTP package and use the "HTTP 
front door" to the system.  We do need a less cumbersome answer at some 
point!


On 11/27/17 9:58 AM, Taewoo Kim wrote:
> Hi Haminou,
>
> Please check "unnest". It basically let you explore an individual item 
> in an array.
> https://ci.apache.org/projects/asterixdb/sqlpp/manual.html#Unnest_clauses
>
> Best,
> Taewoo
>
> On Mon, Nov 27, 2017 at 9:55 AM, Haminou Mohammed 
> <haminou.mohammed@stud.hs-hannover.de 
> <ma...@stud.hs-hannover.de>> wrote:
>
>
>     Hi all,
>
>     In a project we are working on we came across a problem and
>     thought the community might help us solve it quickly.
>
>     We have a dataset which looks like this (attached is also a
>     screenshot):
>
>     /create type imagesMultiset as{/
>     /imageURL: string,/
>     /imageLabel: {{ string }}/
>     /}/
>     /
>     /
>     /create type imageDataType as{/
>     /imageId: uuid,/
>     /imageData: {{ imagesMultiset }}/
>     /}/
>     /
>     /
>     /create dataset imagesData(imageDataType)/
>     /primary key imageId;/
>     /
>     /
>     /create dataset imagesDataBenchmark(imageDataType)/
>     /primary key imageId;/
>     /
>     /
>     The question is how to query the data in the imageLabel (e.g.
>     select * from imagesData where imageLabel = “Michael Jackson”). We
>     receive an empty results executing the query.
>
>     /SELECT  *   FROM imagesDataBenchmark/
>     /WHERE imageLabel = "Golfen";/
>
>     Furthermore is there a Java API available? According the
>     documentation AsterixDB only provide the HTTP API but I found some
>     Java stuff on Github.
>
>     Thank you very much in advance.
>
>
>     Haminou Mohammed
>
>     Student Angewandte Informatik
>     Hochschule Hannover
>     Fakultät IV
>     Ricklinger Stadtweg 20
>     <https://maps.google.com/?q=Ricklinger+Stadtweg+20&entry=gmail&source=g>
>     mailto:haminou.mohammed@stud.hs-hannover.de
>     <ma...@stud.hs-hannover.de>
>
>
>


Re: Query problem + Java API

Posted by Taewoo Kim <wa...@gmail.com>.
Hi Haminou,

Please check "unnest". It basically let you explore an individual item in
an array.

https://ci.apache.org/projects/asterixdb/sqlpp/manual.html#Unnest_clauses

Best,
Taewoo

On Mon, Nov 27, 2017 at 9:55 AM, Haminou Mohammed <
haminou.mohammed@stud.hs-hannover.de> wrote:

>
> Hi all,
>
> In a project we are working on we came across a problem and thought the
> community might help us solve it quickly.
>
> We have a dataset which looks like this (attached is also a screenshot):
>
> *create type imagesMultiset as{*
> * imageURL: string,*
> * imageLabel: {{ string }}*
> *}*
>
> *create type imageDataType as{*
> * imageId: uuid,*
> * imageData: {{ imagesMultiset }}*
> *}*
>
> *create dataset imagesData(imageDataType)*
> * primary key imageId;*
>
> *create dataset imagesDataBenchmark(imageDataType)*
> * primary key imageId;*
>
> The question is how to query the data in the imageLabel (e.g. select *
> from imagesData where imageLabel = “Michael Jackson”). We receive an empty
> results executing the query.
>
> *SELECT  *   FROM imagesDataBenchmark*
> *WHERE imageLabel = "Golfen";*
>
> Furthermore is there a Java API available? According the documentation
> AsterixDB only provide the HTTP API but I found some Java stuff on Github.
>
> Thank you very much in advance.
>
>
> Haminou Mohammed
>
> Student Angewandte Informatik
> Hochschule Hannover
> Fakultät IV
> Ricklinger Stadtweg 20
> <https://maps.google.com/?q=Ricklinger+Stadtweg+20&entry=gmail&source=g>
> mailto:haminou.mohammed@stud.hs-hannover.de
> <ha...@stud.hs-hannover.de>
>
>
>