1. Concatenating VARCHAR Columns - Teradata Vantage

Teradata® Open Table Format for Apache Iceberg and Delta Lake User Guide

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Lake
Product
Teradata Vantage
Release Number
20.00
Published
October 2025
ft:locale
en-US
ft:lastEdition
2025-10-25
dita:mapPath
qrj1749167830193.ditamap
dita:ditavalPath
lli1749584660955.ditaval
dita:id
bsr1702324250454

Currently, the VARCHAR columns are assigned the maximum size allowed (32K UNICODE) while identifying the Variable Length string in Iceberg data. This can cause an issue while trying to CONCATENATE two VARCHAR strings as we have used the Maximum Size. Starting in version 20.00.19, the VARCHAR size is determined from the OTF metadata. If the VARCHAR size cannot be determined from the metadata, then 32000 is used by default.

  • A workaround is available to get the actual maximum length of the VARCHAR column and then cast it to the actual size and then concatenate it.

The example shown below:

SELECT (PICKUP_ZONE || ITINERARY) FROM ICEBERG_GLUE_1.glue_catalog.itinerary;
*** Failure 3798 A column or character expression is larger than the max size.
+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
# WORKAROUND 
+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
select max(character_length (PICKUP_ZONE)), MAX(character_length (DROPOFF_ZONE)) from ICEBERG_GLUE_1.glue_catalog.itinerary;
 *** Query completed. One row found. 2 columns returned. 
 *** Total elapsed time was 2 seconds.
Maximum(Characters(pickup_zone))  Maximum(Characters(dropoff_zone))
--------------------------------  ---------------------------------
                              18                                 18
+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+-
SELECT (cast (PICKUP_ZONE as char(18)) || cast(ITINERARY as char(18)) ) FROM  ICEBERG_GLUE_1.glue_catalog.itinerary;;                     
 *** Query completed. One row found. One column returned.                                                              
 *** Total elapsed time was 2 seconds.                                                                                
Minimum(avg_dropoff_latitude)                                                                                         
-----------------------------                              
        4.10000000000000E 001