Class ThriftMetastoreUtil

java.lang.Object
io.trino.plugin.hive.metastore.thrift.ThriftMetastoreUtil

public final class ThriftMetastoreUtil extends Object
  • Method Details

    • toMetastoreApiDatabase

      public static io.trino.hive.thrift.metastore.Database toMetastoreApiDatabase(Database database)
    • toMetastoreApiTable

      public static io.trino.hive.thrift.metastore.Table toMetastoreApiTable(Table table, PrincipalPrivileges privileges)
    • toMetastoreApiTable

      public static io.trino.hive.thrift.metastore.Table toMetastoreApiTable(Table table)
    • toMetastoreApiPrivilegeGrantInfo

      public static io.trino.hive.thrift.metastore.PrivilegeGrantInfo toMetastoreApiPrivilegeGrantInfo(HivePrivilegeInfo privilegeInfo)
    • listApplicableRoles

      public static Stream<RoleGrant> listApplicableRoles(HivePrincipal principal, Function<HivePrincipal,Set<RoleGrant>> listRoleGrants)
    • isRoleApplicable

      public static boolean isRoleApplicable(HivePrincipal principal, String role, Function<HivePrincipal,Set<RoleGrant>> listRoleGrants)
    • listEnabledPrincipals

      public static Stream<HivePrincipal> listEnabledPrincipals(ConnectorIdentity identity, Function<HivePrincipal,Set<RoleGrant>> listRoleGrants)
    • isRoleEnabled

      public static boolean isRoleEnabled(ConnectorIdentity identity, Function<HivePrincipal,Set<RoleGrant>> listRoleGrants, String role)
    • listEnabledRoles

      public static Stream<String> listEnabledRoles(ConnectorIdentity identity, Function<HivePrincipal,Set<RoleGrant>> listRoleGrants)
    • toMetastoreApiPartition

      public static io.trino.hive.thrift.metastore.Partition toMetastoreApiPartition(PartitionWithStatistics partitionWithStatistics)
    • toMetastoreApiPartition

      public static io.trino.hive.thrift.metastore.Partition toMetastoreApiPartition(Partition partition)
    • toMetastoreApiPartition

      public static io.trino.hive.thrift.metastore.Partition toMetastoreApiPartition(Partition partition, Optional<Long> writeId)
    • fromMetastoreApiDatabase

      public static Database fromMetastoreApiDatabase(io.trino.hive.thrift.metastore.Database database)
    • fromMetastoreApiTable

      public static Table fromMetastoreApiTable(io.trino.hive.thrift.metastore.Table table)
    • fromMetastoreApiTable

      public static Table fromMetastoreApiTable(io.trino.hive.thrift.metastore.Table table, List<io.trino.hive.thrift.metastore.FieldSchema> schema)
    • isAvroTableWithSchemaSet

      public static boolean isAvroTableWithSchemaSet(io.trino.hive.thrift.metastore.Table table)
    • isCsvTable

      public static boolean isCsvTable(io.trino.hive.thrift.metastore.Table table)
    • isCsvPartition

      public static boolean isCsvPartition(io.trino.hive.thrift.metastore.Partition partition)
    • csvSchemaFields

      public static List<io.trino.hive.thrift.metastore.FieldSchema> csvSchemaFields(List<io.trino.hive.thrift.metastore.FieldSchema> schemas)
    • fromMetastoreApiPartition

      public static Partition fromMetastoreApiPartition(io.trino.hive.thrift.metastore.Partition partition)
    • fromMetastoreApiPartition

      public static Partition fromMetastoreApiPartition(io.trino.hive.thrift.metastore.Partition partition, List<io.trino.hive.thrift.metastore.FieldSchema> schema)
    • fromMetastoreApiColumnStatistics

      public static HiveColumnStatistics fromMetastoreApiColumnStatistics(io.trino.hive.thrift.metastore.ColumnStatisticsObj columnStatistics)
    • fromMetastoreNullsCount

      public static OptionalLong fromMetastoreNullsCount(long nullsCount)
      Impala `COMPUTE STATS` will write -1 as the null count.
      See Also:
    • fromRolePrincipalGrants

      public static Set<RoleGrant> fromRolePrincipalGrants(Collection<io.trino.hive.thrift.metastore.RolePrincipalGrant> grants)
    • fromTrinoPrincipalType

      public static io.trino.hive.thrift.metastore.PrincipalType fromTrinoPrincipalType(PrincipalType principalType)
    • fromMetastoreApiPrincipalType

      public static PrincipalType fromMetastoreApiPrincipalType(io.trino.hive.thrift.metastore.PrincipalType principalType)
    • toMetastoreApiFieldSchema

      public static io.trino.hive.thrift.metastore.FieldSchema toMetastoreApiFieldSchema(Column column)
    • parsePrivilege

      public static Set<HivePrivilegeInfo> parsePrivilege(io.trino.hive.thrift.metastore.PrivilegeGrantInfo userGrant, Optional<HivePrincipal> grantee)
    • createMetastoreColumnStatistics

      public static io.trino.hive.thrift.metastore.ColumnStatisticsObj createMetastoreColumnStatistics(String columnName, HiveType columnType, HiveColumnStatistics statistics)
    • toMetastoreDecimal

      public static io.trino.hive.thrift.metastore.Decimal toMetastoreDecimal(BigDecimal decimal)
    • getSupportedColumnStatistics

      public static Set<HiveColumnStatisticType> getSupportedColumnStatistics(Type type)
    • fromMetastoreApiFunction

      public static LanguageFunction fromMetastoreApiFunction(io.trino.hive.thrift.metastore.Function function)
    • toMetastoreApiFunction

      public static io.trino.hive.thrift.metastore.Function toMetastoreApiFunction(String databaseName, String functionName, LanguageFunction function)
    • fromResourceUris

      public static byte[] fromResourceUris(List<io.trino.hive.thrift.metastore.ResourceUri> resourceUris)
    • decodeFunction

      public static LanguageFunction decodeFunction(String name, List<io.trino.hive.thrift.metastore.ResourceUri> uris)
    • toDataOperationType

      public static io.trino.hive.thrift.metastore.DataOperationType toDataOperationType(AcidOperation acidOperation)