String/INT96 to Datatime - Amazon Athena/SQL - DDL/DML

萝らか妹 提交于 2020-01-25 09:04:16

问题


I have hosted my data on S3 Bucket in parquet format and i am trying to access it using Athena. I can see i can successfully access the hosted table. I detected something fishy when i try to access a column "createdon".

createdon is a timestamp column and it reflects same on Athena table, but when i try to query it using the provided SQL below query

SELECT createdon FROM "uat-raw"."opportunity" limit 10;

Unexpected output :  
+51140-02-21 19:00:00.000  
+51140-02-21 21:46:40.000  
+51140-02-22 00:50:00.000    
+51140-02-22 03:53:20.000   
+51140-02-22 06:56:40.000  
+51140-02-22 09:43:20.000  
+51140-02-22 12:46:40.000  


Expected output: 
2019-02-21 19:00:00.000
2019-02-21 21:46:40.000
2019-02-22 00:50:00.000
2019-02-22 03:53:20.000
2019-02-22 06:56:40.000
2019-02-22 09:43:20.000
2019-02-22 12:46:40.000

can any one help me with the same ?? and also i have attached pic for more information.

I expect an SQL query which i can use to query my data on S3 from Athena.

来源:https://stackoverflow.com/questions/58853686/string-int96-to-datatime-amazon-athena-sql-ddl-dml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!