test_class.file: herd-code/herd-service/src/test/java/org/finra/herd/service/helper/Hive13DdlGeneratorTest.java
test_class.identifier: Hive13DdlGeneratorTest
test_class.superclass: extends AbstractServiceTest
test_case.body: @Test
      public void testGetHivePartitionEmptyPartitions()
      {
          List<SchemaColumn> autoDiscoverableSubPartitionColumns;
          List<String> storageFilePaths;
          List<HivePartitionDto> expectedHivePartitions;
          List<HivePartitionDto> resultHivePartitions;
  
          // Create a business object data key without any sub-partitions.
          BusinessObjectDataKey businessObjectDataKey =
              new BusinessObjectDataKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, NO_SUBPARTITION_VALUES,
                  DATA_VERSION);
  
          // No auto-discoverable sub-partition columns with empty partition represented by "/".
          autoDiscoverableSubPartitionColumns = new ArrayList<>();
          storageFilePaths = getStorageFilePaths(Collections.singletonList("/"));
          expectedHivePartitions =
              Collections.singletonList(HivePartitionDto.builder().withPath("").withPartitionValues(Collections.singletonList(PARTITION_VALUE)).build());
          resultHivePartitions = hive13DdlGenerator
              .getHivePartitions(businessObjectDataKey, autoDiscoverableSubPartitionColumns, TEST_S3_KEY_PREFIX, storageFilePaths, STORAGE_NAME);
          assertEquals(expectedHivePartitions, resultHivePartitions);
  
          // No auto-discoverable sub-partition columns with empty partition represented by "_$folder$".
          autoDiscoverableSubPartitionColumns = new ArrayList<>();
          storageFilePaths = getStorageFilePaths(Collections.singletonList("_$folder$"));
          expectedHivePartitions =
              Collections.singletonList(HivePartitionDto.builder().withPath("").withPartitionValues(Collections.singletonList(PARTITION_VALUE)).build());
          resultHivePartitions = hive13DdlGenerator
              .getHivePartitions(businessObjectDataKey, autoDiscoverableSubPartitionColumns, TEST_S3_KEY_PREFIX, storageFilePaths, STORAGE_NAME);
          assertEquals(expectedHivePartitions, resultHivePartitions);
  
          // Single sub-partition column with empty partition represented by "/".
          autoDiscoverableSubPartitionColumns = getPartitionColumns(Collections.singletonList("column1"));
          storageFilePaths = getStorageFilePaths(Collections.singletonList("/column1=aa/"));
          expectedHivePartitions =
              Collections.singletonList(HivePartitionDto.builder().withPath("/column1=aa").withPartitionValues(Arrays.asList(PARTITION_VALUE, "aa")).build());
          resultHivePartitions = hive13DdlGenerator
              .getHivePartitions(businessObjectDataKey, autoDiscoverableSubPartitionColumns, TEST_S3_KEY_PREFIX, storageFilePaths, STORAGE_NAME);
          assertEquals(expectedHivePartitions, resultHivePartitions);
  
          // Single sub-partition column with empty partition represented by "_$folder$".
          autoDiscoverableSubPartitionColumns = getPartitionColumns(Collections.singletonList("column1"));
          storageFilePaths = getStorageFilePaths(Collections.singletonList("/column1=aa_$folder$"));
          expectedHivePartitions =
              Collections.singletonList(HivePartitionDto.builder().withPath("/column1=aa").withPartitionValues(Arrays.asList(PARTITION_VALUE, "aa")).build());
          resultHivePartitions = hive13DdlGenerator
              .getHivePartitions(businessObjectDataKey, autoDiscoverableSubPartitionColumns, TEST_S3_KEY_PREFIX, storageFilePaths, STORAGE_NAME);
          assertEquals(expectedHivePartitions, resultHivePartitions);
  
          // Two sub-partition columns with empty partition represented by "/".
          autoDiscoverableSubPartitionColumns = getPartitionColumns(Arrays.asList("Column1", "column2"));
          storageFilePaths = getStorageFilePaths(Collections.singletonList("/column1=aa/column2=bb/"));
          expectedHivePartitions = Collections.singletonList(
              HivePartitionDto.builder().withPath("/column1=aa/column2=bb").withPartitionValues(Arrays.asList(PARTITION_VALUE, "aa", "bb")).build());
          resultHivePartitions = hive13DdlGenerator
              .getHivePartitions(businessObjectDataKey, autoDiscoverableSubPartitionColumns, TEST_S3_KEY_PREFIX, storageFilePaths, STORAGE_NAME);
          assertEquals(expectedHivePartitions, resultHivePartitions);
  
          // Two sub-partition columns with empty partition represented by "_$folder$".
          autoDiscoverableSubPartitionColumns = getPartitionColumns(Arrays.asList("Column1", "column2"));
          storageFilePaths = getStorageFilePaths(Collections.singletonList("/column1=aa/column2=bb_$folder$"));
          expectedHivePartitions = Collections.singletonList(
              HivePartitionDto.builder().withPath("/column1=aa/column2=bb").withPartitionValues(Arrays.asList(PARTITION_VALUE, "aa", "bb")).build());
          resultHivePartitions = hive13DdlGenerator
              .getHivePartitions(businessObjectDataKey, autoDiscoverableSubPartitionColumns, TEST_S3_KEY_PREFIX, storageFilePaths, STORAGE_NAME);
          assertEquals(expectedHivePartitions, resultHivePartitions);
  
          // Two sub-partition columns with empty partition represented by "/" and with data files present.
          autoDiscoverableSubPartitionColumns = getPartitionColumns(Arrays.asList("Column1", "column2"));
          storageFilePaths = getStorageFilePaths(Arrays.asList("/column1=aa/column2=bb/", "/column1=aa/column2=bb/file.dat"));
          expectedHivePartitions = Collections.singletonList(
              HivePartitionDto.builder().withPath("/column1=aa/column2=bb").withPartitionValues(Arrays.asList(PARTITION_VALUE, "aa", "bb")).build());
          resultHivePartitions = hive13DdlGenerator
              .getHivePartitions(businessObjectDataKey, autoDiscoverableSubPartitionColumns, TEST_S3_KEY_PREFIX, storageFilePaths, STORAGE_NAME);
          assertEquals(expectedHivePartitions, resultHivePartitions);
  
          // Two sub-partition columns with empty partition represented by "_$folder$" and with data files present.
          autoDiscoverableSubPartitionColumns = getPartitionColumns(Arrays.asList("Column1", "column2"));
          storageFilePaths = getStorageFilePaths(Arrays.asList("/column1=aa/column2=bb_$folder$", "/column1=aa/column2=bb/file.dat"));
          expectedHivePartitions = Collections.singletonList(
              HivePartitionDto.builder().withPath("/column1=aa/column2=bb").withPartitionValues(Arrays.asList(PARTITION_VALUE, "aa", "bb")).build());
          resultHivePartitions = hive13DdlGenerator
              .getHivePartitions(businessObjectDataKey, autoDiscoverableSubPartitionColumns, TEST_S3_KEY_PREFIX, storageFilePaths, STORAGE_NAME);
          assertEquals(expectedHivePartitions, resultHivePartitions);
  
          // Maximum supported number of sub-partition columns with empty folders present on every level and with data files present at the last sub-partition.
          // Different partition values are used to validate discovery logic for the fully qualified partitions.
          // There are also the following two special cases added:
          // - sub-partitions added that contain empty folder marker as a sub-partition value, which is allowed
          // - sub-partitions with data files that start, contain, and/or end with an empty folder marker
          autoDiscoverableSubPartitionColumns = getPartitionColumns(Arrays.asList("Column_1", "Column_2", "Column_3", "Column_4"));
          storageFilePaths = getStorageFilePaths(Arrays.asList("/",                       // an empty folder for the primary partition
              "_$folder$",                                                                // an empty folder for the primary partition
              "/column_1=a01/",                                                           // an empty folder for the first sub-partition
              "/column_1=a02_$folder$",                                                   // an empty folder for the first sub-partition
              "/column_1=a03/column-2=b01/",                                              // an empty folder for the second sub-partition
              "/column_1=a04/column-2=b02_$folder$",                                      // an empty folder for the second sub-partition
              "/column_1=a05/column-2=b03/COLUMN_3=c01/",                                 // an empty folder for the third sub-partition
              "/column_1=a06/column-2=b04/COLUMN_3=c02_$folder$",                         // an empty folder for the third sub-partition
              "/column_1=a07/column-2=b05/COLUMN_3=c03/COLUMN-4=d01/",                    // an empty folder for the forth sub-partition
              "/column_1=a08/column-2=b06/COLUMN_3=c04/COLUMN-4=d02_$folder$",            // an empty folder for the forth sub-partition
              "/column_1=a09/column-2=b07/COLUMN_3=c05/COLUMN-4=d03/file.dat",            // a data file present in the forth sub-partition
              "/column_1=a10/column-2=b08/COLUMN_3=c06/COLUMN-4=d04_$folder$/",           // a sub-partition value is an empty folder marker
              "/column_1=a11/column-2=b09/COLUMN_3=c07/COLUMN-4=d05_$folder$/file.dat",   // a sub-partition value is an empty folder marker
              "/column_1=a12/column-2=b10/COLUMN_3=c08/COLUMN-4=d06/_$folder$file.dat",   // data file name starts an empty folder marker
              "/column_1=a13/column-2=b11/COLUMN_3=c09/COLUMN-4=d07/file_$folder$.dat",   // data file name contains an empty folder marker
              "/column_1=a14/column-2=b12/COLUMN_3=c10/COLUMN-4=d08/file.dat_$folder$",   // data file name ends with an empty folder marker
              "/column_1=a15/column-2=b13/COLUMN_3=c11/COLUMN-4=d09/_$folder$"            // data file name is an empty folder marker
          ));
          expectedHivePartitions = Arrays.asList(HivePartitionDto.builder().withPath("/column_1=a07/column-2=b05/COLUMN_3=c03/COLUMN-4=d01")
                  .withPartitionValues(Arrays.asList(PARTITION_VALUE, "a07", "b05", "c03", "d01")).build(),
              HivePartitionDto.builder().withPath("/column_1=a08/column-2=b06/COLUMN_3=c04/COLUMN-4=d02")
                  .withPartitionValues(Arrays.asList(PARTITION_VALUE, "a08", "b06", "c04", "d02")).build(),
              HivePartitionDto.builder().withPath("/column_1=a09/column-2=b07/COLUMN_3=c05/COLUMN-4=d03")
                  .withPartitionValues(Arrays.asList(PARTITION_VALUE, "a09", "b07", "c05", "d03")).build(),
              HivePartitionDto.builder().withPath("/column_1=a10/column-2=b08/COLUMN_3=c06/COLUMN-4=d04_$folder$")
                  .withPartitionValues(Arrays.asList(PARTITION_VALUE, "a10", "b08", "c06", "d04_$folder$")).build(),
              HivePartitionDto.builder().withPath("/column_1=a11/column-2=b09/COLUMN_3=c07/COLUMN-4=d05_$folder$")
                  .withPartitionValues(Arrays.asList(PARTITION_VALUE, "a11", "b09", "c07", "d05_$folder$")).build(),
              HivePartitionDto.builder().withPath("/column_1=a12/column-2=b10/COLUMN_3=c08/COLUMN-4=d06")
                  .withPartitionValues(Arrays.asList(PARTITION_VALUE, "a12", "b10", "c08", "d06")).build(),
              HivePartitionDto.builder().withPath("/column_1=a13/column-2=b11/COLUMN_3=c09/COLUMN-4=d07")
                  .withPartitionValues(Arrays.asList(PARTITION_VALUE, "a13", "b11", "c09", "d07")).build(),
              HivePartitionDto.builder().withPath("/column_1=a14/column-2=b12/COLUMN_3=c10/COLUMN-4=d08")
                  .withPartitionValues(Arrays.asList(PARTITION_VALUE, "a14", "b12", "c10", "d08")).build(),
              HivePartitionDto.builder().withPath("/column_1=a15/column-2=b13/COLUMN_3=c11/COLUMN-4=d09")
                  .withPartitionValues(Arrays.asList(PARTITION_VALUE, "a15", "b13", "c11", "d09")).build());
          resultHivePartitions = hive13DdlGenerator
              .getHivePartitions(businessObjectDataKey, autoDiscoverableSubPartitionColumns, TEST_S3_KEY_PREFIX, storageFilePaths, STORAGE_NAME);
          assertEquals(expectedHivePartitions, resultHivePartitions);
      }
test_case.class_method_signature: Hive13DdlGeneratorTest.testGetHivePartitionEmptyPartitions()
test_case.full_signature: @Test public void testGetHivePartitionEmptyPartitions()
test_case.identifier: testGetHivePartitionEmptyPartitions
test_case.invocations: getStorageFilePaths singletonList singletonList build withPartitionValues withPath builder singletonList getHivePartitions assertEquals getStorageFilePaths singletonList singletonList build withPartitionValues withPath builder singletonList getHivePartitions assertEquals getPartitionColumns singletonList getStorageFilePaths singletonList singletonList build withPartitionValues withPath builder asList getHivePartitions assertEquals getPartitionColumns singletonList getStorageFilePaths singletonList singletonList build withPartitionValues withPath builder asList getHivePartitions assertEquals getPartitionColumns asList getStorageFilePaths singletonList singletonList build withPartitionValues withPath builder asList getHivePartitions assertEquals getPartitionColumns asList getStorageFilePaths singletonList singletonList build withPartitionValues withPath builder asList getHivePartitions assertEquals getPartitionColumns asList getStorageFilePaths asList singletonList build withPartitionValues withPath builder asList getHivePartitions assertEquals getPartitionColumns asList getStorageFilePaths asList singletonList build withPartitionValues withPath builder asList getHivePartitions assertEquals getPartitionColumns asList getStorageFilePaths asList asList build withPartitionValues withPath builder asList build withPartitionValues withPath builder asList build withPartitionValues withPath builder asList build withPartitionValues withPath builder asList build withPartitionValues withPath builder asList build withPartitionValues withPath builder asList build withPartitionValues withPath builder asList build withPartitionValues withPath builder asList build withPartitionValues withPath builder asList getHivePartitions assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetHivePartitionEmptyPartitions()
focal_class.declarator: NO_PARTITIONING_PARTITION_KEY = "partition"
focal_class.modifier: public static final
focal_class.original_string: public static final String NO_PARTITIONING_PARTITION_KEY = "partition";
focal_class.type: String
focal_class.var_name: NO_PARTITIONING_PARTITION_KEY
focal_class.declarator: NO_PARTITIONING_PARTITION_VALUE = "none"
focal_class.modifier: public static final
focal_class.original_string: public static final String NO_PARTITIONING_PARTITION_VALUE = "none";
focal_class.type: String
focal_class.var_name: NO_PARTITIONING_PARTITION_VALUE
focal_class.declarator: ORC_HIVE_FILE_FORMAT = "ORC"
focal_class.modifier: public static final
focal_class.original_string: public static final String ORC_HIVE_FILE_FORMAT = "ORC";
focal_class.type: String
focal_class.var_name: ORC_HIVE_FILE_FORMAT
focal_class.declarator: PARQUET_HIVE_FILE_FORMAT = "PARQUET"
focal_class.modifier: public static final
focal_class.original_string: public static final String PARQUET_HIVE_FILE_FORMAT = "PARQUET";
focal_class.type: String
focal_class.var_name: PARQUET_HIVE_FILE_FORMAT
focal_class.declarator: TEXT_HIVE_FILE_FORMAT = "TEXTFILE"
focal_class.modifier: public static final
focal_class.original_string: public static final String TEXT_HIVE_FILE_FORMAT = "TEXTFILE";
focal_class.type: String
focal_class.var_name: TEXT_HIVE_FILE_FORMAT
focal_class.declarator: JSON_HIVE_FILE_FORMAT = "JSONFILE"
focal_class.modifier: public static final
focal_class.original_string: public static final String JSON_HIVE_FILE_FORMAT = "JSONFILE";
focal_class.type: String
focal_class.var_name: JSON_HIVE_FILE_FORMAT
focal_class.declarator: REGEX_S3_EMPTY_PARTITION = "_\\$folder\\$"
focal_class.modifier: public static final
focal_class.original_string: public static final String REGEX_S3_EMPTY_PARTITION = "_\\$folder\\$";
focal_class.type: String
focal_class.var_name: REGEX_S3_EMPTY_PARTITION
focal_class.declarator: HIVE_COMPLEX_DATA_TYPES =
          Arrays.asList(Category.LIST.toString(), Category.MAP.toString(), Category.UNION.toString(), Category.STRUCT.toString())
focal_class.modifier: private static final
focal_class.original_string: private static final List<String> HIVE_COMPLEX_DATA_TYPES =
          Arrays.asList(Category.LIST.toString(), Category.MAP.toString(), Category.UNION.toString(), Category.STRUCT.toString());
focal_class.type: List<String>
focal_class.var_name: HIVE_COMPLEX_DATA_TYPES
focal_class.declarator: businessObjectDataDdlPartitionsHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BusinessObjectDataDdlPartitionsHelper businessObjectDataDdlPartitionsHelper;
focal_class.type: BusinessObjectDataDdlPartitionsHelper
focal_class.var_name: businessObjectDataDdlPartitionsHelper
focal_class.declarator: businessObjectDataHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BusinessObjectDataHelper businessObjectDataHelper;
focal_class.type: BusinessObjectDataHelper
focal_class.var_name: businessObjectDataHelper
focal_class.declarator: businessObjectFormatHelper
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private BusinessObjectFormatHelper businessObjectFormatHelper;
focal_class.type: BusinessObjectFormatHelper
focal_class.var_name: businessObjectFormatHelper
focal_class.file: herd-code/herd-service/src/main/java/org/finra/herd/service/helper/Hive13DdlGenerator.java
focal_class.identifier: Hive13DdlGenerator
focal_class.class_method_signature: Hive13DdlGenerator.escapeSingleQuotes(String string)
focal_class.full_signature: public String escapeSingleQuotes(String string)
focal_class.identifier: escapeSingleQuotes
focal_class.modifiers: public
focal_class.parameters: (String string)
focal_class.return: String
focal_class.signature: String escapeSingleQuotes(String string)
focal_class.class_method_signature: Hive13DdlGenerator.generateCreateTableDdl(BusinessObjectDataDdlRequest request, BusinessObjectFormatEntity businessObjectFormatEntity,
          CustomDdlEntity customDdlEntity, List<String> storageNames, List<StorageEntity> requestedStorageEntities,
          Map<String, StorageEntity> cachedStorageEntities, Map<String, String> cachedS3BucketNames)
focal_class.full_signature: @Override public String generateCreateTableDdl(BusinessObjectDataDdlRequest request, BusinessObjectFormatEntity businessObjectFormatEntity,
          CustomDdlEntity customDdlEntity, List<String> storageNames, List<StorageEntity> requestedStorageEntities,
          Map<String, StorageEntity> cachedStorageEntities, Map<String, String> cachedS3BucketNames)
focal_class.identifier: generateCreateTableDdl
focal_class.modifiers: @Override public
focal_class.parameters: (BusinessObjectDataDdlRequest request, BusinessObjectFormatEntity businessObjectFormatEntity,
          CustomDdlEntity customDdlEntity, List<String> storageNames, List<StorageEntity> requestedStorageEntities,
          Map<String, StorageEntity> cachedStorageEntities, Map<String, String> cachedS3BucketNames)
focal_class.return: String
focal_class.signature: String generateCreateTableDdl(BusinessObjectDataDdlRequest request, BusinessObjectFormatEntity businessObjectFormatEntity,
          CustomDdlEntity customDdlEntity, List<String> storageNames, List<StorageEntity> requestedStorageEntities,
          Map<String, StorageEntity> cachedStorageEntities, Map<String, String> cachedS3BucketNames)
focal_class.class_method_signature: Hive13DdlGenerator.generateCreateTableDdl(BusinessObjectFormatDdlRequest request, BusinessObjectFormatEntity businessObjectFormatEntity,
          CustomDdlEntity customDdlEntity)
focal_class.full_signature: @Override public String generateCreateTableDdl(BusinessObjectFormatDdlRequest request, BusinessObjectFormatEntity businessObjectFormatEntity,
          CustomDdlEntity customDdlEntity)
focal_class.identifier: generateCreateTableDdl
focal_class.modifiers: @Override public
focal_class.parameters: (BusinessObjectFormatDdlRequest request, BusinessObjectFormatEntity businessObjectFormatEntity,
          CustomDdlEntity customDdlEntity)
focal_class.return: String
focal_class.signature: String generateCreateTableDdl(BusinessObjectFormatDdlRequest request, BusinessObjectFormatEntity businessObjectFormatEntity,
          CustomDdlEntity customDdlEntity)
focal_class.class_method_signature: Hive13DdlGenerator.generateReplaceColumnsStatement(BusinessObjectFormatDdlRequest request, BusinessObjectFormatEntity businessObjectFormatEntity)
focal_class.full_signature: @Override public String generateReplaceColumnsStatement(BusinessObjectFormatDdlRequest request, BusinessObjectFormatEntity businessObjectFormatEntity)
focal_class.identifier: generateReplaceColumnsStatement
focal_class.modifiers: @Override public
focal_class.parameters: (BusinessObjectFormatDdlRequest request, BusinessObjectFormatEntity businessObjectFormatEntity)
focal_class.return: String
focal_class.signature: String generateReplaceColumnsStatement(BusinessObjectFormatDdlRequest request, BusinessObjectFormatEntity businessObjectFormatEntity)
focal_class.class_method_signature: Hive13DdlGenerator.getDdlCharacterValue(String string)
focal_class.full_signature: public String getDdlCharacterValue(String string)
focal_class.identifier: getDdlCharacterValue
focal_class.modifiers: public
focal_class.parameters: (String string)
focal_class.return: String
focal_class.signature: String getDdlCharacterValue(String string)
focal_class.class_method_signature: Hive13DdlGenerator.getDdlCharacterValue(String string, boolean escapeSingleBackslash)
focal_class.full_signature: public String getDdlCharacterValue(String string, boolean escapeSingleBackslash)
focal_class.identifier: getDdlCharacterValue
focal_class.modifiers: public
focal_class.parameters: (String string, boolean escapeSingleBackslash)
focal_class.return: String
focal_class.signature: String getDdlCharacterValue(String string, boolean escapeSingleBackslash)
focal_class.class_method_signature: Hive13DdlGenerator.getDdlOutputFormat()
focal_class.full_signature: @Override public BusinessObjectDataDdlOutputFormatEnum getDdlOutputFormat()
focal_class.identifier: getDdlOutputFormat
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: BusinessObjectDataDdlOutputFormatEnum
focal_class.signature: BusinessObjectDataDdlOutputFormatEnum getDdlOutputFormat()
focal_class.class_method_signature: Hive13DdlGenerator.getHivePartitions(BusinessObjectDataKey businessObjectDataKey, List<SchemaColumn> autoDiscoverableSubPartitionColumns,
          String s3KeyPrefix, Collection<String> storageFiles, String storageName)
focal_class.full_signature: public List<HivePartitionDto> getHivePartitions(BusinessObjectDataKey businessObjectDataKey, List<SchemaColumn> autoDiscoverableSubPartitionColumns,
          String s3KeyPrefix, Collection<String> storageFiles, String storageName)
focal_class.identifier: getHivePartitions
focal_class.modifiers: public
focal_class.parameters: (BusinessObjectDataKey businessObjectDataKey, List<SchemaColumn> autoDiscoverableSubPartitionColumns,
          String s3KeyPrefix, Collection<String> storageFiles, String storageName)
focal_class.return: List<HivePartitionDto>
focal_class.signature: List<HivePartitionDto> getHivePartitions(BusinessObjectDataKey businessObjectDataKey, List<SchemaColumn> autoDiscoverableSubPartitionColumns,
          String s3KeyPrefix, Collection<String> storageFiles, String storageName)
focal_class.class_method_signature: Hive13DdlGenerator.getHivePathPattern(List<SchemaColumn> partitionColumns)
focal_class.full_signature: public Pattern getHivePathPattern(List<SchemaColumn> partitionColumns)
focal_class.identifier: getHivePathPattern
focal_class.modifiers: public
focal_class.parameters: (List<SchemaColumn> partitionColumns)
focal_class.return: Pattern
focal_class.signature: Pattern getHivePathPattern(List<SchemaColumn> partitionColumns)
focal_class.class_method_signature: Hive13DdlGenerator.getHivePathRegex(List<SchemaColumn> partitionColumns)
focal_class.full_signature: public String getHivePathRegex(List<SchemaColumn> partitionColumns)
focal_class.identifier: getHivePathRegex
focal_class.modifiers: public
focal_class.parameters: (List<SchemaColumn> partitionColumns)
focal_class.return: String
focal_class.signature: String getHivePathRegex(List<SchemaColumn> partitionColumns)
focal_class.class_method_signature: Hive13DdlGenerator.assertSchemaColumnsNotEmpty(BusinessObjectFormat businessObjectFormat, BusinessObjectFormatEntity businessObjectFormatEntity)
focal_class.full_signature: private void assertSchemaColumnsNotEmpty(BusinessObjectFormat businessObjectFormat, BusinessObjectFormatEntity businessObjectFormatEntity)
focal_class.identifier: assertSchemaColumnsNotEmpty
focal_class.modifiers: private
focal_class.parameters: (BusinessObjectFormat businessObjectFormat, BusinessObjectFormatEntity businessObjectFormatEntity)
focal_class.return: void
focal_class.signature: void assertSchemaColumnsNotEmpty(BusinessObjectFormat businessObjectFormat, BusinessObjectFormatEntity businessObjectFormatEntity)
focal_class.class_method_signature: Hive13DdlGenerator.generateCreateTableDdlHelper(BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper generateDdlRequest)
focal_class.full_signature: private String generateCreateTableDdlHelper(BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper generateDdlRequest)
focal_class.identifier: generateCreateTableDdlHelper
focal_class.modifiers: private
focal_class.parameters: (BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper generateDdlRequest)
focal_class.return: String
focal_class.signature: String generateCreateTableDdlHelper(BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper generateDdlRequest)
focal_class.class_method_signature: Hive13DdlGenerator.generateDdlColumns(BusinessObjectFormatEntity businessObjectFormatEntity, BusinessObjectFormat businessObjectFormat)
focal_class.full_signature: private String generateDdlColumns(BusinessObjectFormatEntity businessObjectFormatEntity, BusinessObjectFormat businessObjectFormat)
focal_class.identifier: generateDdlColumns
focal_class.modifiers: private
focal_class.parameters: (BusinessObjectFormatEntity businessObjectFormatEntity, BusinessObjectFormat businessObjectFormat)
focal_class.return: String
focal_class.signature: String generateDdlColumns(BusinessObjectFormatEntity businessObjectFormatEntity, BusinessObjectFormat businessObjectFormat)
focal_class.class_method_signature: Hive13DdlGenerator.generateStandardBaseDdl(BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper generateDdlRequest, StringBuilder sb,
          BusinessObjectFormat businessObjectFormat, String ifNotExistsOption)
focal_class.full_signature: private void generateStandardBaseDdl(BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper generateDdlRequest, StringBuilder sb,
          BusinessObjectFormat businessObjectFormat, String ifNotExistsOption)
focal_class.identifier: generateStandardBaseDdl
focal_class.modifiers: private
focal_class.parameters: (BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper generateDdlRequest, StringBuilder sb,
          BusinessObjectFormat businessObjectFormat, String ifNotExistsOption)
focal_class.return: void
focal_class.signature: void generateStandardBaseDdl(BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper generateDdlRequest, StringBuilder sb,
          BusinessObjectFormat businessObjectFormat, String ifNotExistsOption)
focal_class.class_method_signature: Hive13DdlGenerator.getHiveDataType(SchemaColumn schemaColumn, BusinessObjectFormatEntity businessObjectFormatEntity)
focal_class.full_signature: private String getHiveDataType(SchemaColumn schemaColumn, BusinessObjectFormatEntity businessObjectFormatEntity)
focal_class.identifier: getHiveDataType
focal_class.modifiers: private
focal_class.parameters: (SchemaColumn schemaColumn, BusinessObjectFormatEntity businessObjectFormatEntity)
focal_class.return: String
focal_class.signature: String getHiveDataType(SchemaColumn schemaColumn, BusinessObjectFormatEntity businessObjectFormatEntity)
focal_class.class_method_signature: Hive13DdlGenerator.isHiveComplexDataType(String inputString)
focal_class.full_signature: private boolean isHiveComplexDataType(String inputString)
focal_class.identifier: isHiveComplexDataType
focal_class.modifiers: private
focal_class.parameters: (String inputString)
focal_class.return: boolean
focal_class.signature: boolean isHiveComplexDataType(String inputString)
focal_class.class_method_signature: Hive13DdlGenerator.getHiveFileFormat(BusinessObjectFormatEntity businessObjectFormatEntity)
focal_class.full_signature: private String getHiveFileFormat(BusinessObjectFormatEntity businessObjectFormatEntity)
focal_class.identifier: getHiveFileFormat
focal_class.modifiers: private
focal_class.parameters: (BusinessObjectFormatEntity businessObjectFormatEntity)
focal_class.return: String
focal_class.signature: String getHiveFileFormat(BusinessObjectFormatEntity businessObjectFormatEntity)
focal_class.class_method_signature: Hive13DdlGenerator.processPartitionFiltersForGenerateDdl(BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper generateDdlRequest, StringBuilder sb,
          HashMap<String, String> replacements, BusinessObjectFormat businessObjectFormat, String ifNotExistsOption)
focal_class.full_signature: private void processPartitionFiltersForGenerateDdl(BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper generateDdlRequest, StringBuilder sb,
          HashMap<String, String> replacements, BusinessObjectFormat businessObjectFormat, String ifNotExistsOption)
focal_class.identifier: processPartitionFiltersForGenerateDdl
focal_class.modifiers: private
focal_class.parameters: (BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper generateDdlRequest, StringBuilder sb,
          HashMap<String, String> replacements, BusinessObjectFormat businessObjectFormat, String ifNotExistsOption)
focal_class.return: void
focal_class.signature: void processPartitionFiltersForGenerateDdl(BusinessObjectDataDdlPartitionsHelper.GenerateDdlRequestWrapper generateDdlRequest, StringBuilder sb,
          HashMap<String, String> replacements, BusinessObjectFormat businessObjectFormat, String ifNotExistsOption)
focal_class.superclass: extends DdlGenerator
focal_method.body: public List<HivePartitionDto> getHivePartitions(BusinessObjectDataKey businessObjectDataKey, List<SchemaColumn> autoDiscoverableSubPartitionColumns,
          String s3KeyPrefix, Collection<String> storageFiles, String storageName)
      {
          // We are using linked hash map to preserve the order of the discovered partitions.
          LinkedHashMap<List<String>, HivePartitionDto> linkedHashMap = new LinkedHashMap<>();
  
          Pattern pattern = getHivePathPattern(autoDiscoverableSubPartitionColumns);
          for (String storageFile : storageFiles)
          {
              // Remove S3 key prefix from the file path. Please note that the storage files are already validated to start with S3 key prefix.
              String relativeFilePath = storageFile.substring(s3KeyPrefix.length());
  
              // Try to match the relative file path to the expected subpartition folders.
              Matcher matcher = pattern.matcher(relativeFilePath);
              Assert.isTrue(matcher.matches(), String.format("Registered storage file or directory does not match the expected Hive sub-directory pattern. " +
                      "Storage: {%s}, file/directory: {%s}, business object data: {%s}, S3 key prefix: {%s}, pattern: {%s}", storageName, storageFile,
                  businessObjectDataHelper.businessObjectDataKeyToString(businessObjectDataKey), s3KeyPrefix, pattern.pattern()));
  
              // Create a list of partition values.
              List<String> partitionValues = new ArrayList<>();
  
              // Add partition values per business object data key.
              partitionValues.add(businessObjectDataKey.getPartitionValue());
              partitionValues.addAll(businessObjectDataKey.getSubPartitionValues());
  
              // Extract relative partition values.
              for (int i = 1; i <= matcher.groupCount() - 1; i++)
              {
                  partitionValues.add(matcher.group(i));
              }
  
              // Get the matched trailing folder markers and an optional file name.
              String partitionPathTrailingPart = matcher.group(matcher.groupCount());
  
              // If we did not match all expected partition values along with the trailing folder markers and an optional file name, then this storage file
              // path is not part of a fully qualified partition (this is an intermediate folder marker) and we ignore it.
              if (!partitionValues.contains(null))
              {
                  // Get path for this partition by removing trailing "/" followed by an optional file name or "_$folder$" which represents an empty folder in S3.
                  String partitionPath = relativeFilePath.substring(0, relativeFilePath.length() - StringUtils.length(partitionPathTrailingPart));
  
                  // Check if we already have that partition discovered - that would happen if partition contains multiple data files.
                  HivePartitionDto hivePartition = linkedHashMap.get(partitionValues);
  
                  if (hivePartition != null)
                  {
                      // Partition is already discovered, so just validate that the relative paths match.
                      Assert.isTrue(hivePartition.getPath().equals(partitionPath), String.format(
                          "Found two different locations for the same Hive partition. Storage: {%s}, business object data: {%s}, " +
                              "S3 key prefix: {%s}, path[1]: {%s}, path[2]: {%s}", storageName,
                          businessObjectDataHelper.businessObjectDataKeyToString(businessObjectDataKey), s3KeyPrefix, hivePartition.getPath(), partitionPath));
                  }
                  else
                  {
                      // Add this partition to the hash map of discovered partitions.
                      linkedHashMap.put(partitionValues, new HivePartitionDto(partitionPath, partitionValues));
                  }
              }
          }
  
          List<HivePartitionDto> hivePartitions = new ArrayList<>();
          hivePartitions.addAll(linkedHashMap.values());
  
          return hivePartitions;
      }
focal_method.class_method_signature: Hive13DdlGenerator.getHivePartitions(BusinessObjectDataKey businessObjectDataKey, List<SchemaColumn> autoDiscoverableSubPartitionColumns,
          String s3KeyPrefix, Collection<String> storageFiles, String storageName)
focal_method.full_signature: public List<HivePartitionDto> getHivePartitions(BusinessObjectDataKey businessObjectDataKey, List<SchemaColumn> autoDiscoverableSubPartitionColumns,
          String s3KeyPrefix, Collection<String> storageFiles, String storageName)
focal_method.identifier: getHivePartitions
focal_method.invocations: getHivePathPattern substring length matcher isTrue matches format businessObjectDataKeyToString pattern add getPartitionValue addAll getSubPartitionValues groupCount add group group groupCount contains substring length length get isTrue equals getPath format businessObjectDataKeyToString getPath put addAll values
focal_method.modifiers: public
focal_method.parameters: (BusinessObjectDataKey businessObjectDataKey, List<SchemaColumn> autoDiscoverableSubPartitionColumns,
          String s3KeyPrefix, Collection<String> storageFiles, String storageName)
focal_method.return: List<HivePartitionDto>
focal_method.signature: List<HivePartitionDto> getHivePartitions(BusinessObjectDataKey businessObjectDataKey, List<SchemaColumn> autoDiscoverableSubPartitionColumns,
          String s3KeyPrefix, Collection<String> storageFiles, String storageName)