Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ private Object[] splitField(Object[] r) throws HopException {
PKG, "FieldSplitter.Log.SplitFieldNotValid", meta.getSplitField())));
}

//check if the new field is empty or not
int newFieldsCount = meta.getFieldsCount();

if (newFieldsCount <= 0) {
throw new HopValueException(
(BaseMessages.getString(
PKG, "FieldSplitter.Log.SplitMetaNameNotValid")));
}
// prepare the outputMeta
//
data.outputMeta = getInputRowMeta().clone();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,16 @@ private void ok() {

input.allocate(nrFields);

//check if the new field is empty or not

if (input.getFieldName().length <= 0) {
new ErrorDialog(
shell,
BaseMessages.getString(PKG, "FieldSplitterDialog.FailedToGetFields.DialogTitle"),
BaseMessages.getString(PKG, "FieldSplitter.Log.SplitMetaNameNotValid"),null);
return;
}

// CHECKSTYLE:Indentation:OFF
for (int i = 0; i < input.getFieldName().length; i++) {
final TableItem ti = wFields.getNonEmpty(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ FieldSplitter.Injection.NULL_IF=Value to convert to null
FieldSplitter.Injection.DEFAULT=The default value in case of null
FieldSplitter.Injection.TRIM_TYPE=The trim type (none, left, right, both)
FieldSplitterMeta.keyword=field,splitter
FieldSplitter.Log.SplitMetaNameNotValid=The new field's list can not be empty

Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,5 @@ FieldSplitterMeta.Exception.UnableToLoadTransformMetaFromXML=Unable to load tran
FieldSplitterMeta.keyword=field,splitter
SplitFields.Description=\u8BE5 Transform \u5141\u8BB8\u60A8\u62C6\u5206\u5355\u4E2A\u5B57\u6BB5\u5230\u591A\u4E2A\u5B57\u6BB5\u4E2D
SplitFields.Name=\u62C6\u5206\u5B57\u6BB5
FieldSplitter.Log.SplitMetaNameNotValid=\u65b0\u5b57\u6bb5\u5217\u8868\u4e0d\u80fd\u4e3a\u7a7a