使用query_filter进行mlcp导出

问题描述

我试图将文件(从安装在计算机上的Marklogic服务器)导出到本地环境,并且出现以下错误

mlcp.sh export -host localhost -port 8000 -username admin \
>     -password admin -mode local -output_file_path \
>     /output_dir \
> -database data-hub-FINAL -document_selector {/envelope/instance/name-entity} \
> -query_filter {"wordQuery":{"name":["Jason"]}}


WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.hadoop.security.authentication.util.KerberosUtil (file:/mnt/c/Users/imam/Documents/2020_Learning_Imane/marklo/project/flight_school/mlcp-10.0.4.2/lib/hadoop-auth-2.6.0.jar) to method sun.security.krb5.Config.getInstance()
WARNING: Please consider reporting this to the maintainers of org.apache.hadoop.security.authentication.util.KerberosUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
20/08/25 17:52:05 INFO contentpump.ContentPump: Job name: local_2008896403_1
20/08/25 17:52:05 ERROR mapreduce.MarkLogicInputFormat: com.marklogic.xcc.exceptions.XQueryException: XDMP-UNEXPECTED: (err:XPST0003) Unexpected token Syntax error,unexpected Lbrace_
 [Session: user=admin,cb=data-hub-FINAL [ContentSource: user=admin,cb=data-hub-FINAL [provider: address=localhost/127.0.0.1:8000,pool=1/64]]]
 [Client: XCC/10.0-4,Server: XDBC/10.0-3]
on line 1
expr:,in xdmp:eval("for $f in xdmp:forest-open-replica(xdmp:database-forests(xdmp:da...")
in /MarkLogic/hadoop.xqy,on line 32
expr:,in hadoop:get-splits("","{/envelope/instance/name-entity}","cts:query(xdmp:unquote('{wordQuery:{name:[Jason]}}')/*)")
in /eval,on line 5
expr:

我不知道我要缺少什么,我已经尝试了一次简单的导入,并且效果很好。因此,我猜该错误来自我的查询语法。

有什么想法吗? 非常感谢

解决方法

https://docs.marklogic.com/guide/mlcp/export#id_66898

建议在使用-query_filter时使用选项文件,因为XML和JSON序列化查询都包含引号和其他字符,这些字符对Unix和Windows命令外壳具有特殊含义,这使得正确地对查询进行转义具有挑战性。 / p>

如果在命令行上使用-query_filter,则必须引用序列化查询,并且可能需要进行其他特殊字符转义。