OrientR icon indicating copy to clipboard operation
OrientR copied to clipboard

Implement the Command interface

Open retrography opened this issue 9 years ago • 5 comments

Currently the drivers only handles running idempotent queries. There needs to be an interface for commands as well (exeCommand).

retrography avatar Jul 30 '15 16:07 retrography

Hi @retrography ,

I see that you already started to implement the command interface in commit https://github.com/retrography/OrientR/commit/168097afbfd0da3711b827b1124574fed7be3c50 in the dev branch.

Do you have any plans to continue / merge into master?

I would like to implement the command interface to execute idempotent operations.

pmig avatar Mar 09 '16 17:03 pmig

Hi I see that @mkbouaziz started to implement this feature here: https://github.com/mkbouaziz/OrientR/blob/master/R/orientExeCommand.R

As his repo is more advanced I forked his package and start implementing there. What happend to https://github.com/retrography/OrientR/pull/14 ?

pmig avatar Mar 10 '16 08:03 pmig

Hi @pmig!

#14 mainly separates the interface from the implementation, which is a welcome change. @mkbouaziz closed his pull request before I get a chance to accept it. I will if he opens it once more.

But before working further on the "command" interface, consider this: The command interface easily gives you CSVs, which are much easier to handle inside R. Given that the package currently outputs data frames, I do not see why we should go through the added process of JSON conversion inside R. This is slow and error-prone. We can just download CSV and read it into R using the standard interface, instead of using JSON convertors. This reduces our dependency list as well.

Here is a simple REST API request to get CSV from OrientDB:

curl --header "Accept: text/csv" --user admin:admin -d "SELECT * FROM mytable" "http://localhost:2480/command/gems/sql"

retrography avatar Mar 10 '16 14:03 retrography

@retrography thanks for advice I will definitely consider it!

I hope that we can merge these projects together soon!

pmig avatar Mar 10 '16 17:03 pmig

Hi again @pmig and @mkbouaziz,

Just to let you know that @jaredlander used to be interested in developing the package further. Maybe you can get some help from him.

Another point on the command interface. As far as I know the command interface allows you to define a fetching strategy. My understanding is that OrientDB's default behaviour is to spool the whole resultset before releasing it to the REST interface. This makes the process of fetching large datasets very slow, sometimes stupidly slow. When developing the command interface, it is important to implement the fetch plans properly upfront. It will save you a lot of work afterwards.

See also #4. It is not fixed yet, and it applies to the command interface as well.

retrography avatar Mar 10 '16 17:03 retrography