Skip to content

Commit 9bbdb45

Browse files
gaoliangzoudaokoulife
authored andcommitted
[hotfix-#1853] [connector jdbc] jdbc toInternal methods should process data by field name rather than index #1853
1 parent 41989a8 commit 9bbdb45

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

chunjun-connectors/chunjun-connector-jdbc-base/src/main/java/com/dtstack/chunjun/connector/jdbc/source/JdbcDynamicTableSource.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,10 @@ public LookupRuntimeProvider getLookupRuntimeProvider(LookupContext context) {
122122
public ScanRuntimeProvider getScanRuntimeProvider(ScanContext runtimeProviderContext) {
123123
final RowType rowType = (RowType) physicalRowDataType.getLogicalType();
124124
TypeInformation<RowData> typeInformation = InternalTypeInfo.of(rowType);
125-
125+
ResolvedSchema projectionSchema =
126+
ResolvedSchema.physical(rowType.getFieldNames(), physicalRowDataType.getChildren());
126127
JdbcInputFormatBuilder builder = this.builder;
127-
List<Column> columns = resolvedSchema.getColumns();
128+
List<Column> columns = projectionSchema.getColumns();
128129
List<FieldConfig> columnList = new ArrayList<>(columns.size());
129130
for (Column column : columns) {
130131
FieldConfig field = new FieldConfig();

0 commit comments

Comments
 (0)