KeyError when omitting optional columns while writing to Delta Tables #1499
Unanswered
chinmaychandak
asked this question in
Q&A
Replies: 1 comment 1 reply
-
@chinmaychandak - right now there is no other way then to include the columns as null. we are beginning some work to cast columns into the correct data types if there is a (lossless?) conversion. My suggestion would be to leverage the available table schema to write some code that can just generate all missing null columns. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey guys, I'm new to using Delta Lake.
When I run the below code in Python, I get
KeyError: "name 'b' present in the specified schema is not found in the columns or index"
fordf2
. The data I deal with comes in batches and not all columns registered in the schema are guaranteed to always be present in each batch/dataframe. It works if I try withdf3
but it is not practical to add all the missing columns withNone
ornp.NaN
since the schemas can have 100s of optional fields.Can someone please help me figure out how can I get this to work?
I apologize in advance if my question is too naive or if this isn't the correct place to post questions.
Beta Was this translation helpful? Give feedback.
All reactions