With the help of the options that copy offers we have the ability to skip a column or ever a part of a column.
In this examples will demonstrate how this can be done.
We will use a csv data files called data.csv as our loading data.
And the table we load data into is called test and is has 3 columns.
Let's see how we can skip a column when loading data.
you can see that no data was loaded into column col2, also is important that the col2 should accept null values.
As you can see we declare the input value as v2 but we don't tell Vertica to pass it into our load batch.
How can we skip a part of a column
The data we will use for this example:
And the same table test:
Load Example
you see that we "declare" 4 variables that will receive the input data from the data.csv file but we only pass to the load command only 3 of them. Since we have established that the separator between the first and second variable data set is 'x' , the data will separated into 4 columns.