prestodb / presto

The official home of the Presto distributed SQL query engine for big data
http://prestodb.io
Apache License 2.0
15.97k stars 5.35k forks source link

$file_modified_time cannot be used in view #22702

Open mlamias opened 4 months ago

mlamias commented 4 months ago

I am attempting to create a view in AWS Athena using $file_modifed_time. However, I continue to get an error that reads,

"This query ran against the "" database, unless qualified by the query. Please post the error message on our forum or contact customer support with Query Id:"

I can run the following query without any problems:

select "$file_modified_time" as last_update_date from MY_TABLE

I can also run the following create view without any problem (using $path):

create or replace view MY_VIEW as 
select "$path" as my_path from MY_TABLE

However, I cannot create a view from $file_modified_time:

create or replace view MY_VIEW as 
select "$file_modified_time" as last_update_date from MY_TABLE

without getting the error listed above. Is this a bug?

elharo commented 4 months ago

Which connector are you using?

imjalpreet commented 4 months ago

@mlamias I tried creating a similar view using the hive connector and I don't see any issue on my end. Based on the error message, wanted to confirm if you are using Amazon Athena? If yes, please reach out to them since it's a closed-source product. If you are on open-source Presto, can you please let us know the Presto version being used and if possible please add the full stacktrace from Presto UI?