Skip to main content

Error while using Vetrtica NAS location and GZIP together in copy command

  • April 10, 2016
  • 2 replies
  • 19 views

Reva

Hi I am trying to use the below query and not able to get a hold of the error
)
FROM '{MY_DIR}/dummy_files/*' ON ANY NODE,

'{MY_DIR}/20160407061019V/*.gz' GZIP ON ANY NODE ,

'{MY_DIR}/20160407171004V/*.gz' GZIP ON ANY NODE ,

'{MY_DIR}/20160407174004V/*.gz' GZIP ON ANY NODE
DELIMITER AS '|'
REJECTED DATA AS TABLE "VDWWORK.abcd_2"
DIRECT
;
ERROR 4856: Syntax error at or near "ON" at character 5934

How can i use ON any node here?

the mentioned directory is a NAS directory.

2 replies

Gayatri_R
Forum|alt.badge.img
  • Participating Frequently
  • April 11, 2016

Hi,

 

You can only specify one path with COPY. In the snippet you've shared, you've specified 4different paths. Please run the COPY with just one path and it will go through.

 

Thanks

Gayatri

 

 


Reva
  • Author
  • New Participant
  • April 12, 2016

Hey Gayatri,

 

We resolved the issue, with multiple paths. below are the changes:

FROM '{MY_DIR}/dummy_files/*' ON ANY NODE,

'{MY_DIR}/20160407061019V/*.gz' ON ANY NODE GZIP  ,

'{MY_DIR}/20160407171004V/*.gz' ON ANY NODE GZIP  ,

'{MY_DIR}/20160407174004V/*.gz' ON ANY NODE GZIP 
DELIMITER AS '|'
REJECTED DATA AS TABLE "VDWWORK.abcd_2"
DIRECT
;

 

GZIP was to be added after "ON ANY NODE"

 

One of the features that i like about vertica is that it allows you to select files from multiple locations and multiple formats in the same copy statement.