Skip to main content
Sokka
Silver ⭐️⭐️
Dec 9, 2023 12:00 AM UTC
Solved

Hue and Sqoop white spaces in query

Hello,

I'm running a sqoop job through Hue. This imports data from Oracle, but the value of --query is being divided by whitespace and produces sqoop flag error because it does not recognize these parameters

import --connect jdbc:oracle:thin:@server/service --query 'select * from mytable'

The logs show somethng like this:

Sqoop command arguments :
import
--connect
jdbc:oracle:thin:@server/service
--query
'SELECT
*
from
mytable'
-------------------------------------------------------------------------------------------------------
17:48:29.329 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool - Error parsing arguments for import:
17:48:29.329 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool - Unrecognized argument: select
17:48:29.329 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool - Unrecognized argument: *
17:48:29.329 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool - Unrecognized argument: from

 I have tried to scape with single, double quotes, backslash but nothing works.

mszurap
mszurapAnswer
Platinum ⭐️
Dec 11, 2023 10:10 AM UTC

Hi @Sokka 

Thank you for raising this. I see the same behavior in the "Sqoop 1" editor, though with some older CDH versions, I haven't tested with the most recent ones, maybe it's already fixed.

In any case, I would not advise to use the "Sqoop 1" editor, it will quickly become insufficient, as it does not provide any advanced configurations. Instead please create an Oozie workflow (Scheduler / Workflow) with a Sqoop action, you have better controls over there.

As I see this problem should have been fixed in later versions, see

https://issues.cloudera.org/browse/HUE-6717 

Best regards

 Miklos

5 replies

paras
Gold ⭐️⭐️⭐️
Gold ⭐️⭐️⭐️
Dec 11, 2023 9:57 AM UTC

@Sokka 

Could you please try the below syntax. Instead of a single line separate linewise.

import
--connect
jdbc:oracle:thin:@server/service
--query
'SELECT * from mytable'

 

 

Hope this helps,
Paras
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.

Translate
Sokka
SokkaAuthor
Silver ⭐️⭐️
Dec 11, 2023 5:36 PM UTC

Hi @paras

I tried your suggestion but it didn't work. It returned a similar error.

 

Sqoop command arguments :
import
--connect
jdbc:oracle:thin:@server/service
--query
'SELECT
*
from
schema.mytable
where
$CONDITIONS'
[..... <<more log>> ........]
Fetching child yarn jobs
tag id : oozie-176af7fc4166c6a2f20a49ccecd8c42109b5ab3fa82786eb191d19f4732d9afa
No child applications found
=================================================================

<<< Invocation of Sqoop command completed <<<

No child hadoop job is executed.
Intercepting System.exit(1)

null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.oozie.action.hadoop.LauncherAM.runActionMain(LauncherAM.java:417)
at org.apache.oozie.action.hadoop.LauncherAM.access$400(LauncherAM.java:55)
at org.apache.oozie.action.hadoop.LauncherAM$2.run(LauncherAM.java:232)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1898)
at org.apache.oozie.action.hadoop.LauncherAM.run(LauncherAM.java:226)
at org.apache.oozie.action.hadoop.LauncherAM$1.run(LauncherAM.java:156)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1898)
at org.apache.oozie.action.hadoop.LauncherAM.main(LauncherAM.java:144)
Caused by: java.lang.SecurityException: Intercepted System.exit(1)
at org.apache.oozie.action.hadoop.security.LauncherSecurityManager.checkExit(LauncherSecurityManager.java:57)
at java.lang.Runtime.exit(Runtime.java:101)
at java.lang.System.exit(System.java:987)
at org.apache.sqoop.Sqoop.main(Sqoop.java:260)
at org.apache.oozie.action.hadoop.SqoopMain.runSqoopJob(SqoopMain.java:221)
at org.apache.oozie.action.hadoop.SqoopMain.run(SqoopMain.java:206)
at org.apache.oozie.action.hadoop.LauncherMain.run(LauncherMain.java:135)
at org.apache.oozie.action.hadoop.SqoopMain.main(SqoopMain.java:52)
... 16 more

 

Translate
mszurap
Platinum ⭐️
mszurapAnswer
Platinum ⭐️
Dec 11, 2023 10:10 AM UTC

Hi @Sokka 

Thank you for raising this. I see the same behavior in the "Sqoop 1" editor, though with some older CDH versions, I haven't tested with the most recent ones, maybe it's already fixed.

In any case, I would not advise to use the "Sqoop 1" editor, it will quickly become insufficient, as it does not provide any advanced configurations. Instead please create an Oozie workflow (Scheduler / Workflow) with a Sqoop action, you have better controls over there.

As I see this problem should have been fixed in later versions, see

https://issues.cloudera.org/browse/HUE-6717 

Best regards

 Miklos

Translate
Sokka
SokkaAuthor
Silver ⭐️⭐️
Dec 11, 2023 5:42 PM UTC

Hi @mszurap 

Given the issue ticket you mentioned, it should have been solved back in 2017 but we are using Hue™ 4.10.0 with version cdh7.1.8.42 and it still happens in the "Sqoop 1" editor. I tried it from the Oozie workflow and with both modes, "Actions" and "Documents", but it gave the exact same error when it reaches the sqoop action.

Thanks for your response.

Translate
Sokka
SokkaAuthor
Silver ⭐️⭐️
Dec 11, 2023 7:32 PM UTC

Hi @mszurap 

I had troubles because the Oozie UI does not allow me to create the sqoop action with  "command" space in blank, but once created and putting everything in "args" it works!

Thanks.

Translate