Skip to content

Conversation

@qg-lin
Copy link
Contributor

@qg-lin qg-lin commented Sep 15, 2024

Proposed changes

  1. Allow modifying a column type that has a default value even if upstream does not carry a default value.
  2. Fallback to the original default value if upstream wants to change the default value to others.

Issue Number: close #xxx

Problem Summary:

Currently, it's not allowed to change a column type that has a default value when upstream does not carry a default value.

Checklist(Required)

  1. Does it affect the original behavior: (Yes/No/I Don't know)
  2. Has unit tests been added: (Yes/No/No Need)
  3. Has document been added or modified: (Yes/No/No Need)
  4. Does it need to update dependencies: (Yes/No)
  5. Are there any changes that cannot be rolled back: (Yes/No)

Further comments

If this is a relatively large or complex change, kick off the discussion at [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc...

private static final String CREATE_DATABASE_DDL = "CREATE DATABASE IF NOT EXISTS %s";
private static final String MODIFY_TYPE_DDL = "ALTER TABLE %s MODIFY COLUMN %s %s";
private static final String MODIFY_COMMENT_DDL = "ALTER TABLE %s MODIFY COLUMN %s COMMENT '%s'";
private static final String SHOW_FULL_COLUMN_DDL = "SHOW FULL COLUMNS FROM `%s`.`%s`";
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this approach not universal?
This sql seems to be the unique syntax of MySQL. If the upstream is Oracle or PostgreSQL, it will not be supported.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It only executes within Doris.

Copy link
Member

@JNSimba JNSimba left a comment

Choose a reason for hiding this comment

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

LGTM

@JNSimba JNSimba merged commit c4ae051 into apache:master Sep 20, 2024
PeatBoy pushed a commit to hyperpaas/doris-flink-connector that referenced this pull request Jan 21, 2025
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.

3 participants