-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a4797fd
commit 2bc5fe5
Showing
5 changed files
with
272 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
control substitution on | ||
|
||
system ok | ||
rpk topic delete 'glue-sample-my-event' | ||
|
||
system ok | ||
rpk topic create 'glue-sample-my-event' | ||
|
||
system ok | ||
rpk topic produce -f '%v{hex}\n' 'glue-sample-my-event' <<EOF | ||
03005af405ef11b5444281a2e0563e5a734606666f6f80868dc8ebd98404 | ||
EOF | ||
|
||
statement ok | ||
create source t with ( | ||
connector = 'kafka', | ||
properties.bootstrap.server='${RISEDEV_KAFKA_BOOTSTRAP_SERVERS}', | ||
topic = 'glue-sample-my-event') | ||
format plain encode avro ( | ||
aws.glue.schema_arn = 'arn:aws:glue:ap-southeast-1:123456123456:schema/default-registry/MyEvent', | ||
aws.glue.mock_config = '{ | ||
"by_id":{ | ||
"5af405ef-11b5-4442-81a2-e0563e5a7346": { | ||
"type": "record", | ||
"name": "MyEvent", | ||
"fields": [ | ||
{ | ||
"name": "f1", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "f2", | ||
"type": { | ||
"type": "long", | ||
"logicalType": "timestamp-micros" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"arn_to_latest_id":{ | ||
"arn:aws:glue:ap-southeast-1:123456123456:schema/default-registry/MyEvent": "5af405ef-11b5-4442-81a2-e0563e5a7346" | ||
} | ||
}'); | ||
|
||
query TT | ||
select * from t; | ||
---- | ||
foo 2006-01-02 22:04:05.123456+00:00 | ||
|
||
statement ok | ||
alter source t format plain encode avro ( | ||
aws.glue.schema_arn = 'arn:aws:glue:ap-southeast-1:123456123456:schema/default-registry/MyEvent', | ||
aws.glue.mock_config = '{ | ||
"by_id":{ | ||
"5af405ef-11b5-4442-81a2-e0563e5a7346": { | ||
"type": "record", | ||
"name": "MyEvent", | ||
"fields": [ | ||
{ | ||
"name": "f1", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "f2", | ||
"type": { | ||
"type": "long", | ||
"logicalType": "timestamp-micros" | ||
} | ||
} | ||
] | ||
}, | ||
"4516411b-b1e7-4e67-839f-3ef1b8c29280": { | ||
"type": "record", | ||
"name": "MyEvent", | ||
"fields": [ | ||
{ | ||
"name": "f1", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "f2", | ||
"type": { | ||
"type": "long", | ||
"logicalType": "timestamp-micros" | ||
} | ||
}, | ||
{ | ||
"name": "f3", | ||
"type": ["null", "bytes"], | ||
"default": null | ||
} | ||
] | ||
} | ||
}, | ||
"arn_to_latest_id":{ | ||
"arn:aws:glue:ap-southeast-1:123456123456:schema/default-registry/MyEvent": "4516411b-b1e7-4e67-839f-3ef1b8c29280" | ||
} | ||
}'); | ||
|
||
query TTT | ||
select * from t; | ||
---- | ||
foo 2006-01-02 22:04:05.123456+00:00 NULL | ||
|
||
system ok | ||
rpk topic produce -f '%v{hex}\n' 'glue-sample-my-event' <<EOF | ||
03004516411bb1e74e67839f3ef1b8c292800441428089b5e9a886ee050208deadbeef | ||
EOF | ||
|
||
query TTT | ||
select * from t order by 2; | ||
---- | ||
foo 2006-01-02 22:04:05.123456+00:00 NULL | ||
AB 2022-04-08 00:00:00.123456+00:00 \xdeadbeef | ||
|
||
statement ok | ||
drop source t; | ||
|
||
system ok | ||
rpk topic delete 'glue-sample-my-event' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters