finos / TimeBase-CE

High performance time series database
https://timebase.info
Apache License 2.0
112 stars 21 forks source link

MetaDataBindException: Failed to bind descriptor null #212

Closed chirdeeptomar closed 1 year ago

chirdeeptomar commented 1 year ago

I have the following QQL command working at expected from the shell but failing when used from Java.

==> select sum{}(volume) as TotalVolume, max{}(volume) as MaxVolume, min{}(volume) as MinVolume from bars where timestamp BETWEEN '2005-01-03 14:30:00'd AND '2005-01-03 15:30:00'd and symbol == 'AAPL'
>_,TIMESTAMP,SYMBOL,TYPE,TOTALVOLUME,MAXVOLUME,MINVOLUME
0,2005-01-03 15:30:00,AAPL,4918805.0,340651.0,19415.0

Getting the following err in Java:

com.epam.deltix.qsrv.hf.pub.codec.MetaDataBindException: Failed to bind descriptor null

Java Code:

public void getData() {
        try {
            DXTickDB db = TickDBFactory.createFromUrl("dxtick://localhost:8011");
            db.open(false);
            var cursor = db.executeQuery(
                    "select sum{}(volume) as TotalVolume, max{}(volume) as MaxVolume, min{}(volume) as MinVolume from bars where timestamp BETWEEN '2005-01-03 14:30:00'd AND '2005-01-03 15:30:00'd and symbol == 'AAPL' ");
            // Iterate cursor and get messages
            while (cursor.next()) {
                var message = cursor.getMessage();
                System.out.println("Read message: " + message.toString());
            }

        } catch (Exception e) {
            System.out.println(e);
        }

    }
alex-karpovich commented 1 year ago

please use next method: executeQuery(query, new SelectionOptions(true, false)) to receive 'raw' messages

chirdeeptomar commented 1 year ago

Yup figured that out after posting.