Six Stars

tELTHiveOutput - Partition as date column wasn't accepting any date formats in single quotes

Hello,
I'm trying to use partition column as date but partition value '2017-07-17' not accepting any value.
Please let me know how to specify the partition value for date column.

Component : tELTHiveOutput

Configuring the output schema

Double-click tELTHiveOutput to open its Component view.
In the Field partition table, click In Partition column, enter type without any quotation marks and in Partition value, enter prospective in single quotation marks.

1 ACCEPTED SOLUTION

Accepted Solutions
Six Stars

Re: tELTHiveOutput - Partition as date column wasn't accepting any date formats in single quotes

Don't worry. Case statement working in tELTHiveOutput and resolve my issue. 

 

Here is the case statement which i used.

case when date_format(row2_cdc_load.header__timestamp,'yyyy-MM-dd') is null then '2017-07-16' else date_format(cdc_load.header__timestamp,'yyyy-MM-dd')  end

 

 

3 REPLIES
Moderator

Re: tELTHiveOutput - Partition as date column wasn't accepting any date formats in single quotes

Hello,

Is it a static partitioning or dynamic partitioning? Could you please have a look at this jira issue:https://jira.talendforge.org/browse/TBD-4465 to see if you have a similiar use case?

Best regards

Sabrina

 

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: tELTHiveOutput - Partition as date column wasn't accepting any date formats in single quotes

Hello,

Link doesn't help. I'm trying find options both static and dynamic partition in same job. My requirement was to combine both initial and incremental data load into target table. Initial load doesn't have date column or value.I want to set this date as static and looking for some options. I'm good with incremental load and successfully partitioned.

 

Is it possible to use a case statement in tELTHivemap expression where i can pass the static value for Hive_Default_Partition(Initial load)?

 

 

hive_partition_sample.png

 

Six Stars

Re: tELTHiveOutput - Partition as date column wasn't accepting any date formats in single quotes

Don't worry. Case statement working in tELTHiveOutput and resolve my issue. 

 

Here is the case statement which i used.

case when date_format(row2_cdc_load.header__timestamp,'yyyy-MM-dd') is null then '2017-07-16' else date_format(cdc_load.header__timestamp,'yyyy-MM-dd')  end