use of com.facebook.presto.hive.HiveTableProperties.DWRF_ENCRYPTION_PROVIDER in project presto by prestodb.
the class HiveMetadata method getDwrfTableEncryptionProperties.
private static DwrfTableEncryptionProperties getDwrfTableEncryptionProperties(Optional<String> encryptTable, Optional<ColumnEncryptionInformation> columnEncryptionInformation, ConnectorTableMetadata tableMetadata) {
String encryptionAlgorithm = getDwrfEncryptionAlgorithm(tableMetadata.getProperties());
String encryptionProvider = getDwrfEncryptionProvider(tableMetadata.getProperties());
if (encryptionAlgorithm == null) {
throw new PrestoException(INVALID_TABLE_PROPERTY, format("%s needs to be provided for DWRF encrypted tables", DWRF_ENCRYPTION_ALGORITHM));
}
if (encryptionProvider == null) {
throw new PrestoException(INVALID_TABLE_PROPERTY, format("%s needs to be provided for DWRF encrypted tables", DWRF_ENCRYPTION_PROVIDER));
}
return encryptTable.map(s -> forTable(s, encryptionAlgorithm, encryptionProvider)).orElseGet(() -> forPerColumn(columnEncryptionInformation.orElseThrow(() -> new PrestoException(GENERIC_INTERNAL_ERROR, "columnEncryptionInformation cannot be empty")), encryptionAlgorithm, encryptionProvider));
}
Aggregations