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

feat(frontend): test create source in yaml #1824

Merged
merged 5 commits into from
Apr 14, 2022
Merged

Conversation

cykbls01
Copy link
Contributor

@cykbls01 cykbls01 commented Apr 13, 2022

What's changed and what's your intention?

PLEASE DO NOT LEAVE THIS EMPTY !!!

Since now we must create protobuf source by using file location in below format.

CREATE SOURCE source_name
    WITH ('kafka.topic' = 'abc', 'kafka.servers' = 'localhost:1001')
    ROW FORMAT protobuf MESSAGE '.test.TestRecord' ROW SCHEMA LOCATION 'file:// file_location"'

This pr supports create protobuf source by using content or location in yaml.

Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests

Refer to a related PR or issue link (optional)

@codecov
Copy link

codecov bot commented Apr 13, 2022

Codecov Report

Merging #1824 (d77d1ad) into main (a28949e) will increase coverage by 0.00%.
The diff coverage is 81.42%.

@@           Coverage Diff           @@
##             main    #1824   +/-   ##
=======================================
  Coverage   70.78%   70.79%           
=======================================
  Files         608      608           
  Lines       79569    79613   +44     
=======================================
+ Hits        56325    56364   +39     
- Misses      23244    23249    +5     
Flag Coverage Δ
rust 70.79% <81.42%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/frontend/src/handler/mod.rs 51.28% <ø> (ø)
src/frontend/test_runner/src/lib.rs 71.96% <81.15%> (+2.42%) ⬆️
src/frontend/src/handler/create_source.rs 96.87% <100.00%> (ø)
.../src/executor/managed_state/aggregation/extreme.rs 90.16% <0.00%> (+0.26%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

pub struct CreateSource {
row_format: String,
name: String,
file_location: Option<String>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Add it back when it's used. Still hard to use file location in test.

Suggested change
file_location: Option<String>,

.await
} else {
panic!(
"{:?} create source need to conclude content or location",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"{:?} create source need to conclude content or location",
"{:?} create source must include `file` for the file content",

let placeholder_empty_vec = vec![];

// Since temp file will be deleted when it goes out of scope, so create source advance.
self.create_source_advance(session.clone()).await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
self.create_source_advance(session.clone()).await?;
self.create_source(session.clone()).await?;

Btw, "in advance" , not "advance"

@neverchanje neverchanje marked this pull request as ready for review April 14, 2022 00:47
@@ -73,6 +75,18 @@ pub struct TestCase {

/// Error of optimizer
pub optimizer_error: Option<String>,

/// Support using file content or file location to create source.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// Support using file content or file location to create source.
/// Support using file content to create source.

}

// If testcase have create source info, run sql to create source.
// Support create source by file content or file location.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Support create source by file content or file location.
// Support create source by file content.

@cykbls01 cykbls01 merged commit 333118d into main Apr 14, 2022
@cykbls01 cykbls01 deleted the feat/test_create_source branch April 14, 2022 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants