Hai @Ashok Kumar

Thank you for your response. However, my current approach involves hitting the database every time in order to obtain the desired results. Given that I am unsure of the number of q_ids that will be involved in the future, I am concerned about the performance impact. Therefore, I am exploring alternative approaches to address this issue.

Kindly let me know if there are any other approaches such as stored procedures or minimalistic database hits that can help me achieve my expected outcome.

I realize my previous request may have been confusing. Let me clarify my question.

For the current approach, I need to run the query each time by incrementing the column (queue_id) value. But I'm trying to run the query once, which should dynamically increment the column values. For sample Output I am expected:

quantiy_of_queue average_time_difference min_time_difference max_time_difference
1 05:25:15 01:25:15 06:26:15
2 06:25:15 02:25:15 07:26:15
3 06:20:15 01:25:15 07:30:15
4 04:25:15 02:25:15 06:40:15  

Hello @Robert Cemper

SORRY for the inconvenience!! I made some additional changes to the original content to add more clarity, that is the reason I have changed the content. This won't happen again in the future. I have updated the original content the same as previously. But I would like to thank and respect you.

Here, is the My Query

​ 

SELECT
COALESCE(SUM(CASE WHEN service_log.value_after_changing = 'GENERATE' THEN 1 ELSE 0 END), 0) AS generatedCount,
COALESCE(SUM(CASE WHEN service_log.value_after_changing = 'FINISH' THEN 1 ELSE 0 END), 0) AS finishedCount,
COALESCE(SUM(CASE WHEN service_log.value_after_changing = 'DROPOUT' THEN 1 ELSE 0 END), 0) AS dropoutCount,
COALESCE(SUM(CASE WHEN service_log.value_after_changing = 'CANCEL' THEN 1 ELSE 0 END), 0) AS cancelledCount
FROM
service_log
WHERE
service_log.id = 11 AND
service_log.created_at BETWEEN '2024-03-28T07:00:00' AND '2024-03-28T08:00:00'
GROUP BY
FLOOR(DATEDIFF('MINUTE', TO_TIMESTAMP('2024-03-28T07:00:00', 'YYYY-MM-DDTHH:MI:SS'), created_at) / 15 (i.e.,interval time));

This query implementation currently retrieve the data when available in each interval period if data not available in respective interval period no providing any data but my expectation is when data not available need to provide all counts as 0 value.

This is current response for fourth interval (07:46 to 08:00) :
[
{
"cancelled": 0,
"dropOut": 0,
"finished": 16,
"issued": 2
}
]
Expected response like this:
[
{
"cancelled": 0,
"dropOut": 0,
"finished": 0,
"issued": 0
},
{
"cancelled": 0,
"dropOut": 0,
"finished": 0,
"issued": 0
},
{
"cancelled": 0,
"dropOut": 0,
"finished": 0,
"issued": 0
},
{
"cancelled": 0,
"dropOut": 0,
"finished": 2,
"issued": 16
}
]

Thanks once again! @Robert Cemper for guidance

Yes, Dmitry Maslennikov
 

We don't use CHECK constraint, by default Hibernate will generate this query. I don't know it has some issues in dialect file. It has become a mandatory requirement for us to use Enums in our application. I'm unsure why this functionality isn't achievable in Quarkus versions 3 and above. We previously achieved this in Quarkus version 2, and it worked seamlessly with other databases like MySQL and PostgreSQL. However, I'm puzzled as to why I can't annotate Enum types in the IRIS database.

Can you please tell us if is there any possible way to achieve it? 

Thanks in advance.

Hello Dmitry Maslennikov,

It's really helpful to learn how to connect IRIS with Quarkus, especially for real-world applications.

However, I encountered an issue while using your application and adding a new column. The data type for that column is Enumeration, and I annotated it with @Enumerated(EnumeratedType.STRING). Unfortunately, I'm unable to create the table due to a DDL issue. I have attached the code snippet and error image below:

 

 

Can you help me fix this problem and solve it?
Thank you for your assistance.