Compartilhar via


table (DataFrameReader)

Retorna a tabela especificada como um DataFrame.

Sintaxe

table(tableName)

Parâmetros

Parâmetro Tipo Descrição
tableName str O nome da tabela.

Devoluções

DataFrame

Exemplos

df = spark.range(10)
df.createOrReplaceTempView('tblA')
spark.read.table('tblA').show()
# +---+
# | id|
# +---+
# |  0|
# |  1|
# |  2|
# |  3|
# |  4|
# |  5|
# |  6|
# |  7|
# |  8|
# |  9|
# +---+

spark.sql("DROP TABLE tblA")