【发布时间】:2017-10-12 12:17:57
【问题描述】:
有一个 Pentaho 步骤我被卡住了。这是我在 Pentaho 步骤之一中的 SQL 查询:
select t.val_1 as Contract,
t.val_2 as Service,
t.val_3 as Calender,
t.val_4 as MSPProvider,
t.val_5 as MSPCustomer,
t.val_6 as ObjectName,
t.val_7 as EventID,
to_timestamp(t.val_8,'MM-DD-YYYY HH:MI:SS PM') as Startdate,
to_timestamp(t.val_9,'MM-DD-YYYY HH:MI:SS PM') as Startkeydate,
to_timestamp(t.val_10,'MM-DD-YYYY HH:MI:SS PM') as Enddate,
to_timestamp(t.val_11,'MM-DD-YYYY HH:MI:SS PM') as Endkeydate,
t.val_12 as Duration,
t.val_13 as DurationMod,
t.val_14 as Suspend,
t.val_15 as SuspendExternal,
t.val_16 as Excluded,
t.val_17 as Target,
t.val_18 as TargetUnit,
t.val_19 as Relation,
t.val_20 as Violated,
t.val_21 as CalculationType,
t.val_22 as calculationversion,
t.val_23 as Category,
'sec' as ValueUnit,
t.val_24 as TicketUnit,
t.val_25 as Severity,
t.val_26 as Impact,
t.val_27 as ExclusionID,
t.val_28 as OriginatorID,
t.val_25 as SeverityID,
t.val_29 as ReOpened,
t.create_date as CreateDate,
t.modify_date as ModifyDate
from t_slalom_outputs t
where t.is_active = 1
and t.table_name = 'TICKET'
and t.val_4 = '${MSP_PROVIDER}'
and t.modify_date > (SELECT sp_timestamp FROM public.msp_startingpoints where sp_name = 'etl_export_result_slalom')
modify_date > 之后的查询是从 Postgres 数据库中选择数据,其余的查询是从 Oracle 服务器获取数据。
我应该如何划分两者?
一个是从 Oracle 中的表 t_slalom_outputs 中获取数据,另一个是从 Postgres 表 msp_startingpoints 中获取数据。
修改后的date >(Postgres 查询)
有什么方法可以将 Postgres 查询作为参数值传递给整个查询?
【问题讨论】:
-
如果我明白你只关心修改日期大于某个值的 ORACLE.t_slalom_outputs 的行。限制值不依赖于 ORACLE 数据,但您不能对其进行硬编码,因为它取自 POSTGRES 数据库。
标签: pentaho etl kettle data-integration pentaho-data-integration