用新的散装加载程序设置密钥 [英] set key with new bulkloader

查看:177
本文介绍了用新的散装加载程序设置密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将脚本转换为使用新的散装加载程序

一>。 (使用原始批量加载程序时出现了什么问题
? - 我更喜欢使用Python编辑
配置文件...)

无论如何,我想要通过将
属性的组合分配给密钥来防止重复。
文档说:


如果您想使用或计算导入数据中的键
,请指定键
使用与属性
map相同的语法;即,external_name,
,import_template等。


所有示例都对当前属性应用转换。
















$ b $ p> - 属性:__key__
external_name:key
import_transform:entity.first_name + entity.last_name


解决方案

您可以使用'import_template'属性(记录为 here )而不是'import_transform':

   -  property:__key__ 
import_template:%(first_name)s%(last_name)s


I am converting a script to use the new bulkloader. (What was wrong with the original bulkloader? - I prefer writing Python to editing configuration files...)

Anyway, I want to prevent duplicates by assigning a combination of properties to the key. The docs say:

If you want to use or calculate a key from the import data, specify a key using the same syntax as the property map; that is, external_name, import_template, and so on.

All the examples apply a transform to the current property. How do I instead use a combination of other properties?

Should be something like:

- property: __key__
  external_name: key
  import_transform: entity.first_name + entity.last_name

解决方案

You can do this using the 'import_template' property (documented here) instead of 'import_transform':

- property: __key__
  import_template: "%(first_name)s %(last_name)s"

这篇关于用新的散装加载程序设置密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