From 4022c1b33a261c3e4a7d538892c01920ff61dce0 Mon Sep 17 00:00:00 2001 From: Vitalii Yarmus Date: Mon, 17 Nov 2025 16:57:37 +0200 Subject: [PATCH] HCK-13527: improve type conversion from and to Polyglot --- polyglot/adapter.json | 71 ++++++++++++++++++++++++++++++++++++ polyglot/convertAdapter.json | 36 ++++++++++++++++++ 2 files changed, 107 insertions(+) diff --git a/polyglot/adapter.json b/polyglot/adapter.json index 46d3aec..018efd6 100644 --- a/polyglot/adapter.json +++ b/polyglot/adapter.json @@ -190,6 +190,77 @@ "length": 10485760 } }, + { + "from": { + "type": "varchar", + "format": "ipv4" + }, + "to": { + "mode": "inet" + } + }, + { + "from": { + "type": "nvarchar", + "format": "ipv4" + }, + "to": { + "mode": "inet" + } + }, + { + "from": { + "type": "time" + }, + "to": { + "timePrecision": { "type": "Source", "path": "tPrecision" } + } + }, + { + "from": { + "type": "timestamp_ntz" + }, + "to": { + "timezone": "WITHOUT TIME ZONE", + "timePrecision": { "type": "Source", "path": "tPrecision" } + } + }, + { + "from": { + "type": "timestamp_ltz" + }, + "to": { + "timezone": "WITH TIME ZONE", + "timePrecision": { "type": "Source", "path": "tPrecision" } + } + }, + { + "from": { + "type": "timestamp_tz" + }, + "to": { + "timezone": "WITH TIME ZONE", + "timePrecision": { "type": "Source", "path": "tPrecision" } + } + }, + { + "from": { + "type": "varchar", + "format": "duration" + }, + "to": { + "mode": "interval" + } + }, + { + "from": { + "type": "nvarchar", + "format": "duration" + }, + "to": { + "mode": "interval" + } + }, [ "deconstructArrayIntoArrayType", { diff --git a/polyglot/convertAdapter.json b/polyglot/convertAdapter.json index 4745dc5..2fd5db9 100644 --- a/polyglot/convertAdapter.json +++ b/polyglot/convertAdapter.json @@ -50,6 +50,42 @@ "subtype": "vector" } }, + { + "from": { + "type": "inet" + }, + "to": { + "format": "ipv4" + } + }, + { + "from": { + "type": "datetime" + }, + "to": { + "tPrecision": { "type": "Source", "path": "timePrecision" } + } + }, + { + "from": { + "type": "datetime", + "mode": "timestamp", + "timezone": "WITH TIME ZONE" + }, + "to": { + "mode": "timestamp with time zone" + } + }, + { + "from": { + "type": "datetime", + "mode": "timestamp", + "timezone": "WITHOUT TIME ZONE" + }, + "to": { + "mode": "timestamp without time zone" + } + }, { "from": { "mode": "varchar",