在 Marklogic 视图中看不到任何数据
Cannot see any data in the Marklogic view
我已经创建了一个模板来在 Marklogic 数据库中创建一个视图。视图创建成功。
并使用 mlcp import 将 XML 文件中的数据提取到视图中。
我在终端 windows 中执行的 mlcp 脚本没有响应错误。
但是我看不到任何数据插入到视图中。
请您帮忙指出错误。
这是我的模板 -
import module namespace tde = "http://marklogic.com/xdmp/tde" at "/MarkLogic/tde.xqy";
if (xdmp:database-name(xdmp:database()) = "Documents") then
let $shipment-CBE:=
<template xmlns="http://marklogic.com/xdmp/tde">
<path-namespaces>
<path-namespace>
<prefix>ns00</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/PurchaseOrderHeader</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns0</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/ConsignmentHeader</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns1</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/PurchaseOrderDrop</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns2</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/ItemDetail</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns7</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/PurchaseOrderDelivery</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns9</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/BaseType</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns10</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/ASN</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns11</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/TransportationUnitHeader</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns13</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/ContainmentHeader</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns14</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/CargoBookingHeader</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns15</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/Consignment</namespace-uri>
</path-namespace>
</path-namespaces>
<context>/Shipment</context>
<collections>
<collections-and>
<collection>PowerBI</collection>
<collection>Shipment</collection>
</collections-and>
</collections>
<rows>
<row>
<schema-name>Shipment</schema-name>
<view-name>Test2</view-name>
<columns>
<column>
<name>StatusID</name>
<scalar-type>string</scalar-type>
<val>ns9:DocumentHeader/ns9:Version/ns9:CurrentVersion/ns9:DocStatus/ns9:StatusID</val>
</column>
<column>
<name>HouseBillRef</name>
<scalar-type>string</scalar-type>
<val>ns9:DocumentHeader/ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns0:ConsignmentHeader/ns0:HouseBillRef</val>
</column>
<column>
<name>HouseBillDate</name>
<scalar-type>string</scalar-type>
<val>ns9:DocumentHeader/ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns0:ConsignmentHeader/ns0:HouseBillDate</val>
</column>
<column>
<name>MasterBill</name>
<scalar-type>string</scalar-type>
<val>ns9:DocumentHeader/ns10:ASN/ns10:Schedule/ns11:TransportationUnitHeader/ns11:PrimarytUnit/ns11:TransportUnit/ns11:BillOfLading</val>
</column>
<column>
<name>VesselNamePrfSch</name>
<scalar-type>string</scalar-type>
<val>ns9:DocumentHeader/ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns15:Bookings/ns14:CargoBookingHeader/ns14:DefaultSchedule/ns11:TransportationUnitHeader/ns11:PrimarytUnit/ns11:TransportUnit/ns11:TransUnitName</val>
</column>
<column>
<name>POL_ETD_Prf_Sch</name>
<scalar-type>dateTime</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns15:Bookings/ns14:CargoBookingHeader/ns14:DefaultSchedule/ns5:TransportationUnitHeader/ns5:PrimarytUnit/ns5:TransportUnit/ns5:PortOfLoading/ns9:ScheduledDepartureDate</val>
</column>
<column>
<name>POD_ETA_Prf_Sch</name>
<scalar-type>dateTime</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns15:Bookings/ns14:CargoBookingHeader/ns14:DefaultSchedule/ns5:TransportationUnitHeader/ns5:PrimarytUnit/ns5:TransportUnit/ns5:PortOfDischarge/ns9:ScheduledArrivalDate</val>
</column>
<column>
<name>Trans_Mode</name>
<scalar-type>string</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:TransMode</val>
</column>
<column>
<name>Shipping_Terms</name>
<scalar-type>string</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:ShipmentTerms</val>
</column>
<column>
<name>LoadType</name>
<scalar-type>string</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:SeaLoadType</val>
</column>
<column>
<name>CargoDescription</name>
<scalar-type>string</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:CargoDescription/ns9:CargoDescr</val>
</column>
<column>
<name>PackType</name>
<scalar-type>string</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:CargoDescription/ns9:Packaging/ns9:Package/ns9:PackageType</val>
</column>
<column>
<name>PackQty</name>
<scalar-type>unsignedLong</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:CargoDescription/ns9:Packaging/ns9:Package/ns9:PackageQty</val>
</column>
<column>
<name>CBM</name>
<scalar-type>decimal</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:CargoDescription/ns9:Packaging/ns9:Package/ns9:WeightDims/ns9:M3</val>
</column>
<column>
<name>Net_Weight</name>
<scalar-type>decimal</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:CargoDescription/ns9:Packaging/ns9:Package/ns9:WeightDims/ns9:NetWeight</val>
</column>
<column>
<name>Gross_Weight</name>
<scalar-type>decimal</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:CargoDescription/ns9:Packaging/ns9:Package/ns9:WeightDims/ns9:GrossWeight</val>
</column>
<column>
<name>Litres</name>
<scalar-type>decimal</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:CargoDescription/ns9:Packaging/ns9:Package/ns9:WeightDims/ns9:Litres</val>
</column>
</columns>
</row>
</rows>
</template>
return (
tde:template-insert("/powerbi/Test2.xml",$shipment-CBE),
"shipmentCBE.xml OK"
)
else ("Please select the 'Documents' database.")
mlcp脚本运行后的响应-
C:\Users\admin-rp\Documents\Marklogic\ML_With_PowerBI\bi-tools-master\bi-tools-master\power-bi\marklogic_powerbi_tutorial\config>mlcp.bat -options_file CBETestFileInsert.txt
22/05/10 14:39:59 DEBUG contentpump.ContentPump: Command: IMPORT
22/05/10 14:39:59 DEBUG contentpump.ContentPump: Arguments: -input_file_path ../data/CBE00030166N.xml -username admin -password ... -input_file_type documents -document_type xml -host owc-db01.owc.com -port 8000 -output_collections PowerBI,Shipment
22/05/10 14:39:59 DEBUG contentpump.ContentPump: Running in: localmode
22/05/10 14:39:59 INFO contentpump.LocalJobRunner: Content type: XML
22/05/10 14:39:59 INFO contentpump.ContentPump: Job name: local_240243545_1
22/05/10 14:39:59 INFO contentpump.FileAndDirectoryInputFormat: Total input paths to process : 1
22/05/10 14:39:59 DEBUG contentpump.CombineDocumentInputFormat: Total # of splits: 1
22/05/10 14:39:59 DEBUG contentpump.CombineDocumentInputFormat: Total # of combined splits: 1
22/05/10 14:39:59 DEBUG mapreduce.ContentOutputFormat: init query:
fn:exists(xdmp:get-request-header('x-forwarded-for'));
let $xdbcHeaderf := fn:function-lookup(xs:QName('xdmp:get-xdbc-request-header'),1)
return if (exists($xdbcHeaderf)) then fn:exists($xdbcHeaderf('x-forwarded-for')) else false();
import module namespace hadoop = "http://marklogic.com/xdmp/hadoop" at "/MarkLogic/hadoop.xqy";
xdmp:host-name(xdmp:host()),
let $versionf := fn:function-lookup(xs:QName('xdmp:effective-version'),0)
return if (exists($versionf)) then $versionf() else 0,
let $repf := fn:function-lookup(xs:QName('hadoop:get-forest-replica-hosts'),2)
return exists($repf),let $segRepf := fn:function-lookup(xs:QName('hadoop:get-forest-replica-hosts-with-segment'),2)
return exists($segRepf),let $f := fn:function-lookup(xs:QName('hadoop:get-assignment-policy'),0)
return if (exists($f)) then $f() else ()
22/05/10 14:39:59 DEBUG mapreduce.ContentOutputFormat: HTTP compliant mode disabled since x-forwarded-for doesn't exist
22/05/10 14:39:59 DEBUG contentpump.ThreadManager: Initial thread pool size: 32
22/05/10 14:39:59 DEBUG contentpump.ThreadManager: Thread pool is fixed and will not auto-scale.
22/05/10 14:39:59 DEBUG contentpump.ThreadManager: Running with MultithreadedMapper. Initial thread count for split #0: 32
22/05/10 14:40:00 INFO contentpump.LocalJobRunner: completed 100%
22/05/10 14:40:00 INFO contentpump.LocalJobRunner: com.marklogic.mapreduce.MarkLogicCounter:
22/05/10 14:40:00 INFO contentpump.LocalJobRunner: INPUT_RECORDS: 1
22/05/10 14:40:00 INFO contentpump.LocalJobRunner: OUTPUT_RECORDS: 1
22/05/10 14:40:00 INFO contentpump.LocalJobRunner: OUTPUT_RECORDS_COMMITTED: 1
22/05/10 14:40:00 INFO contentpump.LocalJobRunner: OUTPUT_RECORDS_FAILED: 0
22/05/10 14:40:00 INFO contentpump.LocalJobRunner: Total execution time: 1 sec
这是 mlcp 脚本 -
IMPORT
-input_file_path
../data/CBE00030166N.xml
-username
admin
-password
*****
-input_file_type
documents
-document_type
xml
-host
owc-db01.owc.com
-port
8000
-output_collections
PowerBI,Shipment
您正在以 admin
用户的身份插入文档。您是否也以 admin
用户的身份查询并尝试阅读它们?
我没有看到为该 TDE 声明的任何明确权限。
仔细检查为视图设置了哪些权限,以及您尝试查询的用户拥有哪些权限。他们有 tde-view
角色吗?
Security on TDE Documents
Operations on template documents are controlled by:
The http://marklogic.com/xdmp/tde collection
, which is a protected collection that contains TDE template documents.
The tde-admin
role, which is required to access the TDE protected collection.
The tde-view
role, which is required to view documents in the TDE protected collection. Access to views can be further restricted by setting additional permissions on the template documents that define the views. Since the same view can be declared in multiple templates loaded with different permissions, the access to views must be controlled at the column level as follows:
Column level read permissions are implicit by default and are derived from the read permissions set on the template documents. Permissions can also be explicitly set on a column using the permissions element. Permissions on a column are not required to be identical and are ORed together. A user with a role that has at least one of the read permissions set on a column will be able to see the column.
If a user does not have permissions on any of the view's columns, the view itself is not visible.
解决了问题:
有一个命名空间,当省略时允许我看到视图。
xmlns="http://www.globaltrademanagement_export.com/Shipment
虽然这存在于输入 xml 文件中。但令人惊讶的是 运行 mlcp 导入脚本时没有错误。
视图可能没有理由引发错误。也许它仍然是一个有效的视图,上下文只是没有匹配..所以没有错误..
我怀疑没有任何匹配项,因为您将模板的上下文设置为“/Shipment”而不是“/Some-namesace:Shipment”
为了帮助解决这些问题,我建议使用:tde:node-data-extraxt()
我已经创建了一个模板来在 Marklogic 数据库中创建一个视图。视图创建成功。 并使用 mlcp import 将 XML 文件中的数据提取到视图中。 我在终端 windows 中执行的 mlcp 脚本没有响应错误。 但是我看不到任何数据插入到视图中。
请您帮忙指出错误。
这是我的模板 -
import module namespace tde = "http://marklogic.com/xdmp/tde" at "/MarkLogic/tde.xqy";
if (xdmp:database-name(xdmp:database()) = "Documents") then
let $shipment-CBE:=
<template xmlns="http://marklogic.com/xdmp/tde">
<path-namespaces>
<path-namespace>
<prefix>ns00</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/PurchaseOrderHeader</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns0</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/ConsignmentHeader</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns1</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/PurchaseOrderDrop</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns2</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/ItemDetail</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns7</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/PurchaseOrderDelivery</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns9</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/BaseType</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns10</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/ASN</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns11</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/TransportationUnitHeader</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns13</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/ContainmentHeader</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns14</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/CargoBookingHeader</namespace-uri>
</path-namespace>
<path-namespace>
<prefix>ns15</prefix>
<namespace-uri>http://www.globaltrademanagement_export.com/Consignment</namespace-uri>
</path-namespace>
</path-namespaces>
<context>/Shipment</context>
<collections>
<collections-and>
<collection>PowerBI</collection>
<collection>Shipment</collection>
</collections-and>
</collections>
<rows>
<row>
<schema-name>Shipment</schema-name>
<view-name>Test2</view-name>
<columns>
<column>
<name>StatusID</name>
<scalar-type>string</scalar-type>
<val>ns9:DocumentHeader/ns9:Version/ns9:CurrentVersion/ns9:DocStatus/ns9:StatusID</val>
</column>
<column>
<name>HouseBillRef</name>
<scalar-type>string</scalar-type>
<val>ns9:DocumentHeader/ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns0:ConsignmentHeader/ns0:HouseBillRef</val>
</column>
<column>
<name>HouseBillDate</name>
<scalar-type>string</scalar-type>
<val>ns9:DocumentHeader/ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns0:ConsignmentHeader/ns0:HouseBillDate</val>
</column>
<column>
<name>MasterBill</name>
<scalar-type>string</scalar-type>
<val>ns9:DocumentHeader/ns10:ASN/ns10:Schedule/ns11:TransportationUnitHeader/ns11:PrimarytUnit/ns11:TransportUnit/ns11:BillOfLading</val>
</column>
<column>
<name>VesselNamePrfSch</name>
<scalar-type>string</scalar-type>
<val>ns9:DocumentHeader/ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns15:Bookings/ns14:CargoBookingHeader/ns14:DefaultSchedule/ns11:TransportationUnitHeader/ns11:PrimarytUnit/ns11:TransportUnit/ns11:TransUnitName</val>
</column>
<column>
<name>POL_ETD_Prf_Sch</name>
<scalar-type>dateTime</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns15:Bookings/ns14:CargoBookingHeader/ns14:DefaultSchedule/ns5:TransportationUnitHeader/ns5:PrimarytUnit/ns5:TransportUnit/ns5:PortOfLoading/ns9:ScheduledDepartureDate</val>
</column>
<column>
<name>POD_ETA_Prf_Sch</name>
<scalar-type>dateTime</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns15:Bookings/ns14:CargoBookingHeader/ns14:DefaultSchedule/ns5:TransportationUnitHeader/ns5:PrimarytUnit/ns5:TransportUnit/ns5:PortOfDischarge/ns9:ScheduledArrivalDate</val>
</column>
<column>
<name>Trans_Mode</name>
<scalar-type>string</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:TransMode</val>
</column>
<column>
<name>Shipping_Terms</name>
<scalar-type>string</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:ShipmentTerms</val>
</column>
<column>
<name>LoadType</name>
<scalar-type>string</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:SeaLoadType</val>
</column>
<column>
<name>CargoDescription</name>
<scalar-type>string</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:CargoDescription/ns9:CargoDescr</val>
</column>
<column>
<name>PackType</name>
<scalar-type>string</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:CargoDescription/ns9:Packaging/ns9:Package/ns9:PackageType</val>
</column>
<column>
<name>PackQty</name>
<scalar-type>unsignedLong</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:CargoDescription/ns9:Packaging/ns9:Package/ns9:PackageQty</val>
</column>
<column>
<name>CBM</name>
<scalar-type>decimal</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:CargoDescription/ns9:Packaging/ns9:Package/ns9:WeightDims/ns9:M3</val>
</column>
<column>
<name>Net_Weight</name>
<scalar-type>decimal</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:CargoDescription/ns9:Packaging/ns9:Package/ns9:WeightDims/ns9:NetWeight</val>
</column>
<column>
<name>Gross_Weight</name>
<scalar-type>decimal</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:CargoDescription/ns9:Packaging/ns9:Package/ns9:WeightDims/ns9:GrossWeight</val>
</column>
<column>
<name>Litres</name>
<scalar-type>decimal</scalar-type>
<val>ns10:ASN/ns10:TrackedItem/ns15:Consignment/ns8:ConsignmentHeader/ns8:CargoSummary/ns8:CargoDescription/ns9:Packaging/ns9:Package/ns9:WeightDims/ns9:Litres</val>
</column>
</columns>
</row>
</rows>
</template>
return (
tde:template-insert("/powerbi/Test2.xml",$shipment-CBE),
"shipmentCBE.xml OK"
)
else ("Please select the 'Documents' database.")
mlcp脚本运行后的响应-
C:\Users\admin-rp\Documents\Marklogic\ML_With_PowerBI\bi-tools-master\bi-tools-master\power-bi\marklogic_powerbi_tutorial\config>mlcp.bat -options_file CBETestFileInsert.txt
22/05/10 14:39:59 DEBUG contentpump.ContentPump: Command: IMPORT
22/05/10 14:39:59 DEBUG contentpump.ContentPump: Arguments: -input_file_path ../data/CBE00030166N.xml -username admin -password ... -input_file_type documents -document_type xml -host owc-db01.owc.com -port 8000 -output_collections PowerBI,Shipment
22/05/10 14:39:59 DEBUG contentpump.ContentPump: Running in: localmode
22/05/10 14:39:59 INFO contentpump.LocalJobRunner: Content type: XML
22/05/10 14:39:59 INFO contentpump.ContentPump: Job name: local_240243545_1
22/05/10 14:39:59 INFO contentpump.FileAndDirectoryInputFormat: Total input paths to process : 1
22/05/10 14:39:59 DEBUG contentpump.CombineDocumentInputFormat: Total # of splits: 1
22/05/10 14:39:59 DEBUG contentpump.CombineDocumentInputFormat: Total # of combined splits: 1
22/05/10 14:39:59 DEBUG mapreduce.ContentOutputFormat: init query:
fn:exists(xdmp:get-request-header('x-forwarded-for'));
let $xdbcHeaderf := fn:function-lookup(xs:QName('xdmp:get-xdbc-request-header'),1)
return if (exists($xdbcHeaderf)) then fn:exists($xdbcHeaderf('x-forwarded-for')) else false();
import module namespace hadoop = "http://marklogic.com/xdmp/hadoop" at "/MarkLogic/hadoop.xqy";
xdmp:host-name(xdmp:host()),
let $versionf := fn:function-lookup(xs:QName('xdmp:effective-version'),0)
return if (exists($versionf)) then $versionf() else 0,
let $repf := fn:function-lookup(xs:QName('hadoop:get-forest-replica-hosts'),2)
return exists($repf),let $segRepf := fn:function-lookup(xs:QName('hadoop:get-forest-replica-hosts-with-segment'),2)
return exists($segRepf),let $f := fn:function-lookup(xs:QName('hadoop:get-assignment-policy'),0)
return if (exists($f)) then $f() else ()
22/05/10 14:39:59 DEBUG mapreduce.ContentOutputFormat: HTTP compliant mode disabled since x-forwarded-for doesn't exist
22/05/10 14:39:59 DEBUG contentpump.ThreadManager: Initial thread pool size: 32
22/05/10 14:39:59 DEBUG contentpump.ThreadManager: Thread pool is fixed and will not auto-scale.
22/05/10 14:39:59 DEBUG contentpump.ThreadManager: Running with MultithreadedMapper. Initial thread count for split #0: 32
22/05/10 14:40:00 INFO contentpump.LocalJobRunner: completed 100%
22/05/10 14:40:00 INFO contentpump.LocalJobRunner: com.marklogic.mapreduce.MarkLogicCounter:
22/05/10 14:40:00 INFO contentpump.LocalJobRunner: INPUT_RECORDS: 1
22/05/10 14:40:00 INFO contentpump.LocalJobRunner: OUTPUT_RECORDS: 1
22/05/10 14:40:00 INFO contentpump.LocalJobRunner: OUTPUT_RECORDS_COMMITTED: 1
22/05/10 14:40:00 INFO contentpump.LocalJobRunner: OUTPUT_RECORDS_FAILED: 0
22/05/10 14:40:00 INFO contentpump.LocalJobRunner: Total execution time: 1 sec
这是 mlcp 脚本 -
IMPORT
-input_file_path
../data/CBE00030166N.xml
-username
admin
-password
*****
-input_file_type
documents
-document_type
xml
-host
owc-db01.owc.com
-port
8000
-output_collections
PowerBI,Shipment
您正在以 admin
用户的身份插入文档。您是否也以 admin
用户的身份查询并尝试阅读它们?
我没有看到为该 TDE 声明的任何明确权限。
仔细检查为视图设置了哪些权限,以及您尝试查询的用户拥有哪些权限。他们有 tde-view
角色吗?
Security on TDE Documents
Operations on template documents are controlled by:
The
http://marklogic.com/xdmp/tde collection
, which is a protected collection that contains TDE template documents.The
tde-admin
role, which is required to access the TDE protected collection.The
tde-view
role, which is required to view documents in the TDE protected collection. Access to views can be further restricted by setting additional permissions on the template documents that define the views. Since the same view can be declared in multiple templates loaded with different permissions, the access to views must be controlled at the column level as follows:Column level read permissions are implicit by default and are derived from the read permissions set on the template documents. Permissions can also be explicitly set on a column using the permissions element. Permissions on a column are not required to be identical and are ORed together. A user with a role that has at least one of the read permissions set on a column will be able to see the column.
If a user does not have permissions on any of the view's columns, the view itself is not visible.
解决了问题:
有一个命名空间,当省略时允许我看到视图。
xmlns="http://www.globaltrademanagement_export.com/Shipment
虽然这存在于输入 xml 文件中。但令人惊讶的是 运行 mlcp 导入脚本时没有错误。
视图可能没有理由引发错误。也许它仍然是一个有效的视图,上下文只是没有匹配..所以没有错误..
我怀疑没有任何匹配项,因为您将模板的上下文设置为“/Shipment”而不是“/Some-namesace:Shipment”
为了帮助解决这些问题,我建议使用:tde:node-data-extraxt()