This is an automated email from the ASF dual-hosted git repository.
abhishek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new 631dc3b589 add Kafka topic column controls (#14865)
631dc3b589 is described below
commit 631dc3b589e01288680d28ece2f709917f32d710
Author: Vadim Ogievetsky <[email protected]>
AuthorDate: Mon Aug 21 09:03:23 2023 -0700
add Kafka topic column controls (#14865)
---
web-console/src/druid-models/input-format/input-format.tsx | 11 ++++++++++-
web-console/src/views/load-data-view/load-data-view.tsx | 1 +
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/web-console/src/druid-models/input-format/input-format.tsx
b/web-console/src/druid-models/input-format/input-format.tsx
index 38bfba5087..6da11aca2b 100644
--- a/web-console/src/druid-models/input-format/input-format.tsx
+++ b/web-console/src/druid-models/input-format/input-format.tsx
@@ -42,6 +42,7 @@ export interface InputFormat {
// type: kafka
readonly timestampColumnName?: string;
+ readonly topicColumnName?: string;
readonly headerFormat?: { type: 'string'; encoding?: string };
readonly headerColumnPrefix?: string;
readonly keyFormat?: InputFormat;
@@ -253,7 +254,15 @@ export const KAFKA_METADATA_INPUT_FORMAT_FIELDS:
Field<InputFormat>[] = [
type: 'string',
defaultValue: 'kafka.timestamp',
defined: typeIsKnown(KNOWN_TYPES, 'kafka'),
- info: `Name of the column for the kafka record's timestamp.`,
+ info: `Name of the column for the Kafka record's timestamp.`,
+ },
+ {
+ name: 'topicColumnName',
+ label: 'Kafka topic column name',
+ type: 'string',
+ defaultValue: 'kafka.topic',
+ defined: typeIsKnown(KNOWN_TYPES, 'kafka'),
+ info: `Name of the column for the topic from which the Kafka record came.`,
},
// -----------------------------------------------------
diff --git a/web-console/src/views/load-data-view/load-data-view.tsx
b/web-console/src/views/load-data-view/load-data-view.tsx
index d38355601d..71fb889163 100644
--- a/web-console/src/views/load-data-view/load-data-view.tsx
+++ b/web-console/src/views/load-data-view/load-data-view.tsx
@@ -226,6 +226,7 @@ function showKafkaLine(line: SampleEntry): string {
if (!input) return 'Invalid kafka row';
return compact([
`[ Kafka timestamp: ${input['kafka.timestamp']}`,
+ ` Topic: ${input['kafka.topic']}`,
...filterMap(Object.entries(input), ([k, v]) => {
if (!k.startsWith('kafka.header.')) return;
return ` Header: ${k.slice(13)}=${v}`;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]