Class HiveToSnowflakeType


  • public class HiveToSnowflakeType
    extends Object
    A util to convert Hive types such as the hive datatype to Snowflake types.
    • Field Detail

      • hiveToSnowflakeDataTypeMap

        public static final com.google.common.collect.ImmutableMap<String,​String> hiveToSnowflakeDataTypeMap
        The mapping from a Hive datatype to a Snowflake datatype
      • hiveTypesWithSpecifications

        public static final com.google.common.collect.ImmutableSet<String> hiveTypesWithSpecifications
        The Hive data types with specifications, e.g. precision/scale or length
    • Constructor Detail

      • HiveToSnowflakeType

        public HiveToSnowflakeType()
    • Method Detail

      • toSnowflakeColumnDataType

        public static String toSnowflakeColumnDataType​(String hiveType)
        converts a Hive column data type to a Snowflake datatype
        Parameters:
        hiveType - The data type of the column according to Hive
        Returns:
        The corresponding Snowflake data type
      • toSnowflakeURL

        public static String toSnowflakeURL​(String hiveUrl)
        Converts a Hive URL to a Snowflake URL. Notably, - s3://, s3n://, s3a:// becomes s3:// - wasb[s]://container@account.blob.(endpoint suffix)/... becomes azure://account.blob.(endpoint suffix)/container/... Note: WASB with default storage (i.e. wasbs:///...) is not supported - gs:// becomes gcs://
        Parameters:
        hiveUrl - The Hive URL
        Returns:
        The URL as understood by Snowflake