createTable(tableName, path=None, source=None, schema=None, description=None, **options)¶
Creates a table based on the dataset in a data source.
It returns the DataFrame associated with the table.
The data source is specified by the
sourceand a set of
sourceis not specified, the default data source configured by
spark.sql.sources.defaultwill be used. When
pathis specified, an external table is created from the data at the given path. Otherwise a managed table is created.
Optionally, a schema can be provided as the schema of the returned
DataFrameand created table.
New in version 2.2.0.
Changed in version 3.1: Added the