File tree Expand file tree Collapse file tree 3 files changed +82
-8
lines changed
application/cratedb-toolkit Expand file tree Collapse file tree 3 files changed +82
-8
lines changed Original file line number Diff line number Diff line change 1
- cratedb-toolkit [influxdb,mongodb ]== 0.0.27
1
+ cratedb-toolkit [influxdb,mongodb ]== 0.0.29
Original file line number Diff line number Diff line change @@ -134,6 +134,12 @@ def test_ctk_load_table_mongodb_json(drop_testing_tables):
134
134
progress = GitProgressPrinter (),
135
135
)
136
136
137
+ # The `countries-big.json` file contains bogus characters.
138
+ countries_big_path = datasets_path / "countries-big.json"
139
+ payload = countries_big_path .read_text ()
140
+ payload = payload .replace ("\ufeff " , "" )
141
+ countries_big_path .write_text (payload )
142
+
137
143
# Invoke data transfer.
138
144
command = f"""
139
145
ctk load table \
Original file line number Diff line number Diff line change 38
38
meta :
39
39
type : zyp-project
40
40
version : 1
41
+
41
42
collections :
42
- - address :
43
- container : datasets
44
- name : companies
45
- pre :
46
- rules :
47
- - expression : .[] |= del(.image.available_sizes, .screenshots[].available_sizes)
48
- type : jq
43
+
44
+ - address :
45
+ container : datasets
46
+ name : books
47
+ pre :
48
+ rules :
49
+ - expression : .[] |= (._id |= tostring)
50
+ type : jq
51
+
52
+ - address :
53
+ container : datasets
54
+ name : city_inspections
55
+ pre :
56
+ rules :
57
+ - expression : |
58
+ .[] |= (
59
+ select(true)
60
+ | .address.number |= numbers
61
+ | .address.zip |= numbers
62
+ | .certificate_number |= tostring
63
+ )
64
+ type: jq
65
+
66
+ - address :
67
+ container : datasets
68
+ name : companies
69
+ pre :
70
+ rules :
71
+ - expression : |
72
+ .[] |=
73
+ del(
74
+ .image.available_sizes,
75
+ .screenshots[].available_sizes,
76
+ .created_at
77
+ )
78
+ type: jq
79
+
80
+ - address :
81
+ container : datasets
82
+ name : countries-big
83
+ pre :
84
+ rules :
85
+ - expression : .[] |= (.ISO |= tostring)
86
+ type : jq
87
+
88
+ - address :
89
+ container : datasets
90
+ name : products
91
+ pre :
92
+ rules :
93
+ - expression : |
94
+ .[] |= (
95
+ select(true)
96
+ | if (.for) then .for |= to_array end
97
+ | if (.type) then .type |= to_array end
98
+ | if (.limits.data.n) then .limits.data.n |= tostring end
99
+ | if (.limits.sms.n) then .limits.sms.n |= tostring end
100
+ | if (.limits.voice.n) then .limits.voice.n |= tostring end
101
+ | del(.additional_tarriffs)
102
+ )
103
+ type: jq
104
+
105
+ - address :
106
+ container : datasets
107
+ name : restaurant
108
+ pre :
109
+ rules :
110
+ - expression : |
111
+ .[] |= (
112
+ select(true)
113
+ | .rating |= tostring
114
+ | .type |= to_array
115
+ )
116
+ type: jq
You can’t perform that action at this time.
0 commit comments