refactor(dwh): adapt direct and REST transports

This commit is contained in:
2026-07-11 20:03:31 +02:00
parent a4eb6cc9e5
commit 717e5ecced
6 changed files with 193 additions and 0 deletions
+11
View File
@@ -46,3 +46,14 @@ def explain_rest(client, sql: str) -> PlanSummary:
except RestError as e:
raise ExecutionError(str(e)) from e
return parse_text_plan(lines)
def sample_column_rest(
client, schema: str, table: str, column: str, *, limit: int
) -> list[object]:
rows = client.top_values(schema, table, column, limit)
return [row["value"] for row in rows if row.get("value") is not None]
def distinct_values_rest(client, schema: str, table: str, column: str) -> list[object]:
return sample_column_rest(client, schema, table, column, limit=1000)