Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API to create an empty Delta Lake table #1892

Closed
MrPowers opened this issue Nov 21, 2023 · 2 comments · Fixed by #1932
Closed

Add API to create an empty Delta Lake table #1892

MrPowers opened this issue Nov 21, 2023 · 2 comments · Fixed by #1932
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@MrPowers
Copy link
Collaborator

Description

We should make it easy to create an empty Delta Lake table.

See the Create a Delta Lake table with the PySpark API example in this blog post.

Here's the syntax that PySpark uses, but we can use something else:

from pyspark.sql.types import *

dt1 = (
    DeltaTable.create(spark)
    .tableName("testTable1")
    .addColumn("c1", dataType="INT", nullable=False)
    .addColumn("c2", dataType=IntegerType(), generatedAlwaysAs="c1 + 1")
    .partitionedBy("c1")
    .execute()
)

The syntax we use should be flexible enough to incorporate additional table features that are added to delta-rs.

@MrPowers MrPowers added the enhancement New feature or request label Nov 21, 2023
@ion-elgreco
Copy link
Collaborator

I could take a look at this in the near future

@roeap
Copy link
Collaborator

roeap commented Nov 21, 2023

at least on the rusts side this is already possible. The syntax looks dauntingly similar to the example 😆.

@ion-elgreco ion-elgreco added this to the python v0.15 milestone Nov 22, 2023
rtyler pushed a commit that referenced this issue Dec 2, 2023
Allows one to create a table without writing. 

(created a new one, I keep messing up these rebases..)

- closes #1892
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants