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

fix(Sink): add name field and change date representation to Epoch in debezium json #13496

Merged
merged 3 commits into from
Nov 22, 2023

Conversation

xuefengze
Copy link
Contributor

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

What's changed and what's your intention?

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.

@xuefengze xuefengze requested a review from xiangjinwu November 17, 2023 10:11
TimestampHandlingMode::String,
TimestamptzHandlingMode::UtcString,
&CustomJsonType::None,
)
.unwrap();
assert_eq!(ts_value, json!("1970-01-01 00:16:40.000000".to_string()));

// Represents the number of microseconds past midnigh, io.debezium.time.Time
// Represents the number of milliseconds past midnigh, org.apache.kafka.connect.data.Time
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch!

{"id":7,"v_bigint":15914,"v_bytea":"ur7A3g==","v_double":10967.182297153104,"v_float":3946.743408203125,"v_integer":12652,"v_smallint":10324,"v_timestamp":1681447263083,"v_varchar":"YIVLnWxHyf"}
{"id":8,"v_bigint":28641,"v_bytea":"3q26vg==","v_double":993.408963466774,"v_float":13652.0732421875,"v_integer":19036,"v_smallint":194,"v_timestamp":1681393929356,"v_varchar":"lv7Eq3g8hx"}
{"id":9,"v_bigint":24837,"v_bytea":"3q26vg==","v_double":11615.276406159757,"v_float":20699.55859375,"v_integer":20090,"v_smallint":10028,"v_timestamp":1681389642487,"v_varchar":"nwRq4zejSQ"}
{"id":1,"v_bigint":1872,"v_bytea":"AA==","v_date":1,"v_double":23956.39329760601,"v_float":26261.416015625,"v_integer":1872,"v_interval":"P0Y0M0DT0H0M0S","v_jsonb":"{}","v_smallint":31031,"v_time":1000,"v_timestamp":1681453634104,"v_timestamptz":"0001-01-01 00:00:00.123456","v_varchar":"8DfUFencLe"}
Copy link
Contributor

Choose a reason for hiding this comment

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

Note to myself: this would become "v_timestamptz":"0001-01-01 00:00:00.123456Z" after migrating to new syntax #13066

(8, 'lv7Eq3g8hx', 194, 19036, 28641, 13652.073, 993.408963466774, '2023-04-13 13:52:09.356742', '\xDEADBABE'),
(9, 'nwRq4zejSQ', 10028, 20090, 24837, 20699.559, 11615.276406159757, '2023-04-13 12:40:42.487742', '\xDEADBABE'),
(10, '0oVqRIHqkb', 26951, 20674, 20674, 19387.238, 9042.404483827515, '2023-04-13 16:40:58.888742', '\x00');
(1, '8DfUFencLe', 31031, 1872, 1872, 26261.416, 23956.39329760601, '2023-04-14 06:27:14.104742', '\x00', '0 second', '0001-01-01', '00:00:01.123456', '0001-01-01 00:00:00.123456'::timestamptz, '{}'),
Copy link
Contributor

Choose a reason for hiding this comment

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

'0001-01-01 00:00:00.123456'::timestamptz is discouraged usage. It is better to include a timezone:

  • '0001-01-01 00:00:00.123456Z'
  • '0001-01-01 00:00:00.123456+00:00'
  • '0001-01-01 00:00:00.123456+08:00'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

create table test (
  tz timestamptz
);

insert into test values ('0001-01-01 00:00:00Z');

will cause Parse error: Can't cast string to timestamp (expected format is YYYY-MM-DD HH:MM:SS[.D+{up to 6 digits}] or YYYY-MM-DD HH:MM or YYYY-MM-DD or ISO 8601 format).
'1969-01-01 00:00:00Z' is ok.

@xuefengze xuefengze added this pull request to the merge queue Nov 22, 2023
Merged via the queue into risingwavelabs:main with commit ec9d8ea Nov 22, 2023
27 of 28 checks passed
@xuefengze xuefengze deleted the add_name_field branch November 22, 2023 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sink: Mismatch of date Representation in debezium json kafka-cdc-sink: Missing name field in debezium json
2 participants