Dear Support Team,
Can you pls reply to my query.
Hi. Thanks for your reply.
I have used case clause in the derived view with new field but not with base view with SQL Query.
CASE WHEN A IS NOT NULL THEN B WHEN C IS NOT NULL THEN D ELSE NULL end
When I run the derived view getting error as method not supported.
Below is the sql query of case clause from the execution trace where null is transformed to ? and hive not supporting.
SELECT t1.a, t1.b, t1.c, t1.d, t1.e, t1.dt,
CASE WHEN t1.a IS NOT NULL THEN t1.b WHEN t1.c IS NOT NULL THEN t1.d ELSE ? END
FROM ( SELECT max(t0.dt) AS dt FROM <table> t0) s0,
<table> t1 WHERE (s0.dt = t1.dt)
parameterts:[null]
So I changed the case clause for temporary as:
CASE WHEN A IS NOT NULL THEN B WHEN C IS NOT NULL THEN D ELSE '9999-12-31' end
When I run the derived view and it ran successfully.
I have checked the property “Delegate SQL sentence as subquery property” and is set to “Yes” in the wrapper source configuration.
With respect to queries cannot be delegated to the database I have used the logic as :
case WHEN (to_date('yyyy-MM-dd', substring(aum_end_dt, 0, 10)) < now()) THEN 'EXPIRED' ELSE 'ACTIVE' END
The execution trace shows to_date cannot be delegated to the database.
Can you please help me how to resolve the issue with NULL as the method is not supporting and to_date as the function not delegated to the database.