How to Skip a column when loading data in Vertica

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.
Similar Article  Working with Merge in Vertica

This can be very useful when loading data.

 

   

I hope this was helpful and i appreciate if you would like, subscribe or share our posts. I it is just a click

clickhere

No Comments
Leave a Comment

%d bloggers like this: