Question

I am injecting vertica data to sqoop1 on a mapr cluster. I use the following query :

 sqoop import -m 1 --driver com.vertica.jdbc.Driver --connect "jdbc:vertica://*******:5433/db_name" --password "password" --username "username" --table "schemaName.tableName" --columns "id" --target-dir "/t" --verbose

This query gives me an error that

Caused by: com.vertica.util.ServerException: [Vertica][VJDBC](4856) ERROR: Syntax error at or near "."

I read https://groups.google.com/a/cloudera.org/forum/#!msg/cdh-user/xIBwvc_eOp0/TvhANQfvcv4J for getting more information regarding this, but wasnt quite helpful as they gave results on Sqoop2.

When I run this query :

sqoop import -m 1 --driver com.vertica.jdbc.Driver --connect "jdbc:vertica://*******:5433/db_name" --password "password" --username "username" --table "tableName" --columns "id" --target-dir "/t" --verbose

It gives an error: Relation "tableName" doesnt exist.

I have added the required vertica-jdk jars in sqoop library too.

Any help regarding how to mention schema name in sqoop for vertica?

Was it helpful?

Solution 2

I changed the statement to --query and the schema.table is working fine there. So the statement is :

sqoop import -m 1 --driver com.vertica.jdbc.Driver --connect "jdbc:vertica://*****:5433/dbName" --password "*****" --username "******" --target-dir "/tmp/cdsdj" --verbose --query 'SELECT t.col1 FROM schema.tableName t where $CONDITIONS'

OTHER TIPS

You can specify the schema name to use in the connection string like this:

--connect "jdbc:vertica://*******:5433/db_name?searchpath=myschema"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top