forked from vdesabou/kafka-docker-playground
-
Notifications
You must be signed in to change notification settings - Fork 1
/
sqlserver-repro-tombstone.sh
executable file
·171 lines (162 loc) · 48.1 KB
/
sqlserver-repro-tombstone.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#!/bin/bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
source ${DIR}/../../scripts/utils.sh
${DIR}/../../environment/plaintext/start.sh "${PWD}/docker-compose.plaintext-repro-tombstone.yml"
log "Creating JDBC SQL Server (with JTDS driver) sink connector"
curl -X PUT \
-H "Content-Type: application/json" \
--data '{
"connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
"tasks.max": "1",
"connection.url": "jdbc:jtds:sqlserver://sqlserver:1433",
"connection.user": "sa",
"connection.password": "Password!",
"auto.create": "true",
"pk.mode": "record_key",
"pk.fields": "ID",
"auto.create": true,
"auto.evolve": false,
"key.converter": "org.apache.kafka.connect.converters.LongConverter",
"value.converter" : "Avro",
"value.converter.schema.registry.url":"http://schema-registry:8081",
"topics": "customer"
}' \
http://localhost:8083/connectors/sqlserver-sink/config | jq .
sleep 5
log "Show content of customer table:"
docker exec -i sqlserver /opt/mssql-tools/bin/sqlcmd -U sa -P Password! << EOF
select * from customer
GO
EOF
# ListID NormalizedHashItemID URL MyFloatValue MyTimestamp ID
# -------------------- -------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------ -------------------- --------------------
# 0 0 url0 0.28226356681351483 1594893226549 0
# 1 1 url1 0.28226356681351483 1594893229218 1
# 1 1 url1 0.28226356681351483 1594893229218 2
# 3 3 url3 0.28226356681351483 1594893231229 3
# 4 4 url4 0.28226356681351483 1594893232238 4
# 5 5 url5 0.28226356681351483 1594893233245 5
# 6 6 url6 0.28226356681351483 1594893234252 6
# 7 7 url7 0.28226356681351483 1594893235257 7
# 8 8 url8 0.28226356681351483 1594893236228 8
# 9 9 url9 0.28226356681351483 1594893237244 9
# 0 0 url0 0.28226356681351483 1594893238249 10
# 1 1 url1 0.28226356681351483 1594893239256 11
# 1 1 url1 0.28226356681351483 1594893239256 12
# 3 3 url3 0.28226356681351483 1594893241265 13
# 4 4 url4 0.28226356681351483 1594893242276 14
# 5 5 url5 0.28226356681351483 1594893243282 15
# 6 6 url6 0.28226356681351483 1594893244287 16
# 7 7 url7 0.28226356681351483 1594893245293 17
# 8 8 url8 0.28226356681351483 1594893246298 18
# 9 9 url9 0.28226356681351483 1594893247303 19
# 0 0 url0 0.28226356681351483 1594893248308 20
# 1 1 url1 0.28226356681351483 1594893249313 21
# 1 1 url1 0.28226356681351483 1594893249313 22
# 3 3 url3 0.28226356681351483 1594893251321 23
# 4 4 url4 0.28226356681351483 1594893252326 24
# 5 5 url5 0.28226356681351483 1594893253332 25
# 6 6 url6 0.28226356681351483 1594893254338 26
# 7 7 url7 0.28226356681351483 1594893255344 27
# 8 8 url8 0.28226356681351483 1594893256349 28
# 9 9 url9 0.28226356681351483 1594893257354 29
# 0 0 url0 0.28226356681351483 1594893258359 30
# 1 1 url1 0.28226356681351483 1594893259364 31
# 1 1 url1 0.28226356681351483 1594893259364 32
# 3 3 url3 0.28226356681351483 1594893261376 33
# 4 4 url4 0.28226356681351483 1594893262382 34
# 5 5 url5 0.28226356681351483 1594893263389 35
# 6 6 url6 0.28226356681351483 1594893264395 36
# 7 7 url7 0.28226356681351483 1594893265401 37
# 8 8 url8 0.28226356681351483 1594893266373 38
# 9 9 url9 0.28226356681351483 1594893267379 39
# 0 0 url0 0.28226356681351483 1594893268384 40
# 1 1 url1 0.28226356681351483 1594893269392 41
# 1 1 url1 0.28226356681351483 1594893269392 42
# 3 3 url3 0.28226356681351483 1594893271406 43
# 4 4 url4 0.28226356681351483 1594893272412 44
# 5 5 url5 0.28226356681351483 1594893273417 45
# 6 6 url6 0.28226356681351483 1594893274423 46
# 7 7 url7 0.28226356681351483 1594893275429 47
# 8 8 url8 0.28226356681351483 1594893276434 48
# 9 9 url9 0.28226356681351483 1594893277441 49
# 0 0 url0 0.28226356681351483 1594893278447 50
# 1 1 url1 0.28226356681351483 1594893279453 51
# 1 1 url1 0.28226356681351483 1594893279453 52
# 3 3 url3 0.28226356681351483 1594893281463 53
# 4 4 url4 0.28226356681351483 1594893282468 54
# 5 5 url5 0.28226356681351483 1594893283473 55
# 6 6 url6 0.28226356681351483 1594893284477 56
# 7 7 url7 0.28226356681351483 1594893285482 57
# 8 8 url8 0.28226356681351483 1594893286488 58
# 9 9 url9 0.28226356681351483 1594893287492 59
# 0 0 url0 0.28226356681351483 1594893288497 60
# 1 1 url1 0.28226356681351483 1594893289500 61
# 1 1 url1 0.28226356681351483 1594893289500 62
# 3 3 url3 0.28226356681351483 1594893291512 63
# 4 4 url4 0.28226356681351483 1594893292517 64
# 5 5 url5 0.28226356681351483 1594893293523 65
# 6 6 url6 0.28226356681351483 1594893294528 66
# 7 7 url7 0.28226356681351483 1594893295532 67
# 8 8 url8 0.28226356681351483 1594893296503 68
# 9 9 url9 0.28226356681351483 1594893297509 69
# 0 0 url0 0.28226356681351483 1594893298513 70
# 1 1 url1 0.28226356681351483 1594893299525 71
# 1 1 url1 0.28226356681351483 1594893299525 72
# 3 3 url3 0.28226356681351483 1594893301534 73
# 4 4 url4 0.28226356681351483 1594893302541 74
# 5 5 url5 0.28226356681351483 1594893303546 75
# 6 6 url6 0.28226356681351483 1594893304551 76
# 7 7 url7 0.28226356681351483 1594893305556 77
# 8 8 url8 0.28226356681351483 1594893306562 78
# 9 9 url9 0.28226356681351483 1594893307566 79
# 0 0 url0 0.28226356681351483 1594893308573 80
# 1 1 url1 0.28226356681351483 1594893309578 81
# 1 1 url1 0.28226356681351483 1594893309578 82
# 3 3 url3 0.28226356681351483 1594893311587 83
# 4 4 url4 0.28226356681351483 1594893312592 84
# 5 5 url5 0.28226356681351483 1594893313598 85
# 6 6 url6 0.28226356681351483 1594893314604 86
# 7 7 url7 0.28226356681351483 1594893315609 87
# 8 8 url8 0.28226356681351483 1594893316614 88
# 9 9 url9 0.28226356681351483 1594893317621 89
# 0 0 url0 0.28226356681351483 1594893318624 90
# 1 1 url1 0.28226356681351483 1594893319627 91
# 1 1 url1 0.28226356681351483 1594893319627 92
# 3 3 url3 0.28226356681351483 1594893321636 93
# 4 4 url4 0.28226356681351483 1594893322641 94
# 5 5 url5 0.28226356681351483 1594893323645 95
# 6 6 url6 0.28226356681351483 1594893324650 96
# 7 7 url7 0.28226356681351483 1594893325654 97
# 8 8 url8 0.28226356681351483 1594893326624 98
# 9 9 url9 0.28226356681351483 1594893327628 99
# 0 0 url0 0.28226356681351483 1594893328632 100
# 1 1 url1 0.28226356681351483 1594893329637 101
# 1 1 url1 0.28226356681351483 1594893329637 102
# 3 3 url3 0.28226356681351483 1594893331647 103
# 4 4 url4 0.28226356681351483 1594893332651 104
# 5 5 url5 0.28226356681351483 1594893333655 105
# 6 6 url6 0.28226356681351483 1594893334660 106
# 7 7 url7 0.28226356681351483 1594893335665 107
# 8 8 url8 0.28226356681351483 1594893336669 108
# 9 9 url9 0.28226356681351483 1594893337674 109
# 0 0 url0 0.28226356681351483 1594893338678 110
# 1 1 url1 0.28226356681351483 1594893339683 111
# NULL NULL NULL NULL NULL 112
# 3 3 url3 0.28226356681351483 1594893341701 113
# 4 4 url4 0.28226356681351483 1594893342705 114
# 5 5 url5 0.28226356681351483 1594893343710 115
# 6 6 url6 0.28226356681351483 1594893344716 116
# 7 7 url7 0.28226356681351483 1594893345721 117
# 8 8 url8 0.28226356681351483 1594893346727 118
# 9 9 url9 0.28226356681351483 1594893347731 119
# 0 0 url0 0.28226356681351483 1594893348737 120
# 1 1 url1 0.28226356681351483 1594893349743 121
# NULL NULL NULL NULL NULL 122
# 3 3 url3 0.28226356681351483 1594893351752 123
# 4 4 url4 0.28226356681351483 1594893352758 124
# 5 5 url5 0.28226356681351483 1594893353763 125
# 6 6 url6 0.28226356681351483 1594893354769 126
# 7 7 url7 0.28226356681351483 1594893355775 127
# (128 rows affected)