0

I have a table saved in HDFS called usedcars. I want to create another table based on the output of a select statement on this table as follows

%spark.sql
CREATE TABLE cleanusedcars
AS (
select (maker, model, mileage, manufacture_year, engine_displacement, engine_power, transmission, door_count, seat_count, fuel_type, date_created, date_last_seen, price_eur)
from usedcars
where maker is not null and model is not null and price_eur <= 2000000 and price_eur >= 3000 and manufacture_year <= 2017 and manufacture_year >= 2000
)

I am using spark SQL in a zeppelin notebook. The error I am getting is Error message

Please help! Thanks.

0

1 Answer 1

1

Remove the parenthesis from select(...). If you include parenthesis, the select statement will be interpreted as selecting a single struct column of all the columns you have selected.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.