[MonetDB-users] XRPC/execute at not working from mclient
Hello, I found some problems to run a remote Xquery from mclient. The query is the following (it works fine with the Java XRPC API but not with mclient). mclient -lx -s "execute at {'192.168.0.12'} {pf:collections()}" I get the following error. user(win32): password: MAPI = win32@localhost:50000 QUERY = execute at {'192.168.0.12'} {pf:collections()} ERROR = !ERROR: interpret: no matching MIL operator to 'reverse(void)'. !MAYBE YOU MEAN: ! reverse(BAT[any::1,any::2]) : BAT[any::2,any::1] !ERROR: interpret_params: sort(param 1): evaluation error. !ERROR: interpret_params: reverse(param 1): evaluation error. Did anyone had already successfully run such kind of query? PS1: there are 2 Mserver running: one on the local host/one on the remote host. The Java XRPC API does not need to run a Mserver on the local host, but mclient do (else I get a "initiating connection socket failed" error ) PS2:I have Mserver 4.39.0 on the remote linux server and Mserver 4.36.5 on the windows client (The query also fails with client/linux/4.39.0 & server/linux/4.39.0) PS3: the default example provided in the XRPC doc fails (no MIL operator) the same way: import module namespace test = "xrpc-test-function" at " http://192.168.0.12:50001/export/xrpc-mod.xq"; execute at {"192.168.0.12"} {test:add(100, 200)} Regards Ryad
Hello Ryad, On Jul 22, 2010, at 18:38 , Ryad Ben-El-Kezadri wrote:
Hello,
I found some problems to run a remote Xquery from mclient. The query is the following (it works fine with the Java XRPC API but not with mclient).
mclient -lx -s "execute at {'192.168.0.12'} {pf:collections()}"
I get the following error.
user(win32): password: MAPI = win32@localhost:50000 QUERY = execute at {'192.168.0.12'} {pf:collections()} ERROR = !ERROR: interpret: no matching MIL operator to 'reverse(void)'. !MAYBE YOU MEAN: ! reverse(BAT[any::1,any::2]) : BAT[any::2,any::1] !ERROR: interpret_params: sort(param 1): evaluation error. !ERROR: interpret_params: reverse(param 1): evaluation error.
Did anyone had already successfully run such kind of query?
The error is caused by that XRPC still only works with the old xquery frontend, so to use XRPC in mclient, you need to start mclient with the '-g' option (this is already taken care of when the java XRPC API is used). Please see also 'mclient -h'. The '-g' option should also solve the problem you have mentiond in your 'PS3:'. I have to confess that this error message is not informative. This will be improved once XRPC gets rid of the old frontend. $ monet_pf # MonetDB Server v4.38.4 # based on GDK v1.38.4 ... MonetDB> $ mclient -lx -g Welcome to mclient, the MonetDB/XQuery interactive terminal Type \q to quit, \? for a list of available commands xquery>import module namespace test = "xrpc-test-function" at "http://localhost:50001/export/xrpc-mod.xq"; execute at {"localhost:50001"} {test:add(100, 200)} more><> 300 xquery> If the above command is exactly what you have executed, you will get error message even with the '-g' option: $ mclient -lx -g -s "execute at {'192.168.0.12'} {pf:collections()}" MAPI = monetdb@localhost:50000 QUERY = execute at {'192.168.0.12'} {pf:collections()} ERROR = !unsupported feature: RPC calls to built-in functions not supported by XRPC. This is because XRPC doesn't allow (for security reasons) direct call to built-in functions. To execute built-in functions, just put them in a user-defined function: $ cat builtins.xq module namespace foo = "builtins"; declare function foo:cols() { pf:collections() }; $ mclient -lx -g -s "pf:collections()" <collection updatable="true" size="91 KiB" numDocs="1">hello.xml</collection> $ mclient -lx -g -s "import module namespace f='builtins' at '/ufs/zhang/builtins.xq'; execute at {'localhost:50001'} {f:cols()}" <collection numDocs="1" size="91 KiB" updatable="true">hello.xml</collection>
PS1: there are 2 Mserver running: one on the local host/one on the remote host. The Java XRPC API does not need to run a Mserver on the local host, but mclient do (else I get a "initiating connection socket failed" error )
With mclient you can also connect to a remote Mserver and/or an Mserver listening to a different port than 50000. Please check the '-h' and '-p' options of 'mclient -h'. Kind regards, Jennie
PS2:I have Mserver 4.39.0 on the remote linux server and Mserver 4.36.5 on the windows client (The query also fails with client/linux/4.39.0 & server/linux/4.39.0)
PS3: the default example provided in the XRPC doc fails (no MIL operator) the same way: import module namespace test = "xrpc-test-function" at "http://192.168.0.12:50001/export/xrpc-mod.xq"; execute at {"192.168.0.12"} {test:add(100, 200)}
Regards Ryad ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first________________________________________... MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users
participants (2)
-
Ryad Ben-El-Kezadri
-
Ying Zhang