/** * Asserts that there exists at least one column specified in the business object format schema. * * @param businessObjectFormat The {@link BusinessObjectFormat} containing schema columns. * @param businessObjectFormatEntity The entity used to generate the error message. */ private void assertSchemaColumnsNotEmpty(BusinessObjectFormat businessObjectFormat, BusinessObjectFormatEntity businessObjectFormatEntity) { Assert.notEmpty(businessObjectFormat.getSchema().getColumns(), String.format("No schema columns specified for business object format {%s}.", businessObjectFormatHelper.businessObjectFormatEntityAltKeyToString(businessObjectFormatEntity))); }
/** * Asserts that there exists at least one column specified in the business object format schema. * * @param businessObjectFormat The {@link BusinessObjectFormat} containing schema columns. * @param businessObjectFormatEntity The entity used to generate the error message. */ private void assertSchemaColumnsNotEmpty(BusinessObjectFormat businessObjectFormat, BusinessObjectFormatEntity businessObjectFormatEntity) { Assert.notEmpty(businessObjectFormat.getSchema().getColumns(), String.format("No schema columns specified for business object format {%s}.", businessObjectFormatHelper.businessObjectFormatEntityAltKeyToString(businessObjectFormatEntity))); }
for (SchemaColumn schemaColumn : businessObjectFormat.getSchema().getColumns()) sb.append(String.format(" `%s%s` %s%s", (!CollectionUtils.isEmpty(businessObjectFormat.getSchema().getPartitions()) && businessObjectFormat.getSchema().getPartitions().contains(schemaColumn) ? "ORGNL_" : ""), schemaColumn.getName(), getHiveDataType(schemaColumn, businessObjectFormatEntity), StringUtils.isNotBlank(schemaColumn.getDescription()) ? String.format(" COMMENT '%s'", escapeSingleQuotes(schemaColumn.getDescription())) :
for (SchemaColumn schemaColumn : businessObjectFormat.getSchema().getColumns()) sb.append(String.format(" `%s%s` %s%s", (!CollectionUtils.isEmpty(businessObjectFormat.getSchema().getPartitions()) && businessObjectFormat.getSchema().getPartitions().contains(schemaColumn) ? "ORGNL_" : ""), schemaColumn.getName(), getHiveDataType(schemaColumn, businessObjectFormatEntity), StringUtils.isNotBlank(schemaColumn.getDescription()) ? String.format(" COMMENT '%s'", escapeSingleQuotes(schemaColumn.getDescription())) :
Assert.notNull(businessObjectFormat.getSchema(), String.format( "Partition key \"%s\" doesn't match configured business object format partition key \"%s\" and " + "there is no schema defined to check subpartition columns for business object format {%s}.", partitionKey, Math.min(BusinessObjectDataEntity.MAX_SUBPARTITIONS + 1, CollectionUtils.size(businessObjectFormat.getSchema().getPartitions())); if (partitionKey.equalsIgnoreCase(businessObjectFormat.getSchema().getPartitions().get(i).getName()))
Assert.notNull(businessObjectFormat.getSchema(), String.format( "Partition key \"%s\" doesn't match configured business object format partition key \"%s\" and " + "there is no schema defined to check subpartition columns for business object format {%s}.", partitionKey, Math.min(BusinessObjectDataEntity.MAX_SUBPARTITIONS + 1, CollectionUtils.size(businessObjectFormat.getSchema().getPartitions())); if (partitionKey.equalsIgnoreCase(businessObjectFormat.getSchema().getPartitions().get(i).getName()))
for (SchemaColumn partitionColumn : businessObjectFormat.getSchema().getPartitions())
for (SchemaColumn partitionColumn : businessObjectFormat.getSchema().getPartitions())
Assert.notEmpty(businessObjectFormat.getSchema().getPartitions(), String.format("No schema partitions specified for business object format {%s}.", businessObjectFormatHelper.businessObjectFormatEntityAltKeyToString(generateDdlRequest.businessObjectFormatEntity))); for (SchemaColumn partitionColumn : businessObjectFormat.getSchema().getPartitions())
Assert.notNull(businessObjectFormat.getSchema(), String .format("Schema must be defined when using subpartition values for business object format {%s}.", businessObjectFormatHelper.businessObjectFormatKeyToString(businessObjectFormatHelper.getBusinessObjectFormatKey(businessObjectFormat)))); Assert.notNull(businessObjectFormat.getSchema().getPartitions(), String .format("Schema partition(s) must be defined when using subpartition values for business object " + "format {%s}.", businessObjectFormatHelper.businessObjectFormatKeyToString(businessObjectFormatHelper.getBusinessObjectFormatKey(businessObjectFormat)))); Assert.isTrue(businessObjectFormat.getSchema().getPartitions().size() > businessObjectDataKey.getSubPartitionValues().size(), String.format("Number of subpartition values specified for the business object data is greater than or equal to " + "the number of partition columns defined in the schema for the associated business object format." + subPartitions.put(s3KeyPrefixFormat(businessObjectFormat.getSchema().getPartitions().get(i + 1).getName()), businessObjectDataKey.getSubPartitionValues().get(i));
Assert.notNull(businessObjectFormat.getSchema(), String .format("Schema must be defined when using subpartition values for business object format {%s}.", businessObjectFormatHelper.businessObjectFormatKeyToString(businessObjectFormatHelper.getBusinessObjectFormatKey(businessObjectFormat)))); Assert.notNull(businessObjectFormat.getSchema().getPartitions(), String .format("Schema partition(s) must be defined when using subpartition values for business object " + "format {%s}.", businessObjectFormatHelper.businessObjectFormatKeyToString(businessObjectFormatHelper.getBusinessObjectFormatKey(businessObjectFormat)))); Assert.isTrue(businessObjectFormat.getSchema().getPartitions().size() > businessObjectDataKey.getSubPartitionValues().size(), String.format("Number of subpartition values specified for the business object data is greater than or equal to " + "the number of partition columns defined in the schema for the associated business object format." + subPartitions.put(s3KeyPrefixFormat(businessObjectFormat.getSchema().getPartitions().get(i + 1).getName()), businessObjectDataKey.getSubPartitionValues().get(i));
if (!CollectionUtils.isEqualCollection(schemaColumns, relationalTableRegistrationDto.getBusinessObjectFormat().getSchema().getColumns()))
if (!CollectionUtils.isEqualCollection(schemaColumns, relationalTableRegistrationDto.getBusinessObjectFormat().getSchema().getColumns()))
theSchema = this.getSchema(); strategy.appendField(locator, this, "schema", buffer, theSchema, (this.schema!= null));