/
githubmirror
/
ydb-go-sdk
Обзор
Документация
Войти
/
githubmirror
/
ydb-go-sdk
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/integration/testdata/make_test_arrow.py
17 строк
471 B
Vasily Gerasimov
Arrow test
02 окт 2024, 17:41
02 окт 2024, 17:41
5a82d2f
Код
Авторство
О чём код?
#! /usr/bin/env python3 import pyarrow schema = pyarrow.schema([("id", pyarrow.int64()), ("val", pyarrow.utf8())]) with open("bulk_upsert_test_schema.arrow", "bw") as schema_file: schema_file.write(schema.serialize().to_pybytes()) data = [ pyarrow.array([123, 234]), pyarrow.array(["data1", "data2"]), ] batch = pyarrow.record_batch(data, schema=schema) with open("bulk_upsert_test_data.arrow", "bw") as data_file: data_file.write(batch.serialize())