Skip to content

Commit 90740d9

Browse files
authored
HCK-13527: improve type conversion from and to Polyglot (#175)
1 parent 59c8ea3 commit 90740d9

File tree

2 files changed

+107
-0
lines changed

2 files changed

+107
-0
lines changed

polyglot/adapter.json

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,77 @@
190190
"length": 10485760
191191
}
192192
},
193+
{
194+
"from": {
195+
"type": "varchar",
196+
"format": "ipv4"
197+
},
198+
"to": {
199+
"mode": "inet"
200+
}
201+
},
202+
{
203+
"from": {
204+
"type": "nvarchar",
205+
"format": "ipv4"
206+
},
207+
"to": {
208+
"mode": "inet"
209+
}
210+
},
211+
{
212+
"from": {
213+
"type": "time"
214+
},
215+
"to": {
216+
"timePrecision": { "type": "Source", "path": "tPrecision" }
217+
}
218+
},
219+
{
220+
"from": {
221+
"type": "timestamp_ntz"
222+
},
223+
"to": {
224+
"timezone": "WITHOUT TIME ZONE",
225+
"timePrecision": { "type": "Source", "path": "tPrecision" }
226+
}
227+
},
228+
{
229+
"from": {
230+
"type": "timestamp_ltz"
231+
},
232+
"to": {
233+
"timezone": "WITH TIME ZONE",
234+
"timePrecision": { "type": "Source", "path": "tPrecision" }
235+
}
236+
},
237+
{
238+
"from": {
239+
"type": "timestamp_tz"
240+
},
241+
"to": {
242+
"timezone": "WITH TIME ZONE",
243+
"timePrecision": { "type": "Source", "path": "tPrecision" }
244+
}
245+
},
246+
{
247+
"from": {
248+
"type": "varchar",
249+
"format": "duration"
250+
},
251+
"to": {
252+
"mode": "interval"
253+
}
254+
},
255+
{
256+
"from": {
257+
"type": "nvarchar",
258+
"format": "duration"
259+
},
260+
"to": {
261+
"mode": "interval"
262+
}
263+
},
193264
[
194265
"deconstructArrayIntoArrayType",
195266
{

polyglot/convertAdapter.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,42 @@
5050
"subtype": "vector<real>"
5151
}
5252
},
53+
{
54+
"from": {
55+
"type": "inet"
56+
},
57+
"to": {
58+
"format": "ipv4"
59+
}
60+
},
61+
{
62+
"from": {
63+
"type": "datetime"
64+
},
65+
"to": {
66+
"tPrecision": { "type": "Source", "path": "timePrecision" }
67+
}
68+
},
69+
{
70+
"from": {
71+
"type": "datetime",
72+
"mode": "timestamp",
73+
"timezone": "WITH TIME ZONE"
74+
},
75+
"to": {
76+
"mode": "timestamp with time zone"
77+
}
78+
},
79+
{
80+
"from": {
81+
"type": "datetime",
82+
"mode": "timestamp",
83+
"timezone": "WITHOUT TIME ZONE"
84+
},
85+
"to": {
86+
"mode": "timestamp without time zone"
87+
}
88+
},
5389
{
5490
"from": {
5591
"mode": "varchar",

0 commit comments

Comments
 (0)