Pular para o conteúdo principal

tabela (DataFrameReader)

Retorna a tabela especificada como um DataFrame.

Sintaxe

table(tableName)

Parâmetros

Parâmetro

Tipo

Descrição

tableName

str

O nome da mesa.

Devoluções

DataFrame

Exemplos

Python
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")