Skip to content

Commit

Permalink
Fix Delete transform (Metadata injection) apache#4015
Browse files Browse the repository at this point in the history
  • Loading branch information
nadment committed Jun 9, 2024
1 parent d5ca041 commit 3eb62a0
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,27 @@
public class DeleteKeyField {

/** which field in input stream to compare with? */
@HopMetadataProperty(key = "name", injectionKeyDescription = "Delete.Injection.KeyStream.Field")
@HopMetadataProperty(
key = "name",
injectionKeyDescription = "DeleteMeta.Injection.KeyStream.Field")
private String keyStream;

/** field in table */
@HopMetadataProperty(key = "field", injectionKeyDescription = "Delete.Injection.KeyLookup.Field")
@HopMetadataProperty(
key = "field",
injectionKeyDescription = "DeleteMeta.Injection.KeyLookup.Field")
private String keyLookup;

/** Comparator: =, <>, BETWEEN, ... */
@HopMetadataProperty(
key = "condition",
injectionKeyDescription = "Delete.Injection.KeyCondition.Field")
injectionKeyDescription = "DeleteMeta.Injection.KeyCondition.Field")
private String keyCondition;

/** Extra field for between... */
@HopMetadataProperty(key = "name2", injectionKeyDescription = "Delete.Injection.KeyStream2.Field")
@HopMetadataProperty(
key = "name2",
injectionKeyDescription = "DeleteMeta.Injection.KeyStream2.Field")
private String keyStream2;

public DeleteKeyField() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,17 @@ public class DeleteLookupField {

@HopMetadataProperty(
key = "key",
injectionGroupDescription = "Delete.Injection.Fields",
injectionKeyDescription = "Delete.Injection.Field")
injectionGroupKey = "KEYS",
injectionGroupDescription = "DeleteMeta.Injection.Fields",
injectionKeyDescription = "DeleteMeta.Injection.Field")
private List<DeleteKeyField> fields;

/** The target schema name */
@HopMetadataProperty(
key = "schema",
injectionKeyDescription = "Delete.Injection.SchemaName.Field")
/** The lookup schema name */
@HopMetadataProperty(key = "schema", injectionKeyDescription = "DeleteMeta.Injection.SchemaName")
private String schemaName;

/** The lookup table name */
@HopMetadataProperty(key = "table", injectionKeyDescription = "Delete.Injection.TableName.Field")
@HopMetadataProperty(key = "table", injectionKeyDescription = "DeleteMeta.Injection.TableName")
private String tableName;

