Class MetastoreUtil


  • public final class MetastoreUtil
    extends Object
    • Method Detail

      • getProtectMode

        public static org.apache.hadoop.hive.metastore.ProtectMode getProtectMode​(Partition partition)
      • getProtectMode

        public static org.apache.hadoop.hive.metastore.ProtectMode getProtectMode​(Table table)
      • isAvroTableWithSchemaSet

        public static boolean isAvroTableWithSchemaSet​(Table table)
      • partitionKeyFilterToStringList

        public static Optional<List<String>> partitionKeyFilterToStringList​(List<String> columnNames,
                                                                            TupleDomain<String> partitionKeysFilter,
                                                                            boolean assumeCanonicalPartitionKeys)
        Parameters:
        assumeCanonicalPartitionKeys - allow conversion of non-char types (eg BIGINT, timestamp) to canonical string formats. If false, non-char types will be replaced with the wildcard
        Returns:
        the domain for each partition key to either the wildcard or an equals check, or empty if TupleDomain.isNone()
      • canConvertSqlTypeToStringForParts

        public static boolean canConvertSqlTypeToStringForParts​(Type type,
                                                                boolean assumeCanonicalPartitionKeys)
      • sqlScalarToStringForParts

        public static String sqlScalarToStringForParts​(Type type,
                                                       Object value,
                                                       boolean assumeCanonicalPartitionKeys,
                                                       String partitionWildcardString)
        Returns:
        canonical string representation of a given value according to its type. If there isn't a valid conversion, returns ""
      • sqlScalarToString

        public static String sqlScalarToString​(Type type,
                                               Object value,
                                               String nullString)
        Returns:
        canonical string representation of a given value according to its type.
        Throws:
        TrinoException - if the type is not supported