-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix flint skipping index syntax issues #1846
Changes from 6 commits
b61d5f9
df37903
468c3b5
1be3f9d
1f85628
6388bbe
ed82366
f313d27
82c30fb
ca5e2b8
893cea6
602314b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,5 +58,5 @@ CREATE EXTERNAL TABLE IF NOT EXISTS {table_name} ( | |
accountid STRING, | ||
eventday STRING | ||
) | ||
USING json | ||
USING parquet | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice. Unrelated to this change, but I do notice that there is an empty file called "create_mv_vpc-1.0.0.sql" in the vpc asset directory. Should we also remove that? |
||
LOCATION '{s3_bucket_location}' |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
CREATE MATERIALIZED VIEW {table_name}__mview AS | ||
SELECT | ||
rec.userIdentity.type AS `aws.cloudtrail.userIdentity.type`, | ||
rec.userIdentity.principalId AS `aws.cloudtrail.userIdentity.principalId`, | ||
rec.userIdentity.arn AS `aws.cloudtrail.userIdentity.arn`, | ||
rec.userIdentity.accountId AS `aws.cloudtrail.userIdentity.accountId`, | ||
rec.userIdentity.invokedBy AS `aws.cloudtrail.userIdentity.invokedBy`, | ||
rec.userIdentity.accessKeyId AS `aws.cloudtrail.userIdentity.accessKeyId`, | ||
rec.userIdentity.userName AS `aws.cloudtrail.userIdentity.userName`, | ||
rec.userIdentity.sessionContext.attributes.mfaAuthenticated AS `aws.cloudtrail.userIdentity.sessionContext.attributes.mfaAuthenticated`, | ||
CAST(rec.userIdentity.sessionContext.attributes.creationDate AS TIMESTAMP) AS `aws.cloudtrail.userIdentity.sessionContext.attributes.creationDate`, | ||
rec.userIdentity.sessionContext.sessionIssuer.type AS `aws.cloudtrail.userIdentity.sessionContext.sessionIssuer.type`, | ||
rec.userIdentity.sessionContext.sessionIssuer.principalId AS `aws.cloudtrail.userIdentity.sessionContext.sessionIssuer.principalId`, | ||
rec.userIdentity.sessionContext.sessionIssuer.arn AS `aws.cloudtrail.userIdentity.sessionContext.sessionIssuer.arn`, | ||
rec.userIdentity.sessionContext.sessionIssuer.accountId AS `aws.cloudtrail.userIdentity.sessionContext.sessionIssuer.accountId`, | ||
rec.userIdentity.sessionContext.sessionIssuer.userName AS `aws.cloudtrail.userIdentity.sessionContext.sessionIssuer.userName`, | ||
rec.userIdentity.sessionContext.ec2RoleDelivery AS `aws.cloudtrail.userIdentity.sessionContext.ec2RoleDelivery`, | ||
|
||
rec.eventVersion AS `aws.cloudtrail.eventVersion`, | ||
CAST(rec.eventTime AS TIMESTAMP) AS `@timestamp`, | ||
rec.eventSource AS `aws.cloudtrail.eventSource`, | ||
rec.eventName AS `aws.cloudtrail.eventName`, | ||
rec.eventCategory AS `aws.cloudtrail.eventCategory`, | ||
rec.eventType AS `aws.cloudtrail.eventType`, | ||
rec.eventId AS `aws.cloudtrail.eventId`, | ||
|
||
rec.awsRegion AS `aws.cloudtrail.awsRegion`, | ||
rec.sourceIPAddress AS `aws.cloudtrail.sourceIPAddress`, | ||
rec.userAgent AS `aws.cloudtrail.userAgent`, | ||
rec.errorCode AS `errorCode`, | ||
rec.errorMessage AS `errorMessage`, | ||
rec.requestParameters AS `aws.cloudtrail.requestParameter`, | ||
rec.responseElements AS `aws.cloudtrail.responseElements`, | ||
rec.additionalEventData AS `aws.cloudtrail.additionalEventData`, | ||
rec.requestId AS `aws.cloudtrail.requestId`, | ||
rec.resources AS `aws.cloudtrail.resources`, | ||
rec.apiVersion AS `aws.cloudtrail.apiVersion`, | ||
rec.readOnly AS `aws.cloudtrail.readOnly`, | ||
rec.recipientAccountId AS `aws.cloudtrail.recipientAccountId`, | ||
rec.serviceEventDetails AS `aws.cloudtrail.serviceEventDetails`, | ||
rec.sharedEventId AS `aws.cloudtrail.sharedEventId`, | ||
rec.vpcEndpointId AS `aws.cloudtrail.vpcEndpointId`, | ||
rec.tlsDetails.tlsVersion AS `aws.cloudtrail.tlsDetails.tls_version`, | ||
rec.tlsDetails.cipherSuite AS `aws.cloudtrail.tlsDetailscipher_suite`, | ||
rec.tlsDetails.clientProvidedHostHeader AS `aws.cloudtrail.tlsDetailsclient_provided_host_header` | ||
FROM | ||
{table_name} | ||
LATERAL VIEW explode(Records) myTable AS rec | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are there issues with having the table alias default to |
||
WITH ( | ||
auto_refresh = true, | ||
refresh_interval = '15 Minute', | ||
checkpoint_location = '{s3_checkpoint_location}', | ||
watermark_delay = '1 Minute', | ||
extra_options = '{ "{table_name}": { "maxFilesPerTrigger": "10" }}' | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
CREATE EXTERNAL TABLE IF NOT EXISTS {table_name} ( | ||
Records ARRAY<STRUCT< | ||
CREATE EXTERNAL TABLE IF NOT EXISTS {table_name} ( | ||
eventVersion STRING, | ||
userIdentity STRUCT< | ||
type:STRING, | ||
|
@@ -56,10 +55,10 @@ CREATE EXTERNAL TABLE IF NOT EXISTS {table_name} ( | |
cipherSuite:STRING, | ||
clientProvidedHostHeader:STRING | ||
> | ||
>> | ||
) USING json | ||
LOCATION '{s3_bucket_location}' | ||
) | ||
USING json | ||
OPTIONS ( | ||
compression='gzip', | ||
recursivefilelookup='true' | ||
PATH '{s3_bucket_location}', | ||
recursivefilelookup='true', | ||
multiline 'true' | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is multiline part case sensitive. I've usually seen commands with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think both |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
CREATE EXTERNAL TABLE IF NOT EXISTS {table_name} ( | ||
Records ARRAY<STRUCT< | ||
eventVersion STRING, | ||
userIdentity STRUCT< | ||
type:STRING, | ||
principalId:STRING, | ||
arn:STRING, | ||
accountId:STRING, | ||
invokedBy:STRING, | ||
accessKeyId:STRING, | ||
userName:STRING, | ||
sessionContext:STRUCT< | ||
attributes:STRUCT< | ||
mfaAuthenticated:STRING, | ||
creationDate:STRING | ||
>, | ||
sessionIssuer:STRUCT< | ||
type:STRING, | ||
principalId:STRING, | ||
arn:STRING, | ||
accountId:STRING, | ||
userName:STRING | ||
>, | ||
ec2RoleDelivery:STRING, | ||
webIdFederationData:MAP<STRING,STRING> | ||
> | ||
>, | ||
eventTime STRING, | ||
eventSource STRING, | ||
eventName STRING, | ||
awsRegion STRING, | ||
sourceIPAddress STRING, | ||
userAgent STRING, | ||
errorCode STRING, | ||
errorMessage STRING, | ||
requestParameters STRING, | ||
responseElements STRING, | ||
additionalEventData STRING, | ||
requestId STRING, | ||
eventId STRING, | ||
resources ARRAY<STRUCT< | ||
arn:STRING, | ||
accountId:STRING, | ||
type:STRING | ||
>>, | ||
eventType STRING, | ||
apiVersion STRING, | ||
readOnly STRING, | ||
recipientAccountId STRING, | ||
serviceEventDetails STRING, | ||
sharedEventId STRING, | ||
vpcEndpointId STRING, | ||
eventCategory STRING, | ||
tlsDetails STRUCT< | ||
tlsVersion:STRING, | ||
cipherSuite:STRING, | ||
clientProvidedHostHeader:STRING | ||
> | ||
>> | ||
) | ||
USING json | ||
LOCATION '{s3_bucket_location}' | ||
OPTIONS ( | ||
compression='gzip', | ||
recursivefilelookup='true', | ||
multiline 'true' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question? Should this be |
||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`traffic.bytes` ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch - thanks