public DeleteLookupField() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
name = "i18n::Delete.Name",
description = "i18n::Delete.Description",
categoryDescription = "i18n:org.apache.hop.pipeline.transform:BaseTransform.Category.Output",
keywords = "i18n::DeleteMeta.keyword",
keywords = "i18n::DeleteMeta.Keyword",
documentationUrl = "/pipeline/transforms/delete.html")
public class DeleteMeta extends BaseTransformMeta<Delete, DeleteData> {
private static final Class<?> PKG = DeleteMeta.class; // For Translator
Expand All @@ -60,13 +60,13 @@ public class DeleteMeta extends BaseTransformMeta<Delete, DeleteData> {
private DeleteLookupField lookup;

/** database connection */
@HopMetadataProperty(key = "connection", injectionKeyDescription = "Delete.Injection.Connection")
@HopMetadataProperty(
key = "connection",
injectionKeyDescription = "DeleteMeta.Injection.Connection")
private String connection;

/** Commit size for inserts/updates */
@HopMetadataProperty(
key = "commit",
injectionKeyDescription = "Delete.Injection.CommitSize.Field")
@HopMetadataProperty(key = "commit", injectionKeyDescription = "DeleteMeta.Injection.CommitSize")
private String commitSize;

public DeleteMeta() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ DeleteMeta.CheckResult.TablenameOK=Tabellenname wurde eingetragen.
DeleteMeta.CheckResult.TransformReceivingInfo=Transform empf\u00E4ngt Informationen von anderen Transforms.
DeleteMeta.CheckResult.VisitTableSuccessfully=Tabelle existiert und es k\u00F6nnen Daten gelesen werden.
DeleteMeta.DefaultTableName.Label=Suchtabelle
DeleteMeta.keyword=delete,l\u00F6schen,tabelle
DeleteMeta.Keyword=delete,l\u00F6schen,tabelle
DeleteMeta.Returnvalue.ErrorOccurred=Ein Fehler ist aufgetreten:
DeleteMeta.Returnvalue.NoConnectionDefined=Keine Verbindung in diesem Transform definiert.
DeleteMeta.Returnvalue.NoReceivingAnyFields=Keine Felder von einem Vorg\u00E4ngertransform erhalten.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,18 @@ DeleteMeta.CheckResult.TablenameOK=Table name is filled in.
DeleteMeta.CheckResult.TransformReceivingInfo=Transform is receiving info from other transforms.
DeleteMeta.CheckResult.VisitTableSuccessfully=Table exists and we can read data from it.
DeleteMeta.DefaultTableName.Label=lookup table
DeleteMeta.keyword=delete
DeleteMeta.Injection.CommitSize=The number of rows to commit at a time
DeleteMeta.Injection.Connection=The name of the database connection
DeleteMeta.Injection.Field=Field
DeleteMeta.Injection.Fields=Fields
DeleteMeta.Injection.KeyCondition.Field=The key condition
DeleteMeta.Injection.KeyLookup.Field=The table field
DeleteMeta.Injection.KeyStream.Field=The stream field 1
DeleteMeta.Injection.KeyStream2.Field=The stream field 2
DeleteMeta.Injection.SchemaName=The name of the schema to use
DeleteMeta.Injection.TableName=The name of the table to use
DeleteMeta.Keyword=delete
DeleteMeta.Returnvalue.ErrorOccurred=An error occurred\:
DeleteMeta.Returnvalue.NoConnectionDefined=There is no connection defined in this transform.
DeleteMeta.Returnvalue.NoReceivingAnyFields=Not receiving any fields from previous transforms. Check the previous transforms for errors & the connecting hops.
DeleteMeta.Returnvalue.NoTableDefinedOnConnection=No table is defined on this connection.
DeleteMeta.Returnvalue.NoTableDefinedOnConnection=No table is defined on this connection.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ DeleteMeta.CheckResult.TablenameOK=Nome da tabela est\u00E1 preenchido.
DeleteMeta.CheckResult.TransformReceivingInfo=A transforma\u00E7\u00E3o est\u00E1 recebendo informa\u00E7\u00F5es de outras transforma\u00E7\u00F5es.
DeleteMeta.CheckResult.VisitTableSuccessfully=Tabela existe e é possível ler dados da mesma.
DeleteMeta.DefaultTableName.Label=tabela de busca
DeleteMeta.keyword=Apagar
DeleteMeta.Keyword=Apagar
DeleteMeta.Returnvalue.ErrorOccurred=Ocorreu um erro:
DeleteMeta.Returnvalue.NoConnectionDefined=N\u00E3o existe conex\u00E3o definida para esta transforma\u00E7\u00E3o.
DeleteMeta.Returnvalue.NoReceivingAnyFields=N\u00E3o se est\u00E1 recebendo nenhum campo das transforma\u00E7\u00F5es anteriores. Verifica as transforma\u00E7\u00F5es anteriores e os saltos de conex\u00E3o a procura de erros.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ DeleteMeta.CheckResult.TablenameOK=Table name is filled in.
DeleteMeta.CheckResult.TransformReceivingInfo=Transform is receiving info from other transforms.
DeleteMeta.CheckResult.VisitTableSuccessfully=Table exists and we can read data from it.
DeleteMeta.DefaultTableName.Label=lookup table\:
DeleteMeta.keyword=delete
DeleteMeta.Keyword=delete
DeleteMeta.Returnvalue.ErrorOccurred=An error occurred\:
DeleteMeta.Returnvalue.NoConnectionDefined=There is no connection defined in this transform.
DeleteMeta.Returnvalue.NoReceivingAnyFields=Not receiving any fields from previous transforms. Check the previous transforms for errors & the connecting hops.
Expand Down

0 comments on commit 3eb62a0

Please sign in to comment.