Skip to content

[Fix](S3 tvf) fix that S3 tvf can not run properly #24289

Merged
morningman merged 1 commit intoapache:masterfrom
BePPPower:fixS3tvf
Sep 14, 2023
Merged

[Fix](S3 tvf) fix that S3 tvf can not run properly #24289
morningman merged 1 commit intoapache:masterfrom
BePPPower:fixS3tvf

Conversation

@BePPPower
Copy link
Contributor

@BePPPower BePPPower commented Sep 13, 2023

Proposed changes

Issue Number: close #xxx

bug describe

There will be an error althouth when we use correctness S3 properties:

select * from s3(     
"uri" = "https://xxx.com/bucket/exp_f123b8def7854e52-909204d211935e70_0.orc",     
"s3.secret_key"="sk",     
"s3.access_key" = "ak",     
"format" = "orc" );

ERROR 1105 (HY000): errCode = 2, detailMessage = (127.0.0.1)[INVALID_ARGUMENT]S3 properties are incorrect, please check properties.

Reson

This bug is caused by this PR: #23635

Because the Broker constructor will change the incoming parameters——properties before #23635 :

public BrokerDesc(String name, Map<String, String> properties) {
        this.name = name;
        this.properties = properties;
        if (this.properties == null) {
            this.properties = Maps.newHashMap();
        }
        if (isMultiLoadBroker()) {
            this.storageType = StorageBackend.StorageType.LOCAL;
        } else {
            this.storageType = StorageBackend.StorageType.BROKER;
        }
        this.properties.putAll(S3ClientBEProperties.getBeFSProperties(this.properties));
        this.convertedToS3 = BosProperties.tryConvertBosToS3(this.properties, this.storageType);
        if (this.convertedToS3) {
            this.storageType = StorageBackend.StorageType.S3;
        }
    }

The parameter properties will be changed at this.properties.putAll(S3ClientBEProperties.getBeFSProperties(this.properties)); because this.properties and properties are point to the same reference.
But properties will not be changed in PR #23635

Howerver, the memberlocationProperties of S3TableValuedFunction rely on this change. So we get this bug

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@BePPPower
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 50.04 seconds
stream load tsv: 595 seconds loaded 74807831229 Bytes, about 119 MB/s
stream load json: 20 seconds loaded 2358488459 Bytes, about 112 MB/s
stream load orc: 64 seconds loaded 1101869774 Bytes, about 16 MB/s
stream load parquet: 31 seconds loaded 861443392 Bytes, about 26 MB/s
insert into select: 29.2 seconds inserted 10000000 Rows, about 342K ops/s
storage size: 17162262358 Bytes

@BePPPower
Copy link
Contributor Author

run p1

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add regression test

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

the test case is covered by test_s3_tvf_compression

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Sep 14, 2023
@github-actions
Copy link
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

Copy link
Collaborator

@wm1581066 wm1581066 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@morningman morningman merged commit 4eccf72 into apache:master Sep 14, 2023
xiaokang pushed a commit to xiaokang/doris that referenced this pull request Sep 27, 2023
xiaokang pushed a commit that referenced this pull request Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/2.0.3-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants