Python Forum
Py4JJavaError: An error occurred while calling o22720.csv.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Py4JJavaError: An error occurred while calling o22720.csv.
#1
Hello. Any ideas what's going on here? Full disclosure...I am relatively new to Python/Spark programming.

I'm using the following code within Spark to look for common fourgrams within two sets of data (Spark dataframes), df_grouped_s and df_grouped_c:


1) dfIntersectC_S = df_grouped_c.select('unique_fourgrams_grouped_c').intersect(df_grouped_s.select('unique_fourgrams_grouped_s'))

2) Next, I am attempting to output dfIntersectC_S Spark dataframe to a csv file:

dfIntersectCAAP_SAR.write.csv('/collab/crisk/nlpta_poc/workspace/fourgrams_caap_sar.csv')


I receive an error message:

321 raise Py4JError(

Py4JJavaError: An error occurred while calling o22720.csv.
: java.lang.UnsupportedOperationException: CSV data source does not support array<array<string>> data type.
at org.apache.spark.sql.execution.datasources.csv.CSVFileFormat.org$apache$spark$sql$execution$datasources$csv$CSVFileFormat$$verifyType$1(CSVFileFormat.scala:233)
at org.apache.spark.sql.execution.datasources.csv.CSVFileFormat$$anonfun$verifySchema$1.apply(CSVFileFormat.scala:237)
at org.apache.spark.sql.execution.datasources.csv.CSVFileFormat$$anonfun$verifySchema$1.apply(CSVFileFormat.scala:237)
at scala.collection.Iterator$class.foreach(Iterator.scala:893)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at org.apache.spark.sql.types.StructType.foreach(StructType.scala:96)
at org.apache.spark.sql.execution.datasources.csv.CSVFileFormat.verifySchema(CSVFileFormat.scala:237)
at org.apache.spark.sql.execution.datasources.csv.CSVFileFormat.prepareWrite(CSVFileFormat.scala:121)
at org.apache.spark.sql.execution.datasources.FileFormatWriter$.write(FileFormatWriter.scala:108)
at org.apache.spark.sql.execution.datasources.InsertIntoHadoopFsRelationCommand.run(InsertIntoHadoopFsRelationCommand.scala:101)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  pyscript index error while calling input from html form pyscript_dude 2 973 May-21-2023, 08:17 AM
Last Post: snippsat
  Unknown error occurred: Port not found NewBeie 0 1,431 Aug-27-2020, 08:50 PM
Last Post: NewBeie
Bug maximum recursion depth exceeded while calling a Python object error in python3 Prezess 4 3,747 Aug-02-2020, 02:21 PM
Last Post: deanhystad
  Error trying to Calling web service stahorse 2 2,422 May-22-2019, 09:09 AM
Last Post: stahorse
  During handling of the above exception, another exception occurred Skaperen 7 26,868 Dec-21-2018, 10:58 AM
Last Post: Gribouillis
  when calling module comes up with syntax error DAS 5 3,793 Nov-27-2017, 01:50 PM
Last Post: sparkz_alot
  calling python function in c++ callback getting segmentation fault error Jotirling 3 7,165 Oct-26-2017, 08:55 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020