This is an automated email from the ASF dual-hosted git repository.
hansva pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hop.git
The following commit(s) were added to refs/heads/master by this push:
new 6eccb89df2 added truncate table and truncate on first row options #2111
new 749e9bbde7 Merge pull request #2460 from bamaer/2111
6eccb89df2 is described below
commit 6eccb89df2d2ba355025cf003c7e880bfa69962e
Author: Bart Maertens <[email protected]>
AuthorDate: Thu Feb 23 13:12:24 2023 +0100
added truncate table and truncate on first row options #2111
---
.../pipeline/transforms/verticabulkloader.adoc | 2 +
.../vertica/0003-vertica-bulk-load-truncate.hpl | 80 +++++-----------------
.../vertica/main-0002-vertica-bulk-load.hwf | 2 +-
...wf => main-0003-vertica-bulk-load-truncate.hwf} | 35 ++++++++--
.../vertica/bulkloader/VerticaBulkLoader.java | 15 ++++
.../bulkloader/VerticaBulkLoaderDialog.java | 70 ++++++++++++++++++-
.../vertica/bulkloader/VerticaBulkLoaderMeta.java | 40 +++++++++++
.../bulkloader/messages/messages_en_US.properties | 6 +-
.../src/main/samples/transforms/vertica-docker.hpl | 11 ++-
9 files changed, 180 insertions(+), 81 deletions(-)
diff --git
a/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/verticabulkloader.adoc
b/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/verticabulkloader.adoc
index 7eccd50d79..31fc013f9b 100644
---
a/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/verticabulkloader.adoc
+++
b/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/verticabulkloader.adoc
@@ -53,6 +53,8 @@ This is typically significantly faster than loading data
through e.g. a Table Ou
|Connection|Name of the database connection on which the target table resides.
|Target schema|The name of the Schema for the table to write data to. This is
important for data sources that allow for table names with dots '.' in it.
|Target table|Name of the target table.
+|Truncate table|Truncate this table before loading data
+|Truncate on first row|Only truncate this table if there is data (when the
first row is received)
|Specify database fields|Enable this option to specify the fields in the
Database fields tab. Otherwise all fields are taken into account by default.
|===
diff --git
a/plugins/transforms/verticabulkloader/src/main/samples/transforms/vertica-docker.hpl
b/integration-tests/vertica/0003-vertica-bulk-load-truncate.hpl
similarity index 72%
copy from
plugins/transforms/verticabulkloader/src/main/samples/transforms/vertica-docker.hpl
copy to integration-tests/vertica/0003-vertica-bulk-load-truncate.hpl
index 16cbfb1005..6fb397abcd 100644
---
a/plugins/transforms/verticabulkloader/src/main/samples/transforms/vertica-docker.hpl
+++ b/integration-tests/vertica/0003-vertica-bulk-load-truncate.hpl
@@ -19,7 +19,7 @@ limitations under the License.
-->
<pipeline>
<info>
- <name>vertica-docker</name>
+ <name>0003-vertica-bulk-load-truncate</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
@@ -31,61 +31,15 @@ limitations under the License.
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
- <created_date>2021/10/07 08:35:44.364</created_date>
+ <created_date>2022/12/21 10:10:20.174</created_date>
<modified_user>-</modified_user>
- <modified_date>2021/10/07 08:35:44.364</modified_date>
+ <modified_date>2022/12/21 10:10:20.174</modified_date>
</info>
<notepads>
- <notepad>
- <backgroundcolorblue>251</backgroundcolorblue>
- <backgroundcolorgreen>232</backgroundcolorgreen>
- <backgroundcolorred>201</backgroundcolorred>
- <bordercolorblue>90</bordercolorblue>
- <bordercolorgreen>58</bordercolorgreen>
- <bordercolorred>14</bordercolorred>
- <fontbold>N</fontbold>
- <fontcolorblue>90</fontcolorblue>
- <fontcolorgreen>58</fontcolorgreen>
- <fontcolorred>14</fontcolorred>
- <fontitalic>N</fontitalic>
- <fontname>Noto Sans</fontname>
- <fontsize>10</fontsize>
- <height>469</height>
- <xloc>688</xloc>
- <yloc>48</yloc>
- <note>Run this sample in a Vertica Docker container:
-
-1) pull the docker image: "docker pull vertica/vertica-ce"
-
-2) start the Vertica container:
-docker run -p 5433:5433 -p 5444:5444 \
- --mount type=volume,source=vertica-data,target=/data \
- --name vertica_ce \
- vertica/vertica-ce
-
-3) create a Vertica connection:
-- connection name: vertica
-- host: localhost
-- username: dbadmin
-- port: 5433
-- username: leave blank
-
-4) create the "books" table
-CREATE TABLE books (
- author VARCHAR(150)
-, genre VARCHAR(150)
-, publisher VARCHAR(150)
-, title VARCHAR(150)
-)
-
-5) run the pipeline
-;</note>
- <width>357</width>
- </notepad>
</notepads>
<order>
<hop>
- <from>generate 10M rows</from>
+ <from>generate 1M rows</from>
<to>generate book data</to>
<enabled>Y</enabled>
</hop>
@@ -133,19 +87,21 @@ CREATE TABLE books (
<stream_name>title</stream_name>
</field>
</fields>
+ <only_when_have_rows>Y</only_when_have_rows>
<rejected_data_filename/>
<schema/>
<specify_fields>Y</specify_fields>
<stream_name/>
<table>books</table>
+ <truncate>Y</truncate>
<attributes/>
<GUI>
- <xloc>559</xloc>
- <yloc>80</yloc>
+ <xloc>576</xloc>
+ <yloc>160</yloc>
</GUI>
</transform>
<transform>
- <name>generate 10M rows</name>
+ <name>generate 1M rows</name>
<type>RowGenerator</type>
<description/>
<distribute>Y</distribute>
@@ -159,13 +115,13 @@ CREATE TABLE books (
</fields>
<interval_in_ms>5000</interval_in_ms>
<last_time_field>FiveSecondsAgo</last_time_field>
- <limit>10000000</limit>
+ <limit>1000000</limit>
<never_ending>N</never_ending>
<row_time_field>now</row_time_field>
<attributes/>
<GUI>
- <xloc>64</xloc>
- <yloc>80</yloc>
+ <xloc>80</xloc>
+ <yloc>160</yloc>
</GUI>
</transform>
<transform>
@@ -204,8 +160,8 @@ CREATE TABLE books (
<locale>en</locale>
<attributes/>
<GUI>
- <xloc>229</xloc>
- <yloc>80</yloc>
+ <xloc>240</xloc>
+ <yloc>160</yloc>
</GUI>
</transform>
<transform>
@@ -222,26 +178,22 @@ CREATE TABLE books (
<fields>
<field>
<name>publisher</name>
- <rename/>
</field>
<field>
<name>genre</name>
- <rename/>
</field>
<field>
<name>author</name>
- <rename/>
</field>
<field>
<name>title</name>
- <rename/>
</field>
<select_unspecified>N</select_unspecified>
</fields>
<attributes/>
<GUI>
- <xloc>394</xloc>
- <yloc>80</yloc>
+ <xloc>400</xloc>
+ <yloc>160</yloc>
</GUI>
</transform>
<transform_error_handling>
diff --git a/integration-tests/vertica/main-0002-vertica-bulk-load.hwf
b/integration-tests/vertica/main-0002-vertica-bulk-load.hwf
index 30337bf113..bd897e6364 100644
--- a/integration-tests/vertica/main-0002-vertica-bulk-load.hwf
+++ b/integration-tests/vertica/main-0002-vertica-bulk-load.hwf
@@ -95,7 +95,7 @@ CREATE TABLE IF NOT EXISTS books (
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<parallel>N</parallel>
- <xloc>320</xloc>
+ <xloc>352</xloc>
<yloc>48</yloc>
<attributes_hac/>
</action>
diff --git a/integration-tests/vertica/main-0002-vertica-bulk-load.hwf
b/integration-tests/vertica/main-0003-vertica-bulk-load-truncate.hwf
similarity index 80%
copy from integration-tests/vertica/main-0002-vertica-bulk-load.hwf
copy to integration-tests/vertica/main-0003-vertica-bulk-load-truncate.hwf
index 30337bf113..d2fd235ff3 100644
--- a/integration-tests/vertica/main-0002-vertica-bulk-load.hwf
+++ b/integration-tests/vertica/main-0003-vertica-bulk-load-truncate.hwf
@@ -18,7 +18,7 @@ limitations under the License.
-->
<workflow>
- <name>main-0002-vertica-bulk-load</name>
+ <name>main-0003-vertica-bulk-load-truncate</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
@@ -44,8 +44,8 @@ limitations under the License.
<schedulerType>0</schedulerType>
<weekDay>1</weekDay>
<parallel>N</parallel>
- <xloc>50</xloc>
- <yloc>50</yloc>
+ <xloc>48</xloc>
+ <yloc>96</yloc>
<attributes_hac/>
</action>
<action>
@@ -68,7 +68,7 @@ CREATE TABLE IF NOT EXISTS books (
<connection>vertica</connection>
<parallel>N</parallel>
<xloc>176</xloc>
- <yloc>48</yloc>
+ <yloc>96</yloc>
<attributes_hac/>
</action>
<action>
@@ -95,8 +95,8 @@ CREATE TABLE IF NOT EXISTS books (
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<parallel>N</parallel>
- <xloc>320</xloc>
- <yloc>48</yloc>
+ <xloc>352</xloc>
+ <yloc>96</yloc>
<attributes_hac/>
</action>
<action>
@@ -116,7 +116,7 @@ CREATE TABLE IF NOT EXISTS books (
<clear_result_rows>Y</clear_result_rows>
<parallel>N</parallel>
<xloc>592</xloc>
- <yloc>48</yloc>
+ <yloc>96</yloc>
<attributes_hac/>
</action>
</actions>
@@ -144,6 +144,27 @@ CREATE TABLE IF NOT EXISTS books (
</hop>
</hops>
<notepads>
+ <notepad>
+ <backgroundcolorblue>251</backgroundcolorblue>
+ <backgroundcolorgreen>232</backgroundcolorgreen>
+ <backgroundcolorred>201</backgroundcolorred>
+ <bordercolorblue>90</bordercolorblue>
+ <bordercolorgreen>58</bordercolorgreen>
+ <bordercolorred>14</bordercolorred>
+ <fontbold>N</fontbold>
+ <fontcolorblue>90</fontcolorblue>
+ <fontcolorgreen>58</fontcolorgreen>
+ <fontcolorred>14</fontcolorred>
+ <fontitalic>N</fontitalic>
+ <fontname>Noto Sans</fontname>
+ <fontsize>10</fontsize>
+ <height>44</height>
+ <xloc>48</xloc>
+ <yloc>32</yloc>
+ <note>exactly the same test as main-0002-vertica-bulk-load, but with
truncate option enabled.
+The number of rows in the table should be exactly the same as in
main-0002-vertica-bulk-load</note>
+ <width>529</width>
+ </notepad>
</notepads>
<attributes/>
</workflow>
diff --git
a/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoader.java
b/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoader.java
index 9a76cf12ce..03d38ae9f7 100644
---
a/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoader.java
+++
b/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoader.java
@@ -31,6 +31,7 @@ import org.apache.hop.core.row.IRowMeta;
import org.apache.hop.core.row.IValueMeta;
import org.apache.hop.core.row.RowMeta;
import org.apache.hop.core.util.StringUtil;
+import org.apache.hop.core.util.Utils;
import org.apache.hop.i18n.BaseMessages;
import org.apache.hop.pipeline.Pipeline;
import org.apache.hop.pipeline.PipelineMeta;
@@ -72,6 +73,9 @@ public class VerticaBulkLoader extends
BaseTransform<VerticaBulkLoaderMeta, Vert
Object[] r = getRow(); // this also waits for a previous transform to be
// finished.
if (r == null) { // no more input to be expected...
+ if (first && meta.isTruncateTable() && !meta.isOnlyWhenHaveRows()) {
+ truncateTable();
+ }
try {
data.close();
@@ -85,6 +89,10 @@ public class VerticaBulkLoader extends
BaseTransform<VerticaBulkLoaderMeta, Vert
first = false;
+ if (meta.isTruncateTable()) {
+ truncateTable();
+ }
+
data.outputRowMeta = getInputRowMeta().clone();
meta.getFields(data.outputRowMeta, getTransformName(), null, null, this,
metadataProvider);
@@ -603,6 +611,13 @@ public class VerticaBulkLoader extends
BaseTransform<VerticaBulkLoaderMeta, Vert
super.stopRunning();
}
+ void truncateTable() throws HopDatabaseException {
+ if (meta.isTruncateTable() && ((getCopy() == 0) ||
!Utils.isEmpty(getPartitionId()))) {
+ data.db.truncateTable(resolve(meta.getSchemaName()),
resolve(meta.getTableName()));
+ }
+ }
+
+
@Override
public void dispose() {
diff --git
a/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoaderDialog.java
b/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoaderDialog.java
index fae1e4aa76..8bdee5a96e 100644
---
a/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoaderDialog.java
+++
b/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoaderDialog.java
@@ -34,6 +34,7 @@ import org.apache.hop.pipeline.transform.BaseTransformMeta;
import org.apache.hop.pipeline.transform.ITransformDialog;
import org.apache.hop.pipeline.transform.ITransformMeta;
import org.apache.hop.pipeline.transform.TransformMeta;
+import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.database.dialog.DatabaseExplorerDialog;
import org.apache.hop.ui.core.database.dialog.SqlEditor;
import org.apache.hop.ui.core.dialog.BaseDialog;
@@ -69,6 +70,10 @@ public class VerticaBulkLoaderDialog extends
BaseTransformDialog implements ITra
private MetaSelectionLine<DatabaseMeta> wConnection;
+ private Label wlTruncate;
+ private Button wTruncate;
+
+ private Button wOnlyWhenHaveRows;
private Label wlSchema;
private TextVar wSchema;
private FormData fdlSchema, fdSchema;
@@ -250,6 +255,60 @@ public class VerticaBulkLoaderDialog extends
BaseTransformDialog implements ITra
}
};
+ // Truncate table
+ wlTruncate = new Label(shell, SWT.RIGHT);
+ wlTruncate.setText(BaseMessages.getString(PKG,
"VerticaBulkLoaderDialog.TruncateTable.Label"));
+ PropsUi.setLook(wlTruncate);
+ FormData fdlTruncate = new FormData();
+ fdlTruncate.left = new FormAttachment(0, 0);
+ fdlTruncate.top = new FormAttachment(wTable, margin);
+ fdlTruncate.right = new FormAttachment(middle, -margin);
+ wlTruncate.setLayoutData(fdlTruncate);
+ wTruncate = new Button(shell, SWT.CHECK);
+ PropsUi.setLook(wTruncate);
+ FormData fdTruncate = new FormData();
+ fdTruncate.left = new FormAttachment(middle, 0);
+ fdTruncate.top = new FormAttachment(wlTruncate, 0, SWT.CENTER);
+ fdTruncate.right = new FormAttachment(100, 0);
+ wTruncate.setLayoutData(fdTruncate);
+ SelectionAdapter lsTruncMod =
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent arg0) {
+ input.setChanged();
+ }
+ };
+ wTruncate.addSelectionListener(lsTruncMod);
+ wTruncate.addSelectionListener(
+ new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ setFlags();
+ }
+ });
+
+ // Truncate only when have rows
+ Label wlOnlyWhenHaveRows = new Label(shell, SWT.RIGHT);
+ wlOnlyWhenHaveRows.setText(
+ BaseMessages.getString(PKG,
"VerticaBulkLoaderDialog.OnlyWhenHaveRows.Label"));
+ PropsUi.setLook(wlOnlyWhenHaveRows);
+ FormData fdlOnlyWhenHaveRows = new FormData();
+ fdlOnlyWhenHaveRows.left = new FormAttachment(0, 0);
+ fdlOnlyWhenHaveRows.top = new FormAttachment(wTruncate, margin);
+ fdlOnlyWhenHaveRows.right = new FormAttachment(middle, -margin);
+ wlOnlyWhenHaveRows.setLayoutData(fdlOnlyWhenHaveRows);
+ wOnlyWhenHaveRows = new Button(shell, SWT.CHECK);
+ wOnlyWhenHaveRows.setToolTipText(
+ BaseMessages.getString(PKG,
"VerticaBulkLoaderDialog.OnlyWhenHaveRows.Tooltip"));
+ PropsUi.setLook(wOnlyWhenHaveRows);
+ FormData fdTruncateWhenHaveRows = new FormData();
+ fdTruncateWhenHaveRows.left = new FormAttachment(middle, 0);
+ fdTruncateWhenHaveRows.top = new FormAttachment(wlOnlyWhenHaveRows, 0,
SWT.CENTER);
+ fdTruncateWhenHaveRows.right = new FormAttachment(100, 0);
+ wOnlyWhenHaveRows.setLayoutData(fdTruncateWhenHaveRows);
+ wOnlyWhenHaveRows.addSelectionListener(lsSelMod);
+
+
// Specify fields
wlSpecifyFields = new Label(shell, SWT.RIGHT);
wlSpecifyFields.setText(
@@ -257,14 +316,14 @@ public class VerticaBulkLoaderDialog extends
BaseTransformDialog implements ITra
props.setLook(wlSpecifyFields);
fdlSpecifyFields = new FormData();
fdlSpecifyFields.left = new FormAttachment(0, 0);
- fdlSpecifyFields.top = new FormAttachment(wbTable, margin);
+ fdlSpecifyFields.top = new FormAttachment(wOnlyWhenHaveRows, margin);
fdlSpecifyFields.right = new FormAttachment(middle, -margin);
wlSpecifyFields.setLayoutData(fdlSpecifyFields);
wSpecifyFields = new Button(shell, SWT.CHECK);
props.setLook(wSpecifyFields);
fdSpecifyFields = new FormData();
fdSpecifyFields.left = new FormAttachment(middle, 0);
- fdSpecifyFields.top = new FormAttachment(wbTable, margin);
+ fdSpecifyFields.top = new FormAttachment(wlSpecifyFields, 0, SWT.CENTER);
fdSpecifyFields.right = new FormAttachment(100, 0);
wSpecifyFields.setLayoutData(fdSpecifyFields);
wSpecifyFields.addSelectionListener(lsSelMod);
@@ -797,6 +856,7 @@ public class VerticaBulkLoaderDialog extends
BaseTransformDialog implements ITra
wFields.setEnabled(specifyFields);
wGetFields.setEnabled(specifyFields);
wDoMapping.setEnabled(specifyFields);
+
}
/** Copy information from the meta-data input to the dialog fields. */
@@ -821,6 +881,9 @@ public class VerticaBulkLoaderDialog extends
BaseTransformDialog implements ITra
wStreamName.setText(input.getStreamName());
}
+ wTruncate.setSelection(input.isTruncateTable());
+ wOnlyWhenHaveRows.setSelection(input.isOnlyWhenHaveRows());
+
wDirect.setSelection(input.isDirect());
wAbortOnError.setSelection(input.isAbortOnError());
@@ -853,6 +916,9 @@ public class VerticaBulkLoaderDialog extends
BaseTransformDialog implements ITra
info.setTablename(wTable.getText());
info.setConnection(wConnection.getText());
+ info.setTruncateTable(wTruncate.getSelection());
+ info.setOnlyWhenHaveRows(wOnlyWhenHaveRows.getSelection());
+
info.setExceptionsFileName(wExceptionsLogFile.getText());
info.setRejectedDataFileName(wRejectedDataLogFile.getText());
info.setStreamName(wStreamName.getText());
diff --git
a/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoaderMeta.java
b/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoaderMeta.java
index b7af9fcb8f..0d764aa276 100644
---
a/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoaderMeta.java
+++
b/plugins/transforms/verticabulkloader/src/main/java/org/apache/hop/pipeline/transforms/vertica/bulkloader/VerticaBulkLoaderMeta.java
@@ -84,6 +84,17 @@ public class VerticaBulkLoaderMeta
)
private String tablename;
+ @HopMetadataProperty(
+ key = "truncate",
+ injectionKey = "TRUNCATE_TABLE",
+ injectionKeyDescription =
"VerticaBulkLoader.Injection.TruncateTable.Field")
+ private boolean truncateTable;
+
+ @HopMetadataProperty(
+ key = "only_when_have_rows",
+ injectionKey = "ONLY_WHEN_HAVE_ROWS",
+ injectionKeyDescription =
"VerticaBulkLoader.Inject.OnlyWhenHaveRows.Field")
+ private boolean onlyWhenHaveRows;
@HopMetadataProperty(
key = "direct",
injectionKey = "DIRECT",
@@ -211,6 +222,35 @@ public class VerticaBulkLoaderMeta
this.tablename = tablename;
}
+ /**
+ * @return Returns the truncate table flag.
+ */
+ public boolean isTruncateTable() {
+ return truncateTable;
+ }
+
+ /**
+ * @param truncateTable The truncate table flag to set.
+ */
+ public void setTruncateTable(boolean truncateTable) {
+ this.truncateTable = truncateTable;
+ }
+
+ /**
+ * @return Returns the onlyWhenHaveRows flag.
+ */
+ public boolean isOnlyWhenHaveRows() {
+ return onlyWhenHaveRows;
+ }
+
+ /**
+ * @param onlyWhenHaveRows The onlyWhenHaveRows to set.
+ */
+ public void setOnlyWhenHaveRows(boolean onlyWhenHaveRows) {
+ this.onlyWhenHaveRows = onlyWhenHaveRows;
+ }
+
+
/**
* @param specifyFields The specify fields flag to set.
*/
diff --git
a/plugins/transforms/verticabulkloader/src/main/resources/org/apache/hop/pipeline/transforms/vertica/bulkloader/messages/messages_en_US.properties
b/plugins/transforms/verticabulkloader/src/main/resources/org/apache/hop/pipeline/transforms/vertica/bulkloader/messages/messages_en_US.properties
index e53084da0e..44717a4534 100644
---
a/plugins/transforms/verticabulkloader/src/main/resources/org/apache/hop/pipeline/transforms/vertica/bulkloader/messages/messages_en_US.properties
+++
b/plugins/transforms/verticabulkloader/src/main/resources/org/apache/hop/pipeline/transforms/vertica/bulkloader/messages/messages_en_US.properties
@@ -107,4 +107,8 @@ VerticaBulkLoader.Injection.REJECTEDDATAFILENAME=The
optional filename to write
VerticaBulkLoader.Injection.STREAMNAME=The optional name of the stream which
appears in the vt_load_stream table.
VerticaBulkLoader.Injection.DATABASE_FIELDS=Database Fields
VerticaBulkLoader.Injection.FIELDSTREAM=The source field names containing the
values to insert.
-VerticaBulkLoader.Injection.FIELDDATABASE=The target field names to insert
into the Vertica table.
\ No newline at end of file
+VerticaBulkLoader.Injection.FIELDDATABASE=The target field names to insert
into the Vertica table.
+VerticaBulkLoaderDialog.TruncateTable.Label=Truncate table
+VerticaBulkLoaderDialog.OnlyWhenHaveRows.Label=Truncate on first row
+VerticaBulkLoader.Injection.TruncateTable.Field=Truncate table
+VerticaBulkLoader.Inject.OnlyWhenHaveRows.Field=Truncate on first row
\ No newline at end of file
diff --git
a/plugins/transforms/verticabulkloader/src/main/samples/transforms/vertica-docker.hpl
b/plugins/transforms/verticabulkloader/src/main/samples/transforms/vertica-docker.hpl
index 16cbfb1005..d058abbfd5 100644
---
a/plugins/transforms/verticabulkloader/src/main/samples/transforms/vertica-docker.hpl
+++
b/plugins/transforms/verticabulkloader/src/main/samples/transforms/vertica-docker.hpl
@@ -50,7 +50,7 @@ limitations under the License.
<fontitalic>N</fontitalic>
<fontname>Noto Sans</fontname>
<fontsize>10</fontsize>
- <height>469</height>
+ <height>486</height>
<xloc>688</xloc>
<yloc>48</yloc>
<note>Run this sample in a Vertica Docker container:
@@ -68,7 +68,8 @@ docker run -p 5433:5433 -p 5444:5444 \
- host: localhost
- username: dbadmin
- port: 5433
-- username: leave blank
+- password: leave blank
+- database name: vmart
4) create the "books" table
CREATE TABLE books (
@@ -133,11 +134,13 @@ CREATE TABLE books (
<stream_name>title</stream_name>
</field>
</fields>
+ <only_when_have_rows>N</only_when_have_rows>
<rejected_data_filename/>
<schema/>
<specify_fields>Y</specify_fields>
<stream_name/>
<table>books</table>
+ <truncate>N</truncate>
<attributes/>
<GUI>
<xloc>559</xloc>
@@ -222,19 +225,15 @@ CREATE TABLE books (
<fields>
<field>
<name>publisher</name>
- <rename/>
</field>
<field>
<name>genre</name>
- <rename/>
</field>
<field>
<name>author</name>
- <rename/>
</field>
<field>
<name>title</name>
- <rename/>
</field>
<select_unspecified>N</select_unspecified>
</fields>