如何从hstore列属性table dim_user中删除敏感用户信息。并将其余部分加载到聚合表中。我从PgSQL数据库中选择并使用Pentaho Data Integration将数据加载到聚合表中。
attributes
""DURATION"=>"1", "END_DATE"=>"2017-07-18", "START_DATE"=>"2016-07-18", "AUTO_RENEWAL"=>"true", "MEMBER_SINCE"=>"Mon Jul 18 14:31:01 EDT 2016", "DURATION_TYPE"=>"YEARS", "SHIPPING_ADDRESS"=>"1 Glos Cres, Toronto, ON Canada A9l 111", "SUBSCRIPTION_TYPE"=>"MY_ADVANTAGE""
需要从上面删除“SHIPPING_ADDRESS”的值。
RESULT
""DURATION"=>"1", "END_DATE"=>"2017-07-18", "START_DATE"=>"2016-07-18", "AUTO_RENEWAL"=>"true", "MEMBER_SINCE"=>"Mon Jul 18 14:31:01 EDT 2016", "DURATION_TYPE"=>"YEARS", "SUBSCRIPTION_TYPE"=>"MY_ADVANTAGE"
感谢。
答案 0 :(得分:1)
hstore函数和运算符是described in the hstore documentation。这是相对简单的。
而不是:
SELECT cola, colb, colc FROM dim_user;
你可以这样做:
SELECT cola, colb, colc - 'SHIPPING_ADDRESS'::text FROM dim_user;
答案 1 :(得分:0)
选择时删除它:
select attributes - 'SIHPPING_ADDRESS' as attributes,
... other columns ...
from dim_user;
或创建一个执行此操作的视图,然后从Kettle中的视图中选择。