Class ThriftMetastoreUtil
java.lang.Object
io.trino.plugin.hive.metastore.thrift.ThriftMetastoreUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic io.trino.hive.thrift.metastore.ColumnStatisticsObjcreateMetastoreColumnStatistics(String columnName, HiveType columnType, HiveColumnStatistics statistics) static List<io.trino.hive.thrift.metastore.FieldSchema> csvSchemaFields(List<io.trino.hive.thrift.metastore.FieldSchema> schemas) static LanguageFunctiondecodeFunction(String name, List<io.trino.hive.thrift.metastore.ResourceUri> uris) static HiveColumnStatisticsfromMetastoreApiColumnStatistics(io.trino.hive.thrift.metastore.ColumnStatisticsObj columnStatistics) static DatabasefromMetastoreApiDatabase(io.trino.hive.thrift.metastore.Database database) static LanguageFunctionfromMetastoreApiFunction(io.trino.hive.thrift.metastore.Function function) static PartitionfromMetastoreApiPartition(io.trino.hive.thrift.metastore.Partition partition) static PartitionfromMetastoreApiPartition(io.trino.hive.thrift.metastore.Partition partition, List<io.trino.hive.thrift.metastore.FieldSchema> schema) static PrincipalTypefromMetastoreApiPrincipalType(io.trino.hive.thrift.metastore.PrincipalType principalType) static TablefromMetastoreApiTable(io.trino.hive.thrift.metastore.Table table) static TablefromMetastoreApiTable(io.trino.hive.thrift.metastore.Table table, List<io.trino.hive.thrift.metastore.FieldSchema> schema) static OptionalLongfromMetastoreNullsCount(long nullsCount) Impala `COMPUTE STATS` will write -1 as the null count.static byte[]fromResourceUris(List<io.trino.hive.thrift.metastore.ResourceUri> resourceUris) fromRolePrincipalGrants(Collection<io.trino.hive.thrift.metastore.RolePrincipalGrant> grants) static io.trino.hive.thrift.metastore.PrincipalTypefromTrinoPrincipalType(PrincipalType principalType) static Set<HiveColumnStatisticType> static booleanisAvroTableWithSchemaSet(io.trino.hive.thrift.metastore.Table table) static booleanisCsvPartition(io.trino.hive.thrift.metastore.Partition partition) static booleanisCsvTable(io.trino.hive.thrift.metastore.Table table) static booleanisRoleApplicable(HivePrincipal principal, String role, Function<HivePrincipal, Set<RoleGrant>> listRoleGrants) static booleanisRoleEnabled(ConnectorIdentity identity, Function<HivePrincipal, Set<RoleGrant>> listRoleGrants, String role) listApplicableRoles(HivePrincipal principal, Function<HivePrincipal, Set<RoleGrant>> listRoleGrants) static Stream<HivePrincipal> listEnabledPrincipals(ConnectorIdentity identity, Function<HivePrincipal, Set<RoleGrant>> listRoleGrants) listEnabledRoles(ConnectorIdentity identity, Function<HivePrincipal, Set<RoleGrant>> listRoleGrants) static Set<HivePrivilegeInfo> parsePrivilege(io.trino.hive.thrift.metastore.PrivilegeGrantInfo userGrant, Optional<HivePrincipal> grantee) static io.trino.hive.thrift.metastore.DataOperationTypetoDataOperationType(AcidOperation acidOperation) static io.trino.hive.thrift.metastore.DatabasetoMetastoreApiDatabase(Database database) static io.trino.hive.thrift.metastore.FieldSchematoMetastoreApiFieldSchema(Column column) static io.trino.hive.thrift.metastore.FunctiontoMetastoreApiFunction(String databaseName, String functionName, LanguageFunction function) static io.trino.hive.thrift.metastore.PartitiontoMetastoreApiPartition(Partition partition) static io.trino.hive.thrift.metastore.PartitiontoMetastoreApiPartition(Partition partition, Optional<Long> writeId) static io.trino.hive.thrift.metastore.PartitiontoMetastoreApiPartition(PartitionWithStatistics partitionWithStatistics) static io.trino.hive.thrift.metastore.PrivilegeGrantInfotoMetastoreApiPrivilegeGrantInfo(HivePrivilegeInfo privilegeInfo) static io.trino.hive.thrift.metastore.TabletoMetastoreApiTable(Table table) static io.trino.hive.thrift.metastore.TabletoMetastoreApiTable(Table table, PrincipalPrivileges privileges) static io.trino.hive.thrift.metastore.DecimaltoMetastoreDecimal(BigDecimal decimal)
-
Method Details
-
toMetastoreApiDatabase
-
toMetastoreApiTable
public static io.trino.hive.thrift.metastore.Table toMetastoreApiTable(Table table, PrincipalPrivileges privileges) -
toMetastoreApiTable
-
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
-
toMetastoreApiPartition
-
fromMetastoreApiDatabase
-
fromMetastoreApiTable
-
fromMetastoreApiTable
-
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
-
fromMetastoreApiPartition
public static Partition fromMetastoreApiPartition(io.trino.hive.thrift.metastore.Partition partition) -
fromMetastoreApiPartition
-
fromMetastoreApiColumnStatistics
public static HiveColumnStatistics fromMetastoreApiColumnStatistics(io.trino.hive.thrift.metastore.ColumnStatisticsObj columnStatistics) -
fromMetastoreNullsCount
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
-
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
-
getSupportedColumnStatistics
-
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)
-