diff --git a/stdlib/experimental/iox/iox.flux b/stdlib/experimental/iox/iox.flux index c8c3407378..5c581edcc6 100644 --- a/stdlib/experimental/iox/iox.flux +++ b/stdlib/experimental/iox/iox.flux @@ -12,3 +12,6 @@ package iox // - bucket: IOx bucket to read data from. // - measurement: Measurement to read data from. builtin from : (bucket: string, measurement: string) => stream[{A with _time: time}] where A: Record + +// @feature labelPolymorphism +builtin from : (bucket: string, measurement: M) => stream[{A with _time: time}] where A: Record, M: Label diff --git a/stdlib/experimental/mqtt/mqtt.flux b/stdlib/experimental/mqtt/mqtt.flux index b7deb2caed..4f1df7b996 100644 --- a/stdlib/experimental/mqtt/mqtt.flux +++ b/stdlib/experimental/mqtt/mqtt.flux @@ -72,6 +72,27 @@ builtin to : ( A: Record, B: Record +// @feature labelPolymorphism +builtin to : ( + <-tables: stream[{ A with T: time }], + broker: string, + ?topic: string, + ?qos: int, + ?retain: bool, + ?clientid: string, + ?username: string, + ?password: string, + ?name: string, + ?timeout: duration, + ?timeColumn: T = "_time", + ?tagColumns: [string], + ?valueColumns: [string], + ) => stream[B] + where + A: Record, + B: Record, + T: Label + // publish sends data to an MQTT broker using MQTT protocol. // // ## Parameters diff --git a/stdlib/experimental/record/record.flux b/stdlib/experimental/record/record.flux index b342b262fb..b7622916c1 100644 --- a/stdlib/experimental/record/record.flux +++ b/stdlib/experimental/record/record.flux @@ -45,3 +45,6 @@ builtin any : A where A: Record // introduced: 0.134.0 // builtin get : (r: A, key: string, default: B) => B where A: Record + +// @feature labelPolymorphism +builtin get : (r: A, key: C, default: B) => B where A: Record, C: Label diff --git a/stdlib/influxdata/influxdb/influxdb.flux b/stdlib/influxdata/influxdb/influxdb.flux index e1157151e8..a06b5e60a6 100644 --- a/stdlib/influxdata/influxdb/influxdb.flux +++ b/stdlib/influxdata/influxdb/influxdb.flux @@ -328,6 +328,26 @@ builtin to : ( A: Record, B: Record +// @feature labelPolymorphism +builtin to : ( + <-tables: stream[{ A with T: time, M: string }], + ?bucket: string, + ?bucketID: string, + ?org: string, + ?orgID: string, + ?host: string, + ?token: string, + ?timeColumn: T = "_time", + ?measurementColumn: M = "_measurement", + ?tagColumns: [string], + ?fieldFn: (r: A) => B, + ) => stream[{ A with T: time, M: string }] + where + A: Record, + B: Record, + T: Label, + M: Label + // buckets returns a list of buckets in the specified organization. // // ## Parameters diff --git a/stdlib/kafka/kafka.flux b/stdlib/kafka/kafka.flux index 1dfc1039e9..e32dd4b136 100644 --- a/stdlib/kafka/kafka.flux +++ b/stdlib/kafka/kafka.flux @@ -59,3 +59,20 @@ builtin to : ( ) => stream[A] where A: Record + +// @feature labelPolymorphism +builtin to : ( + <-tables: stream[{ A with N: string, T: time }], + brokers: [string], + topic: string, + ?balancer: string, + ?name: string, + ?nameColumn: N = "_measurement", + ?timeColumn: T = "_time", + ?tagColumns: [string], + ?valueColumns: [string], + ) => stream[{ A with N: string, T: time }] + where + A: Record, + N: Label, + T: Label