lundi 20 avril 2015

Sqoop + Postgresql: how to prevent quotes around table name

I am trying to import a table from Postgresql to a Parquet file on HDFS.

Here is what I do:

sqoop import \
    --connect "jdbc:postgresql://pg.foo.net:5432/bar" \
    --username user_me --password $PASSWORD \
    --table foo.bar \
    --target-dir /user/me/bar \
    --as-parquetfile

and I get

INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM "foo.bar" AS t LIMIT 1
ERROR manager.SqlManager: Error executing statement: org.postgresql.util.PSQLException: ERROR: relation "foo.bar" does not exist

SELECT t.* FROM "foo.bar" AS t LIMIT 1 does not work indeed, but SELECT t.* FROM foo.bar AS t LIMIT 1 does. So the problem is that table name is quoted. I tried supplying --table argument different ways, but with no effect.

How do I work it around?

Aucun commentaire:

Enregistrer un commentaire