Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2024 09:32 PM
Trying to serialize as binary can be pretty challenging, here's a way to do this with base64 - the trick is to serialize as base64 string and insert as binary with unbase64.
databricks api post /api/2.0/sql/statements --json '{
"warehouse_id": "warehouse-id",
"catalog": "catalog",
"schema": "schema",
"statement": "INSERT INTO binary (bin) VALUES (unbase64(:bin))",
"parameters": [
{"name": "bin", "value": "$(cat ~/pixel.png | base64)", "type": "STRING"}
]
}'