I have a web application with hive db at back end from which users selects 4 different type of values and related data is displayed on UI.
Example the fields may be:
- Project ID
- Sub-portfolio
- Project Status
- Project Finance Status
User can select different values for the fields mentioned ( single or multiple) and request for data.
I have a single hive query with multiple where IN clause and combined with AND logical operator to generate the data.
All is good untill user is selecting atleast one value for each field. But if the user selects filters for 3 fields and leaves on blank then '' is passed to IN clause in where condition and no data is displayed. As none of the rows match the condition.
Where as if a field is not selected I have to pass something in IN clause to get all the data for that field or to remove IN clause for that field.
To check everytime if a value is selected before creating a query will involve a lot of cases.
If anyone can suggest a single query with multiple where IN, and pass some parameter to get all the rows for a fields where no value is selected.
Note: I am using hive JDBC queries.