Skip to content

Commit

Permalink
feat(dli): add example flink sql job
Browse files Browse the repository at this point in the history
  • Loading branch information
azrod committed Dec 28, 2022
1 parent 1b82319 commit c7b8d58
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 0 deletions.
63 changes: 63 additions & 0 deletions examples/dli/flinksqljob.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
apiVersion: dli.flexibleengine.upbound.io/v1beta1
kind: FlinksqlJob
metadata:
annotations:
meta.upbound.io/example-id: dli/v1beta1/flinksqljob
labels:
testing.upbound.io/example-name: example_dli_flinksqljob
name: example-dli-flinksqljob
spec:
forProvider:
name: example-dli-flinksqljob
type: flink_sql_job
sql: |
CREATE SOURCE STREAM car_infos (
car_id STRING,
car_owner STRING,
car_brand STRING,
car_price INT
)
WITH (
type = "dis",
region = "eu-west-0",
channel = "example-dis-stream-input",
partition_count = "1",
encode = "csv",
field_delimiter = ","
);
CREATE SINK STREAM audi_cheaper_than_30w (
car_id STRING,
car_owner STRING,
car_brand STRING,
car_price INT
)
WITH (
type = "dis",
region = "eu-west-0",
channel = "example-dis-stream-output",
partition_key = "car_owner",
encode = "csv",
field_delimiter = ","
);
INSERT INTO audi_cheaper_than_30w
SELECT *
FROM car_infos
WHERE car_brand = "audia4" and car_price < 30;
CREATE SINK STREAM car_info_data (
car_id STRING,
car_owner STRING,
car_brand STRING,
car_price INT
)
WITH (
type ="dis",
region = "eu-west-0",
channel = "example-dis-stream-input",
partition_key = "car_owner",
encode = "csv",
field_delimiter = ","
);
INSERT INTO car_info_data
SELECT "1", "lilei", "bmw320i", 28;
INSERT INTO car_info_data
SELECT "2", "hanmeimei", "audia4", 27;
27 changes: 27 additions & 0 deletions examples/dli/flinksqljob.yaml.extra
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: dis.flexibleengine.upbound.io/v1beta1
kind: Stream
metadata:
annotations:
meta.upbound.io/example-id: dis/v1beta1/stream
labels:
testing.upbound.io/example-name: example_dis_streaminput
name: example-dis-streaminput
spec:
forProvider:
name: example-dis-stream-input
partitionCount: 1

---

apiVersion: dis.flexibleengine.upbound.io/v1beta1
kind: Stream
metadata:
annotations:
meta.upbound.io/example-id: dis/v1beta1/stream
labels:
testing.upbound.io/example-name: example_dis_streamoutput
name: example-dis-streamoutput
spec:
forProvider:
name: example-dis-stream-output
partitionCount: 1

0 comments on commit c7b8d58

Please # to comment.