-
Notifications
You must be signed in to change notification settings - Fork 591
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(batch): support mysql_query
for mysql batch ingestion
#19071
Conversation
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
14320510 | Triggered | Generic Password | c139f84 | e2e_test/source_inline/tvf/mysql_query.slt | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @StrikeW to see whether there some duplications
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I unified both in risingwave_common
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
TableFunctionToFileScanRule::create(), | ||
// Apply postgres query rule next | ||
TableFunctionToPostgresQueryRule::create(), | ||
// Apply mysql query rule next | ||
TableFunctionToMySqlQueryRule::create(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to merge all these into one rule?
Inside the rule just match logical_table_function.table_function.function_type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait for CONNECTION
first: #19222.
We can refactor pg and mysql then.
@@ -174,8 +174,8 @@ SELECT | |||
c_binary_255 | |||
FROM rw_mysql_types_test order by c_boolean; | |||
---- | |||
0 NULL NULL NULL -8388608 -2147483647 9223372036854775806 -10 -10000 -10000 c d \x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 | |||
1 NULL -128 -32767 -8388608 -2147483647 -9223372036854775807 -10 -10000 -10000 a b \x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 | |||
0 f NULL NULL -8388608 -2147483647 9223372036854775806 -10 -10000 -10000 c d \x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this changed? Could you please note the "changes" of the "Type mapping table" in the release note?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the release notes, previously only mentioned them in the PR description. It's because we support bit
conversion now.
7761e9a
to
e84ce45
Compare
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
We support
mysql_query
in this PR. We extract common deserialization logic between mysql cdc parser and mysql_query (introduced in this PR). We also handle serde forbit
.bit(1)
will just be treat asboolean
.bit(>1)
will be treated asbytea
.I also added a
local-inline-source-test
profile, which complementsci-inline-source-test
, so we can easily run source tests locally.You may consult the table in the release notes for the column type mapping for
MySQL -> RisingWave
after this PR.Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
This feature should be a TECHNICAL PREVIEW. See below.
This PR introduces the
mysql_query
tvf. Its syntax will very likely change down the road. So the interface and examples you see below will be obsolete in subsequent versions. That being said the core functionality will still exist.Type mapping table. The only changes are for
bit(1)
andbit(>1)
. Previously both of these map toNULL
. Now these are supported.Bool and boolean are mapped to
smallint
as well, because they are actually an alias oftinyint(1)
. If we choose to map them toboolean
, it means if someone declared atinyint(1)
intentionally, it will be converted toboolean
as well.Instead we just opt for a more consistent approach: all
tinyint
, including(bool/boolean)
will map tosmallint
, users may convertbit(1)
into RW boolean if they wish to instead.After this PR we support
mysql_query
.Syntax:
Example
Mysql:
rw:
Breaking changes
If user had a column with datatype
bit
in their source previously, this can cause inconsistency. Because previously it would be deserialized asNULL
. After this PR, it correctly converts it to eitherbytea
orboolean
.