Skip to content

refactor(connector): directly deserialize config from map #14775

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

Closed
wants to merge 2 commits into from

Conversation

BugenZhao
Copy link
Member

@BugenZhao BugenZhao commented Jan 24, 2024

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Avoid first converting a map into a json value, then deserialize it back.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

Copy link
Member Author

BugenZhao commented Jan 24, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @BugenZhao and the rest of your teammates on Graphite Graphite

@github-actions github-actions bot added the type/refactor Type: Refactoring. label Jan 24, 2024
Copy link
Member Author

@BugenZhao BugenZhao left a comment

Choose a reason for hiding this comment

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

Oops. Seems not working as expected. 😕

Base automatically changed from bz/dml-error to main January 25, 2024 04:28
@buildkite buildkite bot requested a review from a team as a code owner January 25, 2024 04:28
@BugenZhao BugenZhao force-pushed the bz/connector-pre-refactor-error branch from 035697d to 713fdb5 Compare January 26, 2024 08:46
@xiangjinwu
Copy link
Contributor

e2e_test/source/basic/ddl.slt                                .. [FAILED]
failed to run `e2e_test/source/basic/ddl.slt`
Caused by:
    statement is expected to fail with error:
    	(multiline) db error: ERROR: Failed to run the query
    
    Caused by these errors (recent errors listed first):
      1: gRPC request to meta service failed: Internal error
      2: failed to create source worker
      3: missing field `properties.bootstrap.server`
    but got error:
    	db error: ERROR: Failed to run the query
    
    Caused by these errors (recent errors listed first):
      1: gRPC request to meta service failed: Internal error
      2: failed to create source worker
      3: Serde("missing field `properties.bootstrap.server`") at character 0
    
    [SQL] create source s(x int) WITH(unknown_field='1', connector='kafka') FORMAT PLAIN ENCODE JSON;
    at e2e_test/source/basic/ddl.slt:23

Seems only an appearance issue.

Comment on lines +29 to +30
// The deserializing itself has nothing to do with `simd_json`. We just use it to
// provide a correct implementation of `deserialize_option` for optional fields.
Copy link
Contributor

@xiangjinwu xiangjinwu Jan 31, 2024

Choose a reason for hiding this comment

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

Do not quite get this part. Is there a unit test to demonstrate what would happen if it was simply (k.as_ref(), v.as_ref())? It is also confusing for caller to get a simd_json::Error.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe return anyhow::Error here and thus save some conversions outside.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@xxchan xxchan left a comment

Choose a reason for hiding this comment

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

test

@BugenZhao BugenZhao marked this pull request as draft March 12, 2024 06:13
Copy link
Contributor

This PR has been open for 60 days with no activity. Could you please update the status? Feel free to ping a reviewer if you are waiting for review.

Copy link
Contributor

github-actions bot commented Jul 3, 2024

Close this PR as there's no further actions taken after it is marked as stale for 7 days. Sorry! 🙏

You can reopen it when you have time to continue working on it.

@github-actions github-actions bot closed this Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants