File tree 4 files changed +18
-3
lines changed
json-type/src/main/java/com/datasqrl/flinkrunner/functions/json
vector-type/src/main/java/com/datasqrl/flinkrunner/functions/vector
4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
package com .datasqrl .flinkrunner .functions .json ;
17
17
18
+ import com .datasqrl .flinkrunner .functions .AutoRegisterSystemFunction ;
18
19
import com .datasqrl .flinkrunner .types .json .FlinkJsonType ;
20
+ import com .google .auto .service .AutoService ;
19
21
import java .util .ArrayList ;
20
22
import lombok .SneakyThrows ;
21
23
import org .apache .flink .shaded .jackson2 .com .fasterxml .jackson .databind .ObjectMapper ;
22
24
import org .apache .flink .table .functions .AggregateFunction ;
23
25
import org .apache .flink .util .jackson .JacksonMapperFactory ;
24
26
25
27
/** Aggregation function that aggregates JSON objects into a JSON array. */
26
- public class jsonb_array_agg extends AggregateFunction <FlinkJsonType , ArrayAgg > {
28
+ @ AutoService (AutoRegisterSystemFunction .class )
29
+ public class jsonb_array_agg extends AggregateFunction <FlinkJsonType , ArrayAgg >
30
+ implements AutoRegisterSystemFunction {
27
31
28
32
private static final ObjectMapper mapper = JacksonMapperFactory .createObjectMapper ();
29
33
Original file line number Diff line number Diff line change 15
15
*/
16
16
package com .datasqrl .flinkrunner .functions .json ;
17
17
18
+ import com .datasqrl .flinkrunner .functions .AutoRegisterSystemFunction ;
18
19
import com .datasqrl .flinkrunner .types .json .FlinkJsonType ;
19
20
import com .datasqrl .flinkrunner .types .json .FlinkJsonTypeSerializer ;
21
+ import com .google .auto .service .AutoService ;
20
22
import java .util .LinkedHashMap ;
21
23
import org .apache .flink .shaded .jackson2 .com .fasterxml .jackson .databind .ObjectMapper ;
22
24
import org .apache .flink .table .annotation .DataTypeHint ;
35
37
value = "RAW" ,
36
38
bridgedTo = FlinkJsonType .class ,
37
39
rawSerializer = FlinkJsonTypeSerializer .class ))
38
- public class jsonb_object_agg extends AggregateFunction <Object , ObjectAgg > {
40
+ @ AutoService (AutoRegisterSystemFunction .class )
41
+ public class jsonb_object_agg extends AggregateFunction <Object , ObjectAgg >
42
+ implements AutoRegisterSystemFunction {
39
43
40
44
private static final ObjectMapper mapper = JacksonMapperFactory .createObjectMapper ();
41
45
Original file line number Diff line number Diff line change 18
18
import static com .datasqrl .flinkrunner .functions .vector .VectorFunctions .VEC_TO_DOUBLE ;
19
19
import static com .datasqrl .flinkrunner .functions .vector .VectorFunctions .convert ;
20
20
21
+ import com .datasqrl .flinkrunner .functions .AutoRegisterSystemFunction ;
21
22
import com .datasqrl .flinkrunner .types .vector .FlinkVectorType ;
23
+ import com .google .auto .service .AutoService ;
22
24
import org .apache .flink .table .functions .AggregateFunction ;
23
25
24
26
/**
25
27
* Aggregates vectors by computing the centroid, i.e. summing up all vectors and dividing the
26
28
* resulting vector by the number of vectors.
27
29
*/
28
- public class center extends AggregateFunction <FlinkVectorType , CenterAccumulator > {
30
+ @ AutoService (AutoRegisterSystemFunction .class )
31
+ public class center extends AggregateFunction <FlinkVectorType , CenterAccumulator >
32
+ implements AutoRegisterSystemFunction {
29
33
30
34
@ Override
31
35
public CenterAccumulator createAccumulator () {
Original file line number Diff line number Diff line change 15
15
*/
16
16
package com .datasqrl .flinkrunner .functions .vector ;
17
17
18
+ import com .datasqrl .flinkrunner .functions .AutoRegisterSystemFunction ;
18
19
import com .datasqrl .flinkrunner .types .vector .FlinkVectorType ;
20
+ import com .google .auto .service .AutoService ;
19
21
20
22
/** Computes the cosine distance between two vectors */
23
+ @ AutoService (AutoRegisterSystemFunction .class )
21
24
public class cosine_distance extends cosine_similarity {
22
25
23
26
@ Override
You can’t perform that action at this time.
0 commit comments