Skip to content
Advertisement

Dynamically frame Filter condition based on conditions

We have separate table maintained for condition / filters. Based on the conditions, filters to be applied at base table.

here’s the sample input conditional data for reference purpose

Based on this input conditions , filter to be derived as follows.

please help me in achieving the filter query

Advertisement

Answer

The below sparkSQL will help you to build the where clause,

PS: scenarios are derived based on reference data. Please update the query if any other scenario exists.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement