Skip to content

feat(QTDI-1060): db mappings #1017

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

Merged
merged 30 commits into from
Jun 30, 2025
Merged

feat(QTDI-1060): db mappings #1017

merged 30 commits into from
Jun 30, 2025

Conversation

undx
Copy link
Member

@undx undx commented Apr 7, 2025

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@undx undx requested a review from ozhelezniak-talend April 10, 2025 14:36

This comment has been minimized.

undx added 2 commits April 11, 2025 13:51
# Conflicts:
#	component-tools/src/main/java/org/talend/sdk/component/tools/validator/ActionValidator.java
#	sample-parent/sample-features/pom.xml

This comment has been minimized.

Copy link
Contributor

@ozhelezniak-talend ozhelezniak-talend left a comment

Choose a reason for hiding this comment

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

I'm worried that we put such specific action inside the core of Component.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

1 similar comment

This comment has been minimized.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for dynamic database schema mappings throughout the component tooling, runtime, and server layers.

  • Introduces the @DatabaseSchemaMapping service annotation with validation logic in ActionValidator and corresponding unit tests.
  • Extends the TaCoKit schema guesser to capture an ORIGIN_TYPE property and updates tests to assert sourceType in output columns.
  • Propagates database mapping metadata to the component index via ComponentSchemaEnricher and adds server‐side tests for mapping metadata exposure.

Reviewed Changes

Copilot reviewed 38 out of 38 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
component-tools/.../ActionValidator.java Added findDatabaseMappingsErrors to validate annotated methods
component-tools/.../ActionValidatorTest.java New unit tests for valid/invalid database mapping actions
component-runtime-di/.../TaCoKitGuessSchema.java Emit sourceType from ORIGIN_TYPE schema property
component-runtime-di/.../TaCoKitGuessSchemaTest.java Updated test to expect sourceType in JSON output
component-runtime-manager/.../ComponentSchemaEnricher.java Enrich component metadata with database mapping keys
component-runtime-manager/.../ComponentSchemaEnricherTest.java Tests for mapping metadata on components
component-server/.../ComponentResourceImplTest.java Test for retrieving mapping metadata via REST API
component-api/.../DatabaseSchemaMapping.java New service annotation definition
component-api/.../DatabaseMapping.java Added to component API for static mapping declarations
Comments suppressed due to low confidence (2)

component-tools/src/main/java/org/talend/sdk/component/tools/validator/ActionValidator.java:259

  • [nitpick] Variable name optionParameter is ambiguous. Consider renaming to optionParameterErrors to clarify this stream holds validation error messages.
final Stream<String> optionParameter = finder

component-tools/src/test/java/org/talend/sdk/component/tools/validator/ActionValidatorTest.java:101

  • This test uses Arrays.asList and Collectors.toList() but the imports for java.util.Arrays, java.util.List, and java.util.stream.Collectors may be missing. Add them to ensure the test compiles.
final List<String> errors = validator.validate(finder, Arrays.asList(ActionDatabaseMappingKO.class))

@ozhelezniak-talend
Copy link
Contributor

The implementation is still too specific to the studio. It uses Studio's implementation of file mapping as a core element.
During the meetings that I've heard it was introduced differently.
Clearly some miscommunication.
Maybe QLIK cloud can use this RAW DB type thing as well, so we might need to have some kind of mapping there too. It's just a thought.
@ypiel-talend what do you think (as proxy-po)

Copy link

sonar-eks bot commented Jun 11, 2025

Passed

Analysis Details

1 Issue

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 1 Code Smell

Coverage and Duplications

  • Coverage 97.90% Coverage (56.50% Estimated after merge)
  • Duplications 1.49% Duplicated Code (1.40% Estimated after merge)

Project ID: org.talend.sdk.component:component-runtime

View in SonarQube

Copy link
Contributor

@ozhelezniak-talend ozhelezniak-talend left a comment

Choose a reason for hiding this comment

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

Contacted Yves.
Looks like the implementation approach was agreed.
It's studio specific.
Maybe if we find smth better in future, we would be able to deprecate this one and replace it with a new one.
Conceptually this project becomes less and less public and universal =)

@undx undx merged commit d750cd8 into master Jun 30, 2025
7 of 8 checks passed
@undx undx deleted the undx/QTDI-1060-dbtype branch June 30, 2025 08:36
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.

2 participants