Epoch to timeformat 'YYYY-MM-DD HH:MI:SS'

2019-06-23 16:37发布

Is there any way to format the epoch to timeformat 'YYYY-MM-DD HH:MI:SS' while doing redshift copy from s3 to redshift using COPY command

2条回答
看我几分像从前
2楼-- · 2019-06-23 16:51

Sample COPY query using javascript miliseconds (13 digits): Possible options in documentation

COPY "hits" FROM 's3://your-bucket/your_folder/'
      CREDENTIALS 'aws_access_key_id=<AWS_ACCESS_KEY_ID>;aws_secret_access_key=<AWS_SECRET_ACCESS_KEY>'
      FORMAT as JSON 's3://your-bucket/config/jsonpaths'
      TIMEFORMAT as 'epochmillisecs';
查看更多
干净又极端
3楼-- · 2019-06-23 17:03

You can use redshift COPY command with parameter TIMEFORMAT 'epochsecs' or TIMEFORMAT 'epochmillisecs' Check redshift documentation for more details

查看更多
登录 后发表回答