This message was deleted.
# general
s
This message was deleted.
l
Which version of Druid are you on? Perhaps you’d wanna try casting like
CAST(? AS VARCHAR)
and losing everything post that and try?
s
How about using this expression instead? It will generate 1 for Monday, 2 for Tuesday... etc.
Copy code
EXTRACT( DOW FROM TIME_PARSE(`orderentit0_`.`event_business_date`)
will it have NULLs? is that what the 8 value is for? For that you can surround it in a COALESCE.
c
@Laksh Singla Hi Laksh, thank you for your reply! I am currently on Druid 25. The CAST function was not generated by myself; I think it was automatically generated by Druid when it reads the SQL query I inputted.
@Sergio Ferragut Hi Sergio, thank you for your response. This function would indeed work for the ordering of day of week, but I still need to print out the actual day of week (Monday, Tuesday, ...) in the query result, instead of just the numbers (1, 2,...). I am thinking to put both the
Copy code
EXTRACT( DOW FROM TIME_PARSE(`orderentit0_`.`event_business_date`)
and the
Copy code
TIME_FORMAT(TIME_PARSE(`orderentit0_`.`event_business_date`, NULL), 'EEEE')
in SELECT and GROUP BY clauses, and in order by, I would only order by
Copy code
EXTRACT( DOW FROM TIME_PARSE(`orderentit0_`.`event_business_date`)
I will give it a try and let you know.
s
Yeah, that should work. I missed a parenthesis:
Copy code
EXTRACT( DOW FROM TIME_PARSE(`orderentit0_`.`event_business_date`) )
c
@Sergio Ferragut Thanks Sergio.