masumsoft / express-cassandra

Cassandra ORM/ODM/OGM for NodeJS with support for Apache Cassandra, ScyllaDB, Datastax Enterprise, Elassandra & JanusGraph.
http://express-cassandra.readthedocs.io
GNU Lesser General Public License v3.0
232 stars 68 forks source link

UDF & UDA with more than one parameter not working properly #155

Closed erltrax closed 6 years ago

erltrax commented 6 years ago

I defined an aggregate with two parameters, I can query it like the one below without any issues...

SELECT aggregate1(param1, param2) FROM materializedView1 WHERE key1='ID-111' AND key2='ID-222';

I tried to do the same inside an app. The code looks like:

...
const query = {
   key1: 'ID-111',
   key2: 'ID-222'
};

const options = {
   select: ['aggregate1(param1, param2)'],
   materialized_view: 'materializedView1'
};

model.instance.find(query, options, function(err, result) {
...
});

Instead of calling the aggregate function, the result looks like it was called as if the options.select was set to ['*']. I modified my aggregate so that it will only take in one parameter and everything worked as expected.

Is this a configuration issue (perhaps I missed something out) or is it possible that the current implementation does not support aggregate functions with more than one parameter?

I am using version 3.10.10

masumsoft commented 6 years ago

Fixed in v2.2.2