Not able to get column information from information_schema when struct field name contains a slash "/" character
Author: fcomunizCreated Aug 27, 2021Updated Sep 17, 2026
I have an environment where i have trino (358) connected to a hive metastore (3.1.2), and trying to get the information schema for all the columns in the connector, i ran the following query
SELECT
lower(col_name) AS col_name,
c.column_comment AS col_description,
lower(c.data_type) AS col_type,
c.ordinal_position AS col_sort_order,
c.table_catalog AS cluster,
lower(c.table_schema) AS "schema",
lower(c.table_name) AS name,
t.table_comment AS description,
case when lower(t.table_type) = 'view' then 'true' else 'false' end AS is_view
FROM
INFORMATION_SCHEMA.COLUMNS AS c
LEFT JOIN
INFORMATION_SCHEMA.TABLES t
ON c.TABLE_NAME = t.TABLE_NAME
AND c.TABLE_SCHEMA = t.TABLE_SCHEMA
ORDER by cluster, "schema", name, col_sort_order This gave me an error when running the query
java.lang.IllegalArgumentException: Error: : expected at the position 9 of 'struct<24/7:string,gxr:string,lzone:string,ladies:string,livegx:string,pt:string,physiotherapist:string,yanga:string>' but '/' is found.
at org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils$TypeInfoParser.expect(TypeInfoUtils.java:413)
at org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils$TypeInfoParser.expect(TypeInfoUtils.java:384)
at org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils$TypeInfoParser.parseType(TypeInfoUtils.java:541)
at org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils$TypeInfoParser.parseTypeInfos(TypeInfoUtils.java:358)
at org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils.getTypeInfoFromTypeString(TypeInfoUtils.java:865)
at io.trino.plugin.hive.HiveType.valueOf(HiveType.java:192)I ommited the traceback for the rest to avoid too much output.
It looks like Trino uses hive to get the type info, but looks like it fails on a type with / on the type name, which is the case on the column that it fails "struct<24/7:string,gxr:string,lzone:string,ladies:string,livegx:string,pt:string,physiotherapist:string,yanga:string>"
Should trino pass field name information for the type for hive?
Thanks for any help
Source: trinodb/trino