| 274 | } |
| 275 | |
| 276 | std::shared_ptr<ColumnEncryptionProperties> |
| 277 | FileEncryptionProperties::column_encryption_properties(const std::string& column_path) { |
| 278 | if (encrypted_columns_.size() == 0) { |
| 279 | return ColumnEncryptionProperties::WithFooterKey(); |
| 280 | } |
| 281 | auto it = encrypted_columns_.find(column_path); |
| 282 | if (it != encrypted_columns_.end()) { |
| 283 | return it->second; |
| 284 | } |
| 285 | |
| 286 | // We do not have an exact match of column_path in encrypted_columns_ |
| 287 | // there might be the root parent field in encrypted_columns_. |
| 288 | auto pos = column_path.find('.'); |
| 289 | if (pos != std::string::npos) { |
| 290 | std::string root = column_path.substr(0, pos); |
| 291 | it = encrypted_columns_.find(root); |
| 292 | if (it != encrypted_columns_.end()) { |
| 293 | return it->second; |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | return nullptr; |
| 298 | } |
| 299 | |
| 300 | FileEncryptionProperties::FileEncryptionProperties( |
| 301 | ParquetCipher::type cipher, SecureString footer_key, std::string footer_key_metadata, |