Is there an equivalent to Oracle’s `dual` table in AWS Athena?

Total
12
Shares

I typically use Oracle’s dual table to test functions that I have never used before prior to incorporating them in other queries. I was wondering if there is an equivalent dummy table in AWS Athena.

For example, I have never used Athena’s date_parse function. In Oracle, I would do the following to test if the function works as expected:

select
    date_parse('2021-05-18', '%Y-%m-%d') as does_it_work
from
    dual
;

Solution

dual should not be needed. You can just do:

select date_parse('2021-05-18', '%Y-%m-%d') as does_it_work

Or if you really like dual, you can do:

with dual as (
      select 1 as dummy
     )
select date_parse('2021-05-18', '%Y-%m-%d') as does_it_work
from dual;
Leave a Reply

Your email address will not be published. Required fields are marked *