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

Error when parsing delete expressions #2187

Closed
mortnstak opened this issue Feb 15, 2024 · 3 comments
Closed

Error when parsing delete expressions #2187

mortnstak opened this issue Feb 15, 2024 · 3 comments
Labels
binding/python Issues for the Python package bug Something isn't working

Comments

@mortnstak
Copy link

Environment

Delta-rs version:0.15.3

Binding: python

Environment:

  • Cloud provider: Azure
  • OS: Windows 11
  • Other:

Bug

What happened: When executing delete operation on a column of type int32, I get
ValueError: Invalid comparison operation: Int32 <= Int64

What you expected to happen:
I would expect the function to be able parse the integer to a Int32

How to reproduce it:

from deltalake import DeltaTable, write_deltalake
fromdeltalake.exceptions import DeltaError, DeltaProtocolError, TableNotFoundError, CommitFailedError
import pyarrow as pa
try:
    table_uri = "testdelete"
    ids = pa.array([1,2,3,4], pa.int32())
    names = ["id"]
    data = pa.Table.from_arrays([ids], names = names)
    write_deltalake(table_uri, data, mode='overwrite')
    dt = DeltaTable(table_uri)
    dt.delete("id = 1")
except DeltaError as e:
    print(e)

More details: Also - need to be able to parse timestamp expressions in delete statements. For instance expressions on the form
table.delete(f"timestamp < '2024-1-1'"). This currently generates the following error:
ValueError: Invalid comparison operation: Timestamp(Microsecond, None) < Utf8

Current workaround is to use merge statements.

@mortnstak mortnstak added the bug Something isn't working label Feb 15, 2024
@rtyler rtyler added the binding/python Issues for the Python package label Feb 16, 2024
@ion-elgreco
Copy link
Collaborator

This is actually related to this one: #1921, so will close this one as duplicate

@ion-elgreco ion-elgreco closed this as not planned Won't fix, can't repro, duplicate, stale Feb 24, 2024
@gprashmi
Copy link

@mortnstak How did you resolve this issue? I have the same issue with table.delete(predicate) for timestamp
ValueError: Invalid comparison operation: Timestamp(Microsecond, None) < Utf8

@mortnstak
Copy link
Author

@gprashmi - was awaiting updates mentioned in #1921. Never tested after #1921 was marked as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding/python Issues for the Python package bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants