@Override
    public HadoopConf buildHadoopConfWithReadOnlyConfig(ReadonlyConfig readonlyConfig) {
        Configuration configuration = loadHiveBaseHadoopConfig(readonlyConfig);
        Config config = fillBucket(readonlyConfig, configuration);
        config =
                config.withValue(
                        S3ConfigOptions.S3A_AWS_CREDENTIALS_PROVIDER.key(),
                        ConfigValueFactory.fromAnyRef(
                                configuration.get(
                                        S3ConfigOptions.S3A_AWS_CREDENTIALS_PROVIDER.key())));
        config =
                config.withValue(
                        S3ConfigOptions.FS_S3A_ENDPOINT.key(),
                        ConfigValueFactory.fromAnyRef(
                                configuration.get(S3ConfigOptions.FS_S3A_ENDPOINT.key())));
        HadoopConf hadoopConf =
                HiveOnS3Conf.buildWithReadOnlyConfig(ReadonlyConfig.fromConfig(config));
        Map<String, String> propsWithPrefix = configuration.getPropsWithPrefix(StringUtils.EMPTY);
        hadoopConf.setExtraOptions(propsWithPrefix);
        return hadoopConf;
    }
@Test
    void fillBucketInHadoopConf() {
        S3Storage s3Storage = new S3Storage();
        HadoopConf s3aConf = s3Storage.buildHadoopConfWithReadOnlyConfig(S3A);
        assertHadoopConfForS3a(s3aConf);

        HadoopConf s3Conf = s3Storage.buildHadoopConfWithReadOnlyConfig(S3);
        Assertions.assertTrue(s3Conf instanceof HiveOnS3Conf);
        Assertions.assertEquals(s3Conf.getSchema(), "s3");
        Assertions.assertEquals(
                s3Conf.getFsHdfsImpl(), "com.amazon.ws.emr.hadoop.fs.EmrFileSystem");
    }