|
CREATE EXTERNAL TABLE IF NOT EXISTS __DATABASE_NAME__.__TABLE_NAME__ ( |
|
`date` date COMMENT "UTC date as YYYY-MM-DD", |
|
`time` string COMMENT "UTC time when the response finished as HH:MM:SS", |
|
location string COMMENT "Code for the edge location that served the request as XYZ1", |
|
bytes bigint COMMENT "Total number of bytes that the server sent to the viewer", |
|
request_ip string COMMENT "The IP address of the viewer that made the request", |
|
method string COMMENT "The HTTP method of the request", |
|
host string COMMENT "Domain name of the CloudFront distribution (e.g., d111111abcdef8.cloudfront.net)", |
|
uri string COMMENT "The path portion of the request URL, without query parameters", |
|
status int COMMENT "The HTTP status code of the response, or 000 is the viewer closed the connection", |
|
referrer string COMMENT "The value of the Referer header in the request", |
|
user_agent string COMMENT "The value of the User-Agent header in the request", |
|
query_string string COMMENT "The query string portion of the request path, or a hyphen", |
|
cookie string COMMENT "The value of the Cookie header in the request", |
|
result_type string COMMENT "A classification of the response, such as Hit, Miss, and Error", |
|
request_id string COMMENT "An opaque string that uniquely identifies a request", |
|
host_header string COMMENT "The value of the Host header in the request", |
|
request_protocol string COMMENT "The protocol of the viewer request, http, https, ws, wss ", |
|
request_bytes bigint COMMENT "The total number of bytes in the request", |
|
time_taken float COMMENT "Number of seconds the request took (e.g., 0.123)", |
|
xforwarded_for string COMMENT "The value of the X-Forwarded-For header in the request, or a hyphen", |
|
ssl_protocol string COMMENT "The SSL/TLS protocol that the viewer and server negotiated, or a hyphen", |
|
ssl_cipher string COMMENT "The SSL/TLS cipher that the viewer and server negotiated, or a hyphen", |
|
response_result_type string COMMENT "A classification of the response, such as Hit, Miss, and Error", |
|
http_version string COMMENT "The HTTP version of the request", |
|
fle_status string COMMENT "A code that indicates whether the request body was successfully processed, or a hyphen", |
|
fle_encrypted_fields int COMMENT "The number of encrypted fields forwarded to the origin, or a hyphen", |
|
c_port int COMMENT "The port number of the request", |
|
time_to_first_byte float COMMENT "The number of seconds between receiving the request and writing the first byte of the response", |
|
x_edge_detailed_result_type string COMMENT "When the result type is an error, this is the type of error, othewise it's the result type", |
|
sc_content_type string COMMENT "The value of the Content-Type header in the response", |
|
sc_content_len bigint COMMENT "The value of the Content-Length header in the response", |
|
sc_range_start bigint COMMENT "The start value of the Content-Range header in the response, or a hyphen", |
|
sc_range_end bigint COMMENT "The end value of the Content-Range header in the response, or a hyphen" |
|
) |
|
|
|
COMMENT "TKTKTK A description of the table" |
|
|
|
PARTITIONED BY ( |
|
`date` string |
|
) |
|
|
|
ROW FORMAT SERDE "org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe" |
|
|
|
WITH SERDEPROPERTIES ( |
|
"field.delim" = "\t", |
|
"serialization.format" = "\t" |
|
) |
|
|
|
STORED AS |
|
INPUTFORMAT "org.apache.hadoop.mapred.TextInputFormat" |
|
OUTPUTFORMAT "org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat" |
|
|
|
LOCATION "s3://__BUCKET_AND_PREFIX__/__DistributionId__/" |
|
|
|
TBLPROPERTIES ( |
|
"skip.header.line.count" = "1" |
|
"projection.enabled" = "true", |
|
"projection.date.type" = "date", |
|
"projection.date.range" = "2024/11/01,NOW", |
|
"projection.date.format" = "yyyy/MM/dd", |
|
"projection.date.interval" = "1", |
|
"projection.date.interval.unit" = "DAYS", |
|
"storage.location.template" = "s3://__BUCKET_AND_PREFIX__/__DistributionId__/${date}" |
|
|
|
); |