Skip to content

Commit

Permalink
Merge pull request #2819 from hansva/master
Browse files Browse the repository at this point in the history
add extra check and message when table not found, fixes #2808
  • Loading branch information
hansva authored Apr 12, 2023
2 parents f06b8e0 + 95daa03 commit ccc58b4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.ErrorDialog;
import org.apache.hop.ui.core.dialog.MessageBox;
import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.TableView;
import org.apache.hop.ui.core.widget.TextVar;
Expand Down Expand Up @@ -258,6 +259,21 @@ public void getFields() {
bigQuery.getTable(
variables.resolve(meta.getDatasetId()), variables.resolve(meta.getTableId()));

if (table == null) {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
mb.setText(BaseMessages.getString(PKG, "BeamBQInputDialog.TableNotFound.Title"));
mb.setMessage(
variables.resolve(meta.getTableId())
+ " "
+ BaseMessages.getString(PKG, "BeamBQInputDialog.TableNotFound.Message"));
switch (mb.open()) {
case SWT.OK:
break;
default:
break;
}
return;
}
TableDefinition definition = table.getDefinition();
Schema schema = definition.getSchema();
FieldList fieldList = schema.getFields();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ BeamBQOutputDialog.CreateIfNeeded=Create table if needed
BeamBQOutputDialog.TruncateTable=Truncate table
BeamBQOutputDialog.FailIfNotEmpty=Fail if the table is not empty
BeamBQOutputDialog.keyword=beam,big query,output

BeamBQInputDialog.TableNotFound.Title=Table Not found
BeamBQInputDialog.TableNotFound.Message=could not be found

0 comments on commit ccc58b4

Please sign in to comment.