AWS Athena: Difference between revisions

From Federal Burro of Information
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
https://docs.aws.amazon.com/athena/latest/ug/functions-operators-reference-section.html
from the light sensor data project:
from the light sensor data project:


Line 19: Line 21:


  SELECT timestamp , reading1, reading2 from lightsensordb.sensordatatable LIMIT 100
  SELECT timestamp , reading1, reading2 from lightsensordb.sensordatatable LIMIT 100
string to date:
date_parse(b.APIDT, '%Y-%m-%d')

Revision as of 14:24, 28 March 2018

https://docs.aws.amazon.com/athena/latest/ug/functions-operators-reference-section.html

from the light sensor data project:

CREATE EXTERNAL TABLE IF NOT EXISTS lightsensordb.sensordatatable (
  `timestamp` int,
  `reading1` float,
  `reading2` float 
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'
WITH SERDEPROPERTIES (
  'serialization.format' = ' ',
  'field.delim' = ' ',
  'collection.delim' = 'undefined',
  'mapkey.delim' = 'undefined'
) LOCATION 's3://mymainsqueeze/sensor/'
TBLPROPERTIES ('has_encrypted_data'='false');


SELECT timestamp , reading1, reading2 from lightsensordb.sensordatatable LIMIT 100

string to date:

date_parse(b.APIDT, '%Y-%m-%d')