-
Notifications
You must be signed in to change notification settings - Fork 1
Insert record example missing schema #4
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
Comments
@jesseVast what was the output of running |
Did not follow the exact example. But here is what I did. Results from the list: Function to insert data (vastdbs is a session class that does all the initial set with the access_key(s) and endpoints
Table schema and table creation
Create table instance function from the vastdbs class.
|
Thanks @jesseVast. I've added the guard code - does this look better? https://vast-data.github.io/data-platform-field-docs/vast_database/sdk_ref/manipulation.html |
This catches the error. We should add more details. The "TabularMismatchColumnType" error is painful to troubleshoot. From the RecordBatch.py_dict definition, the Schema argument says If not passed, will be inferred from the Mapping values. The functions (.from_pylist/.from_pydict) will try to infer the schema and MAY fail as pydict to pylist has no column type info. Guessing column types may not be best in this case. On the other hand, *.from_pandas(..) will succeed since pandas -> pa types has a fixed translation. Can we make the change in addition to the error checking. |
In https://vast-data.github.io/data-platform-field-docs/vast_database/sdk_ref/manipulation.html#insert, the example code fails with the following error.
It appears that there is problem with the schema.
Digging into it, the instance function definition of RecordBatch takes "schema" as one of the arguments. Providing a schema solves the issue.
I think we should always provide a schema to create the recordbatch. Alternatively, we should have the
.insert function automagically infer the schema at runtime.Versions:
vastdb: 1.3.6
Vast: 5.2 SP10
The text was updated successfully, but these errors were encountered: