Skip to content
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

[Backport 2.x] Remove manual refresh for S3 integrations #1227

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,13 @@ export function SetupBottomBar({
'{table_name}',
`${config.connectionDataSource}.default.${config.connectionTableName}`
);
queryStr = queryStr.replaceAll('{s3_bucket_location}', config.connectionLocation);
// We append to this URI in internal queries, so we normalize it to have no trailing slash
let trimmedLocation = config.connectionLocation.trim();
trimmedLocation = trimmedLocation.endsWith('/')
? trimmedLocation.slice(0, trimmedLocation.length - 1)
: trimmedLocation;

queryStr = queryStr.replaceAll('{s3_bucket_location}', trimmedLocation);
queryStr = queryStr.replaceAll('{object_name}', config.connectionTableName);
queryStr = queryStr.replaceAll(/\s+/g, ' ');
const result = await runQuery(queryStr, config.connectionDataSource, sessionId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,10 @@ SELECT
classification as `aws.elb.classification`,
classification_reason as `aws.elb.classification_reason`
FROM
{table_name};
{table_name}
WITH (
auto_refresh = 'true',
checkpoint_location = '{s3_bucket_location}/checkpoint',
watermark_delay = '1 Minute',
extra_options = '{ "{table_name}": { "maxFilesPerTrigger": "10" }}'
);

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@
"name": "create_mv",
"version": "1.0.0",
"language": "sql"
},
{
"name": "refresh_mv",
"version": "1.0.0",
"language": "sql"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,10 @@ CREATE MATERIALIZED VIEW {table_name}_mview AS
ELSE 'egress'
END AS `aws.vpc.flow-direction`
FROM
{table_name};
{table_name}
WITH (
auto_refresh = 'true',
checkpoint_location = '{s3_bucket_location}/checkpoint',
watermark_delay = '1 Minute',
extra_options = '{ "{table_name}": { "maxFilesPerTrigger": "10" }}'
)

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@
"name": "create_mv_vpc",
"version": "1.0.0",
"language": "sql"
},
{
"name": "refresh_mv_vpc",
"version": "1.0.0",
"language": "sql"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ SELECT
body_bytes_sent AS `http.response.bytes`,
'nginx.access' AS `event.domain`
FROM {table_name}
WITH (
auto_refresh = 'true',
checkpoint_location = '{s3_bucket_location}/checkpoint',
watermark_delay = '1 Minute',
extra_options = '{ "{table_name}": { "maxFilesPerTrigger": "10" }}'
);

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@
"name": "create_mv",
"version": "1.0.0",
"language": "sql"
},
{
"name": "refresh_mv",
"version": "1.0.0",
"language": "sql"
}
]
},
Expand Down
Loading