0

Environment:

  • Python 3.9.21
  • DuckDB 1.1.3
  • pyarrow 18.1.0
  • deltalake 18.1.0

Behavior explanation:

  1. add and udpate string fields in a struct inside a list under the root of the table works fine.
  2. update sting field in a struct inside a list inside a struct |table->struct->list->struct->field| raise and exception.

exception: duckdb.duckdb.TypeMismatchException: Mismatch Type Error: Type STRUCT(c0 VARCHAR, c1 VARCHAR, c2 STRUCT(status VARCHAR, handledTime VARCHAR)[]) does not match with STRUCT(firstResponseTime VARCHAR, totalResponseTime VARCHAR, stagingData STRUCT(status VARCHAR, handledTime VARCHAR)[]). Cannot cast STRUCTs - element "c0" in source struct was not found in target struct

How to reproduce:

  1. install the required packages using "pip3 install ..." duckdb | pyarrow | deltalake
  2. put this file in a working directory. duckdb_delta_merge_struct_bug.txt
  3. rename extension from .txt to py
  4. give permission to execute ex. chmod 755 poc1.py
  5. run this file once and see the printed row on the screen.
  6. delete the created table directory "poc" in your working directory.
  7. uncomment merge() on line 152 and run again and see the raised exception.

GitHub DuckDB Delta Repository Reported Issue

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.