Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

With you get to the IDE for this server.

Image Added

The first step now, is to create a new project with the Image Addedon the left lower side.

Name the project e.g. Nexmark

Image Added

You will see

Image Added

Now click on the "New File in current directory" 

Name the file nexmark.qry

Now copy and paste the following script.

Remark: Because nexmark and this is Odysseus instance are inside a docker environment you cannot use localhost for nexmark queries → use "nexmark" instead.

Code Block
languageshell
#PARSER PQL
#RUNQUERY
nexmark:person := ACCESS({source='nexmark:person',
    wrapper='GenericPush',
    transport='TCPClient',
    protocol='SizeByteBuffer',
    dataHandler='Tuple',
    options=[
        ['host', 'nexmark'],
        ['port', '65440'],
        ['ByteOrder', 'LittleEndian']
        ],
    schema=[
        ['timestamp', 'STARTTIMESTAMP'],
        ['id', 'INTEGER'],
        ['name', 'STRING'],
        ['email', 'STRING'],
        ['creditcard', 'STRING'],
        ['city', 'STRING'],
        ['state', 'STRING']
        ]
    })
    
#RUNQUERY
nexmark:bid := ACCESS({source='nexmark:bid',
    wrapper='GenericPush',
    transport='TCPClient',
    protocol='SizeByteBuffer',
    dataHandler='Tuple',
    options=[
        ['host', 'nexmark'],
        ['port', '65442'],
        ['ByteOrder', 'LittleEndian']
        ],
    schema=[
        ['nexmark:bid','timestamp', 'STARTTIMESTAMP'],
        ['nexmark:bid','auction', 'INTEGER'],
        ['nexmark:bid','bidder', 'INTEGER'], 
        ['nexmark:bid','datetime', 'LONG'],
        ['nexmark:bid','price', 'DOUBLE']
        ]
    })

#RUNQUERY    
nexmark:auction := ACCESS({source='nexmark:auction',
    wrapper='GenericPush',
    transport='TCPClient',
    protocol='SizeByteBuffer',
    dataHandler='Tuple',
    options=[
        ['host', 'nexmark'],
        ['port', '65441'],
        ['ByteOrder', 'LittleEndian']
        ],
    schema=[
        ['timestamp', 'STARTTIMESTAMP'],
        ['id', 'INTEGER'],
        ['itemname', 'STRING'],
        ['description', 'STRING'],
        ['initialbid', 'INTEGER'],
        ['reserve', 'INTEGER'],
        ['expires', 'LONG'],
        ['seller', 'INTEGER'],
        ['category', 'INTEGER']
        ]
    })

#RUNQUERY    
nexmark:category := ACCESS({source='nexmark:category',
    wrapper='GenericPush',
    transport='TCPClient',
    protocol='SizeByteBuffer',
    dataHandler='Tuple',
    options=[
        ['host', 'nexmark'],
        ['port', '65443'],
        ['ByteOrder', 'LittleEndian']
        ],
    schema=[
        ['id', 'INTEGER'],
        ['name', 'STRING'],
        ['description', 'STRING'],
        ['parentid', 'INTEGER']
        ]
    })

You connect to a odysseus instance, you will need to use localhost, because the connection is done from the browser that is outside of docker!

Image Added

And klick on "Run" in the lower right corner of the editor pane.

Image Added

In the lower right corner, you should see the following:

Image Added

If there are errors, they are not (yet) shown in this view. You will ne to navigate to Image Added

And you will see error messages. 
Here everything went fine:

Image Added

Now you can create another query, e.g. filtering all bids with a price higher than 200.

For this, you could use PQL (same as the source definition)

Image Added

and press Run.

In the Queries windows you will see this query:

Image Added

To see results, right click on the line and select "Show in table"

Image Added

a new window opens at the upper right side and shows the results.

Image Added

You can use this Image Added icon the show the query plan for this query (Remark. Does not work atm).

An alternative, is to click on the "Monitor" entry in the menu.

Image Added

There you will see for any installed query, the plan.Image Removed