Reputation: 1
Code for refError code image addedI have a query in Hadoop which uses lateral view explode.It works fine. But when I am passing the same to sas it is giving a parse exception error. Can't figure out how to use the query.
`Proc sql;
Connect to hadoop(
Host=..
Schema..
Uri=..
Scratch_db=
Subchar=);
Create table app as
Select *
From connection to hadoop(
With jsonextr as(
Select
Get_json_object(xml,'$.app.id')as id,
Get_json_object(xml,'$.app.apply[].product')as products
From tab1)
Select
Id,
Get_json_object(product_data,'$code') as Code
From jsonextr
Lateral view outer explode(split(products,';')) p as product_data;
);
Disconnect From hadoop;
Quit;`
Upvotes: 0
Views: 58
Reputation: 51611
In your photograph it looks like you forgot this part of the SAS side of the statement. (Hard to tell since the image cropped the beginning of the SAS code).
Select * From connection to hadoop
In your second photo you have an extra CREATE TABLE inside the HADOOP code. You don't want to create a table, you want to return observations. Remove that line from the HADOOP code. Like the code you shared in your question.
If you want HADOOP to make a table in HADOOP instead of returning the observations to SAS you need to wrap the HADOOP code with an EXECUTE BY statement instead of using the FROM CONNECTION TO clause.
execute by hadoop (
create table app as
(with jsonextr as (
select ...
)
select ....
)
);
Upvotes: 0