Olá,
estabelecimentos = estabelecimentos .withColumn("data_situacao_cadastral", f.to_date(estabelecimentos.data_situacao_cadastral.cast(StringType()),'yyyyMMdd') ).withColumn( "data_de_inicio_atividade", f.to_date(estabelecimentos.data_de_inicio_atividade.cast(StringType()),'yyyyMMdd') ).withColumn( "data_da_situacao_especial", f.to_date(estabelecimentos.data_da_situacao_especial.cast(StringType()),'yyyyMMdd') ) estabelecimentos.printSchema()
ERROR:py4j.java_gateway:An error occurred while trying to connect to the Java server (127.0.0.1:45129) Traceback (most recent call last): File "/content/spark-3.1.2-bin-hadoop2.7/python/lib/py4j-0.10.9-src.zip/py4j/java_gateway.py", line 977, in getconnection connection = self.deque.pop() IndexError: pop from an empty deque
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/content/spark-3.1.2-bin-hadoop2.7/python/lib/py4j-0.10.9-src.zip/py4j/java_gateway.py", line 1115, in start self.socket.connect((self.address, self.port))
ConnectionRefusedError: [Errno 111] Connection refused
IndexError Traceback (most recent call last) /content/spark-3.1.2-bin-hadoop2.7/python/lib/py4j-0.10.9-src.zip/py4j/java_gateway.py in getconnection(self) 976 try: --> 977 connection = self.deque.pop() 978 except IndexError:
IndexError: pop from an empty deque
During handling of the above exception, another exception occurred:
ConnectionRefusedError Traceback (most recent call last) 7 frames ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Py4JNetworkError Traceback (most recent call last) /content/spark-3.1.2-bin-hadoop2.7/python/lib/py4j-0.10.9-src.zip/py4j/java_gateway.py in start(self) 1125 "server ({0}:{1})".format(self.address, self.port) 1126 logger.exception(msg) -> 1127 raise Py4JNetworkError(msg, e) 1128 1129 def authenticateconnection(self):
Py4JNetworkError: An error occurred while trying to connect to the Java server (127.0.0.1:45129)