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(structure-comparison): integrate structural comparison into the service layer #1473

Conversation

PeachThinking
Copy link
Collaborator

@PeachThinking PeachThinking commented Jan 29, 2024

What type of PR is this?

type-feature
module-structure-comaprison

What this PR does / why we need it:

  1. structure comparison access to flowable layer: implement DBStructureComparisonFlowableTask to create a structure comparison task.

  2. FlowInstanceController#getDownloadUrl adapted for downloading sql script generated by structure-comparison task.

  3. structure comparison storage layer implementation.

  4. add DefaultDBStructureComparatorTest for ob oracle mode.

  5. Fix several ob oracle generate update table ddl bug:

  • fix generate create partition ddl for HASH and KEY paritition type which do not need DBTablePartitionEditor#appendDefinitions, correct ddl is like:
PARTITION BY { HASH(expr) | KEY([column_name_list]) } 
    PARTITIONS partition_count;
  • Filter out primary key index which will be compared as a constraint in ob oracle mode when generate create table ddl. see DBTableStructureComparator#copySourceTable
  • Filter out not null check constraints which will be compared in column comparison in oracle mode. see DBTableStructureComparator#filterNotNullCheckConstraint
  • Fix Map<String, List<DBTableConstraint>> listTableConstraints(String schemaName) only get one constraint in ob oracle mode .
  1. Optimize ob mysql and ob oracle's method of querying all table objects under a schema. Different optimization logic is placed in the db-browser layer: DBSchemaAccessor#getTables.
  • add a new method to optimize ob mysql list table indexes to avoid repeated query table ddl in OBMySQLSchemaAccessor as a public method.
Map<String, List<DBTableIndex>> listTableIndexes(String schemaName, Map<String, String> tableName2Ddl);
  • add add a new method to optimize ob oracle get table ddl to avoid repeated query index ddl in OracleSchemaAccessor as a public method:
String getTableDDL(String schemaName, String tableName, List<DBTableColumn> tableColumns,
            List<DBTableIndex> tableIndexes);

Which issue(s) this PR fixes:

Fixes #816

Special notes for your reviewer:

Additional documentation e.g., usage docs, etc.:


@PeachThinking PeachThinking added the type-feature The functionality to be implemented label Jan 29, 2024
@PeachThinking PeachThinking added this to the ODC 4.2.4 milestone Jan 29, 2024
@PeachThinking PeachThinking self-assigned this Jan 29, 2024
@PeachThinking PeachThinking force-pushed the feat/jingtian_424_structure_compare_access_to_flowable_layer branch from e799a60 to 3e74835 Compare January 29, 2024 10:47
@PeachThinking PeachThinking changed the title feat(structure-comparison) : access to flowable layer [WIP]feat(structure-comparison) : access to flowable layer Jan 30, 2024
@yhilmare
Copy link
Contributor

pr naming suggestion: integrate structural comparison into the service layer

@PeachThinking PeachThinking force-pushed the feat/jingtian_424_structure_compare_access_to_flowable_layer branch from b18a41e to 2c859f9 Compare January 30, 2024 12:49
@PeachThinking PeachThinking changed the title [WIP]feat(structure-comparison) : access to flowable layer [WIP]feat(structure-comparison) : integrate structural comparison into the service layer Jan 30, 2024
@PeachThinking PeachThinking changed the title [WIP]feat(structure-comparison) : integrate structural comparison into the service layer feat(structure-comparison) : integrate structural comparison into the service layer Jan 30, 2024
@yhilmare yhilmare changed the title feat(structure-comparison) : integrate structural comparison into the service layer feat(structure-comparison): integrate structural comparison into the service layer Jan 31, 2024
@PeachThinking PeachThinking force-pushed the feat/jingtian_424_structure_compare_access_to_flowable_layer branch from 331219e to a8f4128 Compare February 5, 2024 12:11
@PeachThinking PeachThinking force-pushed the feat/jingtian_424_structure_compare_access_to_flowable_layer branch from 24e8c53 to 6ab5a40 Compare February 6, 2024 02:29
@PeachThinking PeachThinking force-pushed the feat/jingtian_424_structure_compare_access_to_flowable_layer branch from 7fb5a29 to d3cebef Compare February 7, 2024 01:55
@PeachThinking PeachThinking force-pushed the feat/jingtian_424_structure_compare_access_to_flowable_layer branch from e03845e to bac18ac Compare February 7, 2024 07:42
Copy link
Contributor

@yhilmare yhilmare left a comment

Choose a reason for hiding this comment

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

lgtm

@yhilmare yhilmare merged commit 2913eb6 into dev/4.2.x Feb 7, 2024
13 checks passed
@yhilmare yhilmare deleted the feat/jingtian_424_structure_compare_access_to_flowable_layer branch February 7, 2024 08:51
@PeachThinking
Copy link
Collaborator Author

fix by #1473

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature The functionality to be implemented
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants