Skip to Content
0

Incorrect values with LEAD and SECONDS_BETWEEN in HANA 2.0 SP2 system

Nov 15, 2017 at 08:13 PM

48

avatar image
Former Member

Hi,

We migrated from SP11 (1.0.112) to HANA 2.0 SP2. Post migration, query with LEAD and SECONDS_BETWEEN function is behaving weird, infact incorrectly.

In my query, I calculate LEAD value of a SECONDDATE column and then find out days between SECONDDATE column and the LEAD value. In SP11 I get a positive value, but in 2.0 system these values are negated.

Same issue happens while using SECONDS_BETWEEN in LAG function.

This is how my query looks like:

SELECT ID, DATETIME, SEQ_NUM,

LEAD(DATETIME) PARTITION BY (ID ORDER BY SEQ_NUM) AS LEAD_TIME,

SECONDS_BETWEEN(DATETIME, LEAD(DATETIME) PARTITION BY (ID ORDER BY SEQ_NUM)) AS LEAD_TIME_DIFF_SECS,

LAG(DATETIME) PARTITION BY (ID ORDER BY SEQ_NUM) AS LAG_TIME,

SECONDS_BETWEEN(DATETIME, LAG(DATETIME) PARTITION BY (ID ORDER BY SEQ_NUM)) AS LAG_TIME_DIFF_SECS

FROM TABLE;

Output from SP11 system:

Output from 2.0 SP2 system:

Has anyone faced similar issue?

Thanks,

Chandra.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
avatar image
Former Member Dec 04, 2017 at 05:48 PM
1

Hi All,

This is a known issue in 2.0 SPS20 and is resolved in 2.0 SPS21. Here the is the note.

https://launchpad.support.sap.com/#/notes/2529711

Thanks,

Chandra.

Share
10 |10000 characters needed characters left characters exceeded