docs.fermihdi.io — julia.md

/ › hd › 2.0.4 › md › sdk

Download julia.mdView raw

FermiHDI SDK — Julia

BETA. Loads and is exercised on every change, but the surface is narrow.

Julia reaches the SDK through ccall into the C ABI of the shared library; there is no Julia-side runtime, so every handle you receive is owned by the SDK and freed by the calls described below. Start with the SDK overview, in particular §1, the control plane / data plane split.

Load

include("FermiHDISDK.jl")
using .FermiHDISDK

The library is found through FERMIHDI_SDK_ROOT/lib, falling back to the loader's search path. Julia dlopens it, so you need the static TLS surplus:

GLIBC_TUNABLES=glibc.rtld.optional_static_tls=1048576 julia script.jl

Modes

The ccall surface is the C ABI's query client, which has a target-setting call but no register_with_dms and no ingest client. Julia therefore queries in proxy mode, or against SCC targets it was given, and neither registers as an HD_CLIENT node nor ingests; those need C++ or Python today. The SDK overview lays out both modes.

API

QueryClient(proxy_url)                      # construct
load_dataset_schema(client, schema_json)
generate_hd_query(client, query) -> String
set_filter_verdict(client, verdict_json) -> Bool   # for a query you dispatched yourself
filter_false_negatives(client) -> String           # JSON: bloomrf_mode, false_negatives
stop(client)

FilterOp                                    # EQUALITY, NOT_EQUAL, GREATER, LESS

Example

include("FermiHDISDK.jl")
using .FermiHDISDK

client = QueryClient("https://proxy.internal:443")
load_dataset_schema(client, read("schema.json", String))

body = generate_hd_query(client, query)
if isempty(body)
    error("open query refused without acknowledge_full_dataset_scan")
end

stop(client)

Use cases

Analysis alongside Julia's numerics. Pull a window into Arrow and work on it with the DataFrames and statistics ecosystem, without moving data through another runtime.

Extending the binding. New calls are ccalls against the C ABI (include/fermihdi_c_api.h), which is flat, nothrow and stable — a better target than the C++ symbols.

Gotchas

Download julia.mdView raw