Skip to content
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
4 changes: 2 additions & 2 deletions be/src/util/s3_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ struct S3ClientConf {

uint64_t get_hash() const {
uint64_t hash_code = 0;
hash_code ^= crc32_hash(ak);
hash_code ^= crc32_hash(sk);
// Use crc32_hash(ak + sk) hash to prevent swapped AK/SK order from producing same result.
hash_code ^= crc32_hash(ak + sk);
hash_code ^= crc32_hash(token);
hash_code ^= crc32_hash(endpoint);
hash_code ^= crc32_hash(region);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,24 @@ suite("test_outfile_with_different_s3", "p0") {
String region = getS3Region()
String bucket = context.config.otherConfigs.get("s3BucketName");

def outfile_url = outfile_to_S3(bucket, s3_endpoint, region, ak, sk)
def outFilePath = "${bucket}/outfile_different_s3/exp_"
test {
// change the ak/sk order
sql """
SELECT * FROM ${export_table_name} t ORDER BY user_id
INTO OUTFILE "s3://${outFilePath}"
FORMAT AS parquet
PROPERTIES (
"s3.endpoint" = "${s3_endpoint}",
"s3.region" = "${region}",
"s3.access_key" = "${sk}",
"s3.secret_key"="${ak}"
);
"""
exception "InvalidAccessKeyId"
}

def outfile_url = outfile_to_S3(bucket, s3_endpoint, region, ak, sk)
// http schema
qt_s3_tvf_1_http """ SELECT * FROM S3 (
"uri" = "http://${bucket}.${s3_endpoint}${outfile_url.substring(5 + bucket.length(), outfile_url.length() - 1)}0.parquet",
Expand All @@ -92,6 +108,10 @@ suite("test_outfile_with_different_s3", "p0") {
"region" = "${region}"
);
"""




} finally {
}

Expand Down
Loading