-
Notifications
You must be signed in to change notification settings - Fork 94
fix: DH-22265: increment Kafka column index for complex spec #7887
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
Changes from 1 commit
a74a338
f3d4389
cf130f0
545e1b9
5dc6e69
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -336,6 +336,20 @@ protected abstract KeyOrValueIngestData getIngestData( | |
| protected abstract KeyOrValueProcessor getProcessor( | ||
| TableDefinition tableDef, | ||
| KeyOrValueIngestData data); | ||
|
|
||
| private KeyOrValueIngestData ingestDataAndIncrement( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe: |
||
| KeyOrValue keyOrValue, | ||
| SchemaRegistryClient schemaRegistryClient, | ||
| Map<String, ?> configs, | ||
| MutableInt nextColumnIndexMut, | ||
| List<ColumnDefinition<?>> columnDefinitionsOut) { | ||
|
devinrsmith marked this conversation as resolved.
Outdated
|
||
| final KeyOrValueIngestData ingestData = getIngestData(keyOrValue, schemaRegistryClient, configs, | ||
| nextColumnIndexMut, columnDefinitionsOut); | ||
| if (ingestData != null && !ingestData.isSimple()) { | ||
| nextColumnIndexMut.getAndAdd(ingestData.fieldPathToColumnName.size()); | ||
|
devinrsmith marked this conversation as resolved.
Outdated
|
||
| } | ||
| return ingestData; | ||
| } | ||
| } | ||
|
|
||
| private static final KeyOrValueSpec FROM_PROPERTIES = new SimpleConsume(null, null); | ||
|
|
@@ -1273,9 +1287,9 @@ private static ConsumeStruct getConsumeStruct( | |
| cc.setColumnIndex.setColumnIndex(publisherParametersBuilder, nextColumnIndex.getAndIncrement()); | ||
| }); | ||
|
|
||
| final KeyOrValueIngestData keyIngestData = keySpec.getIngestData(KeyOrValue.KEY, | ||
| final KeyOrValueIngestData keyIngestData = keySpec.ingestDataAndIncrement(KeyOrValue.KEY, | ||
| schemaRegistryClient, configs, nextColumnIndex, columnDefinitions); | ||
| final KeyOrValueIngestData valueIngestData = valueSpec.getIngestData(KeyOrValue.VALUE, | ||
| final KeyOrValueIngestData valueIngestData = valueSpec.ingestDataAndIncrement(KeyOrValue.VALUE, | ||
| schemaRegistryClient, configs, nextColumnIndex, columnDefinitions); | ||
|
||
|
|
||
| final TableDefinition tableDefinition = TableDefinition.of(columnDefinitions); | ||
|
|
@@ -1670,6 +1684,10 @@ public static class KeyOrValueIngestData { | |
| public int simpleColumnIndex = NULL_COLUMN_INDEX; | ||
| public Function<Object, Object> toObjectChunkMapper = Function.identity(); | ||
| public Object extra; | ||
|
|
||
| private boolean isSimple() { | ||
| return simpleColumnIndex != NULL_COLUMN_INDEX; | ||
| } | ||
| } | ||
|
|
||
| private interface SetColumnIndex { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.