Skip to content

Instantly share code, notes, and snippets.

UPDATE kv_table
SET value = (
SELECT json_object(
'user_id', json_extract(b.value, '$.user_id'),
'user_uuid', json_extract(b.value, '$.user_uuid'),
'workspace_id', json_extract(b.value, '$.user_workspace.id')
)
FROM kv_table AS b
WHERE b.key = 'session_cache_key_backup'
)
@khorshuheng
khorshuheng / gist:4e0d305463a0cd5a5f7600706d619660
Created December 7, 2020 09:28
Generating TFDV statistics from parquet file
import os
import tempfile
import apache_beam as beam
import tensorflow as tf
from tensorflow_data_validation.api import stats_api
from tensorflow_data_validation.statistics import stats_options as options
from tensorflow_data_validation.utils import stats_util
import pyarrow as pa
from tfx_bsl.arrow.array_util import ToSingletonListArray