bqjson

Serialize/Deserialize BigQuery TableResults (and TableResult adjacent types) to/from JSON.

Лицензия

Лицензия

Категории

Категории

JSON Данные
Группа

Группа

com.github.shnewto
Идентификатор

Идентификатор

bqjson
Последняя версия

Последняя версия

1.0.1
Дата

Дата

Тип

Тип

pom.sha512
Описание

Описание

bqjson
Serialize/Deserialize BigQuery TableResults (and TableResult adjacent types) to/from JSON.
Ссылка на сайт

Ссылка на сайт

https://github.com/shnewto/bqjson
Система контроля версий

Система контроля версий

http://github.com/shnewto/bqjson/

Скачать bqjson

Зависимости

runtime (3)

Идентификатор библиотеки Тип Версия
com.google.cloud : google-cloud-bigquery jar 1.126.1
com.google.code.gson : gson jar 2.8.6
org.slf4j : slf4j-api jar 1.7.2

Модули Проекта

Данный проект не имеет модулей.

GitHub Actions build Maven Central

bqjson

Serialize/Deserialize BigQuery TableResults (and TableResult adjacent types) to/from JSON.

Example

package com.github.shnewto.bqjson.SerDe;
/* ... */

class MyBigQueryService {
    void myBigQueryWork() {
        /* Get a table result from BigQuery */
        TableResult originalTableResult = bigQuery
                .create(JobInfo.newBuilder(queryConfig)
                .setJobId(jobId).build())
                .waitFor()
                .getQueryResults();
        
        /* Serialize TableResult to JSON */
        String jsonString = SerDe.toJson(originalTableResult);
        /* Deserialize the JSON back into a TableResult */
        TableResult reconstitutedTableResult = SerDe.fromJson(jsonString, TableResult.class);
        
        /* ... */
    }
}

Why?

This package came about because I wanted to write tests for parts of applications that use BQ TableResults, but didn't want to have to actually interact with BQ to run them. I'd hoped that writing TableResults to JSON files (that I could read in and use on the next test runs) would be trivial. When it wasn't, I wrote this helper library so it could be.

Notes

Please raise issues or make PRs if you have a question or spot a bug ❤️ ❤️

Версии библиотеки

Версия
1.0.1
1.0.0