Não roda o comando na criação do DataFrame. Não encontrei nada na internet. Por favor, como resolver isso?
Código: data = [('Zeca','35'), ('Eva', '29')] colNames = ['Nome', 'Idade'] df = spark.createDataFrame(data, colNames) df
Erro:
Py4JError Traceback (most recent call last) in <cell line: 3>() 1 data = [('Zeca','35'), ('Eva', '29')] 2 colNames = ['Nome', 'Idade'] ----> 3 df = spark.createDataFrame(data, colNames) 4 df
7 frames /usr/local/lib/python3.10/dist-packages/py4j/protocol.py in get_return_value(answer, gateway_client, target_id, name) 328 format(target_id, ".", name), value) 329 else: --> 330 raise Py4JError( 331 "An error occurred while calling {0}{1}{2}. Trace:\n{3}\n". 332 format(target_id, ".", name, value))
Py4JError: An error occurred while calling None.org.apache.spark.api.python.PythonFunction. Trace: py4j.Py4JException: Constructor org.apache.spark.api.python.PythonFunction([class [B, class java.util.HashMap, class java.util.ArrayList, class java.lang.String, class java.lang.String, class java.util.ArrayList, class org.apache.spark.api.python.PythonAccumulatorV2]) does not exist at py4j.reflection.ReflectionEngine.getConstructor(ReflectionEngine.java:180) at py4j.reflection.ReflectionEngine.getConstructor(ReflectionEngine.java:197) at py4j.Gateway.invoke(Gateway.java:237) at py4j.commands.ConstructorCommand.invokeConstructor(ConstructorCommand.java:80) at py4j.commands.ConstructorCommand.execute(ConstructorCommand.java:69) at py4j.ClientServerConnection.waitForCommands(ClientServerConnection.java:182) at py4j.ClientServerConnection.run(ClientServerConnection.java:106) at java.lang.Thread.run(Thread.java:750)