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

[hotfix-#1853] [connector jdbc] jdbc toInternal methods should process data by field name rather than index #1853 #1854

Closed
wants to merge 1 commit into from

Conversation

david-gao1
Copy link
Contributor

Purpose of this pull request

Which issue you fix

Fixes # (issue).

Checklist:

  • I have executed the 'mvn spotless:apply' command to format my code.
  • I have a meaningful commit message (including the issue id, the template of commit message is '[label-type-#issue-id][fixed-module] a meaningful commit message.')
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have checked my code and corrected any misspellings.
  • My commit is only one. (If there are multiple commits, you can use 'git squash' to compress multiple commits into one.)

@zoudaokoulife
Copy link
Contributor

代码上看是合理的,不过涉及到核心功能的改动。我们本地先验证下数据同步 相关逻辑是否有影响之后再合并

@david-gao1
Copy link
Contributor Author

david-gao1 commented Dec 14, 2023 via email

@zoudaokoulife
Copy link
Contributor

@david-gao1
从上下文结构上看,问题的根本原因是在 构建SupportsProjectionPushDown 的情况下,使用了剪枝导致的。
上面提供的方式是能解决问题。但是从结构上看通过在查询的时候 使用剪枝后的column 会更合适,减少了查询的column 。
建议在com.dtstack.chunjun.connector.jdbc.source.JdbcDynamicTableSource#getScanRuntimeProvider 调整 columns 的构造逻辑。
final RowType rowType = (RowType) physicalRowDataType.getLogicalType(); TypeInformation<RowData> typeInformation = InternalTypeInfo.of(rowType); ResolvedSchema projectionSchema = ResolvedSchema.physical(rowType.getFieldNames(), physicalRowDataType.getChildren()) List<Column> columns = projectionSchema.getColumns()
你这边是否能更新一个版本呢?

@david-gao1
Copy link
Contributor Author

david-gao1 commented Dec 18, 2023 via email

@david-gao1 david-gao1 closed this Dec 18, 2023
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