GPrameet
GPrameet

Reputation: 11

Error while Importing data in Sqoop 2 (Hue 3.6) using custom SQL

In Hue 3.6 I'm trying to use Sqoop 2 import feature for a custom SQL query from an Oracle database. I'm pasting the SQL query in the field "Table SQL statement" for example: "SELECT x,y,z FROM myschema.mytable where a > 100"

I'm getting the following exception "SQL statement must contain placeholder for auto generated conditions - ${CONDITIONS}"

  1. I need to understand how to use ${CONDITIONS} when running the Hue UI?
  2. Is there any demo, documentation available on using Sqoop 2 from Hue with some advanced features like using custom SQL etc.?

I'm using Cloudera Sandbox that is using Hue 3.6.

Upvotes: 1

Views: 952

Answers (2)

eMazarakis
eMazarakis

Reputation: 132

You can read the DOCS Free-Form Queries on SQOOP. Be careful when you use double quotes "", you have to add the \$CONDITIONS. If you query with single quotes you only need to add $CONDITIONS without backslash.

Upvotes: 0

Junaid
Junaid

Reputation: 778

You can specify condition like following :

"SELECT x,y,z FROM myschema.mytable where a > 100 AND ${CONDITIONS}" 

In sqoop2 code it searches for ' ${CONDITIONS} ' token and throws exception if it doesn't find one.

Upvotes: 1

Related Questions