You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by oe...@apache.org on 2026/10/13 15:34:08 UTC

(streampipes) branch 5090-add-naming-option-for-persist-dataset-in-adapters updated: Add dataset naming option

This is an automated email from the ASF dual-hosted git repository.

SvenO3 pushed a commit to branch 5090-add-naming-option-for-persist-dataset-in-adapters
in repository https://gitbox.apache.org/repos/asf/streampipes.git


The following commit(s) were added to refs/heads/5090-add-naming-option-for-persist-dataset-in-adapters by this push:
     new 96eb255fd5 Add dataset naming option
96eb255fd5 is described below

commit 96eb255fd51c29ae32ca64fb1f756cba5fbb3501
Author: Sven Oehler <oe...@web.de>
AuthorDate: Tue Oct 13 17:33:51 2026 +0200

    Add dataset naming option
---
 ui/deployment/i18n/de.json                         |  3 ++-
 ui/deployment/i18n/en.json                         |  3 ++-
 ui/deployment/i18n/pl.json                         |  3 ++-
 .../start-adapter-configuration.component.html     | 22 ++++++++++++++++++++++
 .../start-adapter-configuration.component.ts       |  2 ++
 .../adapter-started-dialog.component.ts            | 14 +++++++++++---
 6 files changed, 41 insertions(+), 6 deletions(-)

diff --git a/ui/deployment/i18n/de.json b/ui/deployment/i18n/de.json
index d6e7371b5a..2969711ada 100644
--- a/ui/deployment/i18n/de.json
+++ b/ui/deployment/i18n/de.json
@@ -651,6 +651,7 @@
   "Last updated": "Zuletzt aktualisiert",
   "Latitude": "Breitengrad",
   "Layer type": "Kartentyp",
+  "Leave blank to use the adapter name.": "Leer lassen, um den Adapternamen zu verwenden.",
   "Leave entry empty": "Leer lassen",
   "Left": "Links",
   "Legacy multi-source chart": "Legacy-Diagramm mit mehreren Quellen",
@@ -1207,8 +1208,8 @@
   "The following fields used by this chart no longer exist in the dataset:": "Die folgenden von diesem Diagramm verwendeten Felder existieren nicht mehr im Dataset:",
   "The following files already exist. Please rename them.": "Die folgenden Dateien existieren bereits. Bitte umbenennen.",
   "The input data stream does not satisfy the requirements specified by the data processor.": "Der Eingabedatenstrom erfüllt nicht die vom Datenprozessor festgelegten Anforderungen.",
-  "The original event is used without transformation. Your script is preserved.": "Das Originalereignis wird ohne Transformation verwendet. Ihr Skript bleibt erhalten.",
   "The message as shown in the top right corner of every page. Longer messages are cut off after about 60 characters and shown in full on hover": "Die Meldung, wie sie oben rechts auf jeder Seite angezeigt wird. Längere Meldungen werden nach etwa 60 Zeichen abgeschnitten und beim Überfahren mit der Maus vollständig angezeigt",
+  "The original event is used without transformation. Your script is preserved.": "Das Originalereignis wird ohne Transformation verwendet. Ihr Skript bleibt erhalten.",
   "The timestamp must be a UNIX timestamp in milliseconds. Edit the timestamp field or add an ingestion timestamp.": "Der Zeitstempel muss einem UNIX-Zeitstempel in Millisekunden entsprechen. Zeitstempelfeld markieren oder einen Zeitstempel im Skripteditor hinzufügen.",
   "The value should be a number": "Der Wert sollte eine Zahl sein",
   "There was an error while guessing the schema of your configured data stream": "Beim Erkennen des Schemas der Datenquelle ist ein Fehler aufgetreten",
diff --git a/ui/deployment/i18n/en.json b/ui/deployment/i18n/en.json
index 93b8960cfb..a57488def6 100644
--- a/ui/deployment/i18n/en.json
+++ b/ui/deployment/i18n/en.json
@@ -651,6 +651,7 @@
   "Last updated": null,
   "Latitude": null,
   "Layer type": null,
+  "Leave blank to use the adapter name.": null,
   "Leave entry empty": null,
   "Left": null,
   "Legacy multi-source chart": null,
@@ -1207,8 +1208,8 @@
   "The following fields used by this chart no longer exist in the dataset:": null,
   "The following files already exist. Please rename them.": null,
   "The input data stream does not satisfy the requirements specified by the data processor.": null,
-  "The original event is used without transformation. Your script is preserved.": null,
   "The message as shown in the top right corner of every page. Longer messages are cut off after about 60 characters and shown in full on hover": null,
+  "The original event is used without transformation. Your script is preserved.": null,
   "The timestamp must be a UNIX timestamp in milliseconds. Edit the timestamp field or add an ingestion timestamp.": null,
   "The value should be a number": null,
   "There was an error while guessing the schema of your configured data stream": null,
diff --git a/ui/deployment/i18n/pl.json b/ui/deployment/i18n/pl.json
index 155a9a312a..8f73d2050c 100644
--- a/ui/deployment/i18n/pl.json
+++ b/ui/deployment/i18n/pl.json
@@ -651,6 +651,7 @@
   "Last updated": "Ostatnia aktualizacja",
   "Latitude": "Szerokość geograficzna",
   "Layer type": "Typ warstwy",
+  "Leave blank to use the adapter name.": "Pozostaw puste, aby użyć nazwy adaptera.",
   "Leave entry empty": "Pozostaw puste",
   "Left": "Lewa",
   "Legacy multi-source chart": "Starszy wykres z wieloma źródłami",
@@ -1207,8 +1208,8 @@
   "The following fields used by this chart no longer exist in the dataset:": "Następujące pola używane przez ten wykres nie istnieją już w zbiorze danych:",
   "The following files already exist. Please rename them.": "Następujące pliki już istnieją. Zmień ich nazwy.",
   "The input data stream does not satisfy the requirements specified by the data processor.": "Strumień danych wejściowych nie spełnia wymagań określonych przez procesor danych.",
-  "The original event is used without transformation. Your script is preserved.": "Oryginalne zdarzenie jest używane bez przekształcania. Skrypt zostaje zachowany.",
   "The message as shown in the top right corner of every page. Longer messages are cut off after about 60 characters and shown in full on hover": "Komunikat wyświetlany w prawym górnym rogu każdej strony. Dłuższe komunikaty są skracane po około 60 znakach i wyświetlane w całości po najechaniu kursorem",
+  "The original event is used without transformation. Your script is preserved.": "Oryginalne zdarzenie jest używane bez przekształcania. Skrypt zostaje zachowany.",
   "The timestamp must be a UNIX timestamp in milliseconds. Edit the timestamp field or add an ingestion timestamp.": "Znacznik czasu musi być znacznikiem UNIX w milisekundach. Edytuj pole znacznika czasu lub dodaj znacznik czasu konsumowania zdarzenia.",
   "The value should be a number": "Wartość powinna być liczbą",
   "There was an error while guessing the schema of your configured data stream": "Wystąpił błąd podczas rozpoznawania schematu skonfigurowanego strumień danych",
diff --git a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.html b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.html
index ed81bf2876..bde78e9716 100644
--- a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.html
+++ b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.html
@@ -244,6 +244,28 @@
                     (optionSelectedEmitter)="handlePersistOption($event)"
                 >
                     @if (saveInDataLake) {
+                        <sp-form-field
+                            class="mt-md"
+                            [level]="3"
+                            [label]="'Dataset name' | translate"
+                            [description]="
+                                'Leave blank to use the adapter name.'
+                                    | translate
+                            "
+                        >
+                            <mat-form-field>
+                                <input
+                                    matInput
+                                    [(ngModel)]="dataLakeDatasetName"
+                                    [ngModelOptions]="{ standalone: true }"
+                                    [placeholder]="adapterDescription.name"
+                                    [attr.aria-label]="
+                                        'Dataset name' | translate
+                                    "
+                                    data-cy="sp-store-in-datalake-dataset-name"
+                                />
+                            </mat-form-field>
+                        </sp-form-field>
                         <sp-form-field
                             class="mt-md"
                             [level]="3"
diff --git a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.ts b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.ts
index b7bbffb704..e8196e3950 100644
--- a/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.ts
+++ b/ui/src/app/connect/components/adapter-configuration/start-adapter-configuration/start-adapter-configuration.component.ts
@@ -153,6 +153,7 @@ export class StartAdapterConfigurationComponent implements OnInit {
     private cachedEventRateRule: ReduceEventRateRule | null;
 
     saveInDataLake = false;
+    dataLakeDatasetName = '';
     dataLakeTimestampField: string;
 
     showCode = false;
@@ -237,6 +238,7 @@ export class StartAdapterConfigurationComponent implements OnInit {
             data: {
                 adapter: this.adapterDescription,
                 saveInDataLake: this.saveInDataLake,
+                dataLakeDatasetName: this.dataLakeDatasetName,
                 dataLakeTimestampField: this.dataLakeTimestampField,
                 editMode: false,
                 startAdapterNow,
diff --git a/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.ts b/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.ts
index 7289c42ce6..ae1f4d4329 100644
--- a/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.ts
+++ b/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.ts
@@ -111,6 +111,8 @@ export class AdapterStartedDialog implements OnInit {
      */
     @Input() saveInDataLake: boolean;
 
+    @Input() dataLakeDatasetName = '';
+
     /**
      * Timestamp field of event. Required when storing events in the data lake.
      */
@@ -441,14 +443,15 @@ export class AdapterStartedDialog implements OnInit {
             name: pipelineId,
         });
 
+        const datasetName = this.getDatasetName(adapter);
         const res = await lastValueFrom(
-            this.dataLakeService.getMeasurementByName(adapter.name),
+            this.dataLakeService.getMeasurementByName(datasetName),
         );
 
         linkageData.push({
             type: 'dataset',
             id: res.elementId,
-            name: adapter.name,
+            name: datasetName,
         });
     }
 
@@ -515,6 +518,7 @@ export class AdapterStartedDialog implements OnInit {
                             createOptions: {
                                 persist: false,
                                 start: true,
+                                persistDatasetName: undefined,
                             },
                         };
                         this.compactPipelineService.create(pipeline).subscribe(
@@ -544,7 +548,7 @@ export class AdapterStartedDialog implements OnInit {
     ): CompactPipelineElement[] {
         template[0].configuration.push(
             {
-                db_measurement: this.adapter.name,
+                db_measurement: this.getDatasetName(adapter),
             },
             {
                 timestamp_mapping: 's0::' + this.dataLakeTimestampField,
@@ -566,6 +570,10 @@ export class AdapterStartedDialog implements OnInit {
         return template;
     }
 
+    private getDatasetName(adapter: AdapterDescription): string {
+        return this.dataLakeDatasetName?.trim() || adapter.name;
+    }
+
     private createPipelineId(): string {
         const base = `persist-${this.adapter.name.replaceAll(' ', '-')}`;
         const suffix = Math.random().toString(36).slice(2, 8);