Reply
New Contributor
Posts: 5
Registered: ‎12-27-2017

AttributeError: Dataframe has no attribute bucketBy

In spark 2.2.0,  I am trying to create table using bucketBy(), but not able to do so. it throws error message :-

AttributeError: Dataframe has no  attribute bucketBy

code:- df.write.bucketBy.saveAsTable("table")

 

any solution?

Cloudera Employee
Posts: 481
Registered: ‎08-11-2014

Re: AttributeError: Dataframe has no attribute bucketBy

Not sure what you're trying to do there, but looks like you have a simple syntax error. bucketBy is a method. Please start with the API docs first.

New Contributor
Posts: 5
Registered: ‎12-27-2017

Re: AttributeError: Dataframe has no attribute bucketBy

[ Edited ]

sorry , there was a typo, the code I am trying to run is :-
df.write.bucketBy(2,"col_name").saveAsTable("table")

Announcements