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: schemaless ingestion for encode json (INCLUDE payload) #18437

Merged
merged 14 commits into from
Sep 12, 2024

Conversation

tabVersion
Copy link
Contributor

@tabVersion tabVersion commented Sep 6, 2024

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

What's changed and what's your intention?

resolve #12207

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

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.

Signed-off-by: tabVersion <tabvision@bupt.icu>
@tabVersion tabVersion changed the title feat: schemaless ingestion for encode jsod feat: schemaless ingestion for encode json Sep 6, 2024
Signed-off-by: tabVersion <tabvision@bupt.icu>
Signed-off-by: tabVersion <tabvision@bupt.icu>
@tabVersion tabVersion marked this pull request as ready for review September 6, 2024 10:07
Signed-off-by: tabVersion <tabvision@bupt.icu>
Signed-off-by: tabVersion <tabvision@bupt.icu>
@graphite-app graphite-app bot requested a review from a team September 6, 2024 10:49
Signed-off-by: tabVersion <tabvision@bupt.icu>
@xxchan xxchan changed the title feat: schemaless ingestion for encode json feat: schemaless ingestion for encode json (INCLUDE payload) Sep 10, 2024
tabVersion and others added 6 commits September 10, 2024 14:38
Co-authored-by: xxchan <xxchan22f@gmail.com>
Signed-off-by: tabVersion <tabvision@bupt.icu>
Signed-off-by: tabVersion <tabvision@bupt.icu>
Signed-off-by: tabVersion <tabvision@bupt.icu>
src/connector/src/parser/unified/json.rs Outdated Show resolved Hide resolved
src/connector/src/parser/unified/kv_event.rs Outdated Show resolved Hide resolved
src/connector/src/parser/mod.rs Outdated Show resolved Hide resolved
Signed-off-by: tabVersion <tabvision@bupt.icu>
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.

LGTM. Cool!

src/connector/src/parser/additional_columns.rs Outdated Show resolved Hide resolved
// remove s3 for no longer use
// (S3_CONNECTOR, HashSet::from(["file", "offset"])),
(
OPENDAL_S3_CONNECTOR,
Copy link
Member

Choose a reason for hiding this comment

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

It seems currently we only have include tests for Kafka. Would you minding also adding a test for s3? Since s3 connector has quite some bugs, I'm a little worried about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd merge this one first and do the test in following pr.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -646,6 +646,7 @@ impl<'a> JsonAccess<'a> {
impl Access for JsonAccess<'_> {
fn access<'a>(&'a self, path: &[&str], type_expected: &DataType) -> AccessResult<DatumCow<'a>> {
let mut value = &self.value;

Copy link
Member

Choose a reason for hiding this comment

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

nit

Suggested change

Comment on lines +82 to +83
// hack here: Get the whole payload as a single column
// use a special mark empty slice as path to represent the whole payload
Copy link
Member

Choose a reason for hiding this comment

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

nit: I think empty path is not "hack" at all, but just reasonable usage?

Suggested change
// hack here: Get the whole payload as a single column
// use a special mark empty slice as path to represent the whole payload
// access empty path to get the whole payload

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it is an undefined behavior in prev impl, we always expect path a non-empty slice.

Co-authored-by: xxchan <xxchan22f@gmail.com>
@tabVersion tabVersion added this pull request to the merge queue Sep 11, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 11, 2024
@tabVersion tabVersion added this pull request to the merge queue Sep 12, 2024
Merged via the queue into main with commit a9b1de3 Sep 12, 2024
32 of 33 checks passed
@tabVersion tabVersion deleted the tab/schemaless-ingest branch September 12, 2024 07:41
Copy link
Member

Choose a reason for hiding this comment

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

@lmatz lmatz added the user-facing-changes Contains changes that are visible to users label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature user-facing-changes Contains changes that are visible to users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ingest unstructured json records or capture unrecognized fields
5 participants