[
https://issues.apache.org/jira/browse/SPARK-33585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Maxim Gekk updated SPARK-33585:
-------------------------------
Affects Version/s: (was: 2.4.7)
(was: 3.0.1)
3.0.2
2.4.8
> The comment for SQLContext.tables() doesn't mention the `database` column
> -------------------------------------------------------------------------
>
> Key: SPARK-33585
> URL: https://issues.apache.org/jira/browse/SPARK-33585
> Project: Spark
> Issue Type: Documentation
> Components: SQL
> Affects Versions: 2.4.8, 3.0.2, 3.1.0
> Reporter: Maxim Gekk
> Priority: Minor
>
> The comment says: "The returned DataFrame has two columns, tableName and
> isTemporary":
> https://github.com/apache/spark/blob/b26ae98407c6c017a4061c0c420f48685ddd6163/sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala#L664
> but actually the dataframe has 3 columns:
> {code:scala}
> scala> spark.range(10).createOrReplaceTempView("view1")
> scala> val tables = spark.sqlContext.tables()
> tables: org.apache.spark.sql.DataFrame = [database: string, tableName: string
> ... 1 more field]
> scala> tables.printSchema
> root
> |-- database: string (nullable = false)
> |-- tableName: string (nullable = false)
> |-- isTemporary: boolean (nullable = false)
> scala> tables.show
> +--------+---------+-----------+
> |database|tableName|isTemporary|
> +--------+---------+-----------+
> | default| t1| false|
> | default| t2| false|
> | default| ymd| false|
> | | view1| true|
> +--------+---------+-----------+
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]