From 134aeff964cfa1d236eaac1e70478949b52a97ca Mon Sep 17 00:00:00 2001 From: Rene Krenn Date: Mon, 16 Aug 2021 17:06:45 +0200 Subject: [PATCH] TT#137100 contract exporter: support duplicate datapaths exporting the same field (path) multiple times results in duplicate column names, which are rejected by sqlite or DBD::xyz. This change introduces a "colname" field for providing an alternative column name to prevent colliding names. Change-Id: I904862651c1a24c4cdc6c643da6f9156e15ffbc6 --- lib/NGCP/BulkProcessor/Projects/ETL/Customer/Dao/Tabular.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/NGCP/BulkProcessor/Projects/ETL/Customer/Dao/Tabular.pm b/lib/NGCP/BulkProcessor/Projects/ETL/Customer/Dao/Tabular.pm index cd7d692..37c6044 100644 --- a/lib/NGCP/BulkProcessor/Projects/ETL/Customer/Dao/Tabular.pm +++ b/lib/NGCP/BulkProcessor/Projects/ETL/Customer/Dao/Tabular.pm @@ -54,7 +54,7 @@ sub get_fieldnames { my $expected = shift; unless (defined $fieldnames and defined $expected_fieldnames) { $fieldnames = [ map { - local $_ = (ref $_ ? $_->{path} : $_); + local $_ = (ref $_ ? (exists $_->{colname} ? $_->{colname} : $_->{path}) : $_); $_ =~ s/\./_/g; $_ =~ s/\[(\d+)\]/_$1/g; $_;