Uh oh!
There was an error while loading. Please reload this page.
[improvement](jdbc catalog) Delete unnecessary schema and optimize insert logic - #30880
Conversation
doris-robot
commented
Feb 5, 2024
Thank you for your contribution to Apache Doris. |
zy-kkk
commented
Feb 6, 2024
run buildall |
doris-robot
commented
Feb 6, 2024
TPC-H: Total hot run time: 37214 ms |
doris-robot
commented
Feb 6, 2024
TPC-DS: Total hot run time: 181136 ms |
doris-robot
commented
Feb 6, 2024
ClickBench: Total hot run time: 30.51 s |
doris-robot
commented
Feb 6, 2024
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G' |
zy-kkk
commented
Feb 17, 2024
run buildall |
doris-robot
commented
Feb 17, 2024
TPC-H: Total hot run time: 41258 ms |
doris-robot
commented
Feb 17, 2024
TPC-DS: Total hot run time: 188679 ms |
doris-robot
commented
Feb 17, 2024
ClickBench: Total hot run time: 31.28 s |
doris-robot
commented
Feb 17, 2024
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G' |
| // Check if all columns mentioned is enough | ||
| checkColumnCoverage(mentionedColumns, targetTable.getBaseSchema()); | ||
| if (!(targetTable instanceof JdbcTable)) { |
There was a problem hiding this comment.
Add comment to explain why not check JdbcTable
| for (int colIdx = 0; colIdx < targetColumns.size(); ++colIdx) { | ||
| Column column = targetColumns.get(colIdx); | ||
| Expr expr = rows.get(0).get(colIdx); | ||
| if (!column.isAllowNull() && expr.isNullable()) { |
There was a problem hiding this comment.
This should not be checked in analysis phase, because even if expr is nullable, it can be a non-null value.
There was a problem hiding this comment.
For insert into tbl select constants, checking for null during the analysis phase is appropriate, but changing expr.isNullable() to expr instanceof NullLiteral makes it more reasonable
zy-kkk
commented
Feb 18, 2024
run buildall |
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
…sert logic (apache#30880) In the previous design, we were compatible with MySQL's auto-increment column and default value to bypass the null value check when writing back Jdbc External Table. However, because MySQL's default value is not completely unified with Doris, this resulted in The unsuitable default value is wrong. In response to this situation, I made the following optimizations 1. For JDBC External Table, we always allow certain columns to be missing during insertion. Even if these columns are not allowed to be empty at the source end, the error should be generated by the source end, not Doris herself. 2. When the target column is non-nullable and the insertion is done via `INSERT INTO tbl VALUES()` or `INSERT INTO tbl SELECT constants`, Doris should verify any inconsistency between them and throw an exception. This check is not applied for `INSERT INTO tbl SELECT ... FROM tbl` operations.
…sert logic (#30880) In the previous design, we were compatible with MySQL's auto-increment column and default value to bypass the null value check when writing back Jdbc External Table. However, because MySQL's default value is not completely unified with Doris, this resulted in The unsuitable default value is wrong. In response to this situation, I made the following optimizations 1. For JDBC External Table, we always allow certain columns to be missing during insertion. Even if these columns are not allowed to be empty at the source end, the error should be generated by the source end, not Doris herself. 2. When the target column is non-nullable and the insertion is done via `INSERT INTO tbl VALUES()` or `INSERT INTO tbl SELECT constants`, Doris should verify any inconsistency between them and throw an exception. This check is not applied for `INSERT INTO tbl SELECT ... FROM tbl` operations.
…sert logic (apache#30880) In the previous design, we were compatible with MySQL's auto-increment column and default value to bypass the null value check when writing back Jdbc External Table. However, because MySQL's default value is not completely unified with Doris, this resulted in The unsuitable default value is wrong. In response to this situation, I made the following optimizations 1. For JDBC External Table, we always allow certain columns to be missing during insertion. Even if these columns are not allowed to be empty at the source end, the error should be generated by the source end, not Doris herself. 2. When the target column is non-nullable and the insertion is done via `INSERT INTO tbl VALUES()` or `INSERT INTO tbl SELECT constants`, Doris should verify any inconsistency between them and throw an exception. This check is not applied for `INSERT INTO tbl SELECT ... FROM tbl` operations.
…sert logic (#37244) pick (#30880) In the previous design, we were compatible with MySQL's auto-increment column and default value to bypass the null value check when writing back Jdbc External Table. However, because MySQL's default value is not completely unified with Doris, this resulted in The unsuitable default value is wrong. In response to this situation, I made the following optimizations 1. For JDBC External Table, we always allow certain columns to be missing during insertion. Even if these columns are not allowed to be empty at the source end, the error should be generated by the source end, not Doris herself. 2. When the target column is non-nullable and the insertion is done via `INSERT INTO tbl VALUES()` or `INSERT INTO tbl SELECT constants`, Doris should verify any inconsistency between them and throw an exception. This check is not applied for `INSERT INTO tbl SELECT ... FROM tbl` operations.
…sert logic (apache#37244) pick (apache#30880) In the previous design, we were compatible with MySQL's auto-increment column and default value to bypass the null value check when writing back Jdbc External Table. However, because MySQL's default value is not completely unified with Doris, this resulted in The unsuitable default value is wrong. In response to this situation, I made the following optimizations 1. For JDBC External Table, we always allow certain columns to be missing during insertion. Even if these columns are not allowed to be empty at the source end, the error should be generated by the source end, not Doris herself. 2. When the target column is non-nullable and the insertion is done via `INSERT INTO tbl VALUES()` or `INSERT INTO tbl SELECT constants`, Doris should verify any inconsistency between them and throw an exception. This check is not applied for `INSERT INTO tbl SELECT ... FROM tbl` operations.
…sert logic (apache#30880) In the previous design, we were compatible with MySQL's auto-increment column and default value to bypass the null value check when writing back Jdbc External Table. However, because MySQL's default value is not completely unified with Doris, this resulted in The unsuitable default value is wrong. In response to this situation, I made the following optimizations 1. For JDBC External Table, we always allow certain columns to be missing during insertion. Even if these columns are not allowed to be empty at the source end, the error should be generated by the source end, not Doris herself. 2. When the target column is non-nullable and the insertion is done via `INSERT INTO tbl VALUES()` or `INSERT INTO tbl SELECT constants`, Doris should verify any inconsistency between them and throw an exception. This check is not applied for `INSERT INTO tbl SELECT ... FROM tbl` operations.
Proposed changes
Issue Number: close #xxx
In the previous design, we were compatible with MySQL's auto-increment column and default value to bypass the null value check when writing back Jdbc External Table. However, because MySQL's default value is not completely unified with Doris, this resulted in The unsuitable default value is wrong. In response to this situation, I made the following optimizations
INSERT INTO tbl VALUES()orINSERT INTO tbl SELECT constants, Doris should verify any inconsistency between them and throw an exception. This check is not applied forINSERT INTO tbl SELECT ... FROM tbloperations.Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...