本文整理汇总了Java中wherehows.common.schemas.DatasetRecord.setPartitionLayoutPatternId方法的典型用法代码示例。如果您正苦于以下问题:Java DatasetRecord.setPartitionLayoutPatternId方法的具体用法?Java DatasetRecord.setPartitionLayoutPatternId怎么用?Java DatasetRecord.setPartitionLayoutPatternId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wherehows.common.schemas.DatasetRecord
的用法示例。
在下文中一共展示了DatasetRecord.setPartitionLayoutPatternId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: insertDataset
import wherehows.common.schemas.DatasetRecord; //导入方法依赖的package包/类
public static void insertDataset(JsonNode dataset)
throws Exception {
ObjectMapper om = new ObjectMapper();
om.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
DatasetRecord record = om.convertValue(dataset, DatasetRecord.class);
if (record.getRefDatasetUrn() != null) {
Map<String, Object> refDataset = getDatasetByUrn(record.getRefDatasetUrn());
// Find ref dataset id
if (refDataset != null) {
record.setRefDatasetId(((Long) refDataset.get("id")).intValue());
}
}
// Find layout id
if (record.getSamplePartitionFullPath() != null) {
PartitionPatternMatcher ppm = new PartitionPatternMatcher(PartitionLayoutDao.getPartitionLayouts());
record.setPartitionLayoutPatternId(ppm.analyze(record.getSamplePartitionFullPath()));
}
DatabaseWriter dw = new DatabaseWriter(JdbcUtil.wherehowsJdbcTemplate, "dict_dataset");
dw.append(record);
dw.close();
}
示例2: updateDataset
import wherehows.common.schemas.DatasetRecord; //导入方法依赖的package包/类
public static void updateDataset(JsonNode dataset)
throws Exception {
ObjectMapper om = new ObjectMapper();
om.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);
DatasetRecord record = om.convertValue(dataset, DatasetRecord.class);
if (record.getRefDatasetUrn() != null) {
Map<String, Object> refDataset = getDatasetByUrn(record.getRefDatasetUrn());
// Find ref dataset id
if (refDataset != null) {
record.setRefDatasetId(((Long) refDataset.get("id")).intValue());
}
}
// Find layout id
if (record.getSamplePartitionFullPath() != null) {
PartitionPatternMatcher ppm = new PartitionPatternMatcher(PartitionLayoutDao.getPartitionLayouts());
record.setPartitionLayoutPatternId(ppm.analyze(record.getSamplePartitionFullPath()));
}
DatabaseWriter dw = new DatabaseWriter(JdbcUtil.wherehowsJdbcTemplate, "dict_dataset");
dw.update(record.toUpdateDatabaseValue(), record.getUrn());
dw.close();
}
示例3: insertDataset
import wherehows.common.schemas.DatasetRecord; //导入方法依赖的package包/类
public static void insertDataset(DatasetRecord record) throws Exception {
if (record.getRefDatasetUrn() != null) {
Map<String, Object> refDataset = getDatasetByUrn(record.getRefDatasetUrn());
// Find ref dataset id
if (refDataset != null) {
record.setRefDatasetId(((Long) refDataset.get("id")).intValue());
}
}
// Find layout id
if (record.getSamplePartitionFullPath() != null) {
PartitionPatternMatcher ppm = new PartitionPatternMatcher(PartitionLayoutDao.getPartitionLayouts());
record.setPartitionLayoutPatternId(ppm.analyze(record.getSamplePartitionFullPath()));
}
DatabaseWriter dw = new DatabaseWriter(JdbcUtil.wherehowsJdbcTemplate, "dict_dataset");
dw.append(record);
dw.close();
}
示例4: updateDataset
import wherehows.common.schemas.DatasetRecord; //导入方法依赖的package包/类
public static void updateDataset(DatasetRecord record) throws Exception {
if (record.getRefDatasetUrn() != null) {
Map<String, Object> refDataset = getDatasetByUrn(record.getRefDatasetUrn());
// Find ref dataset id
if (refDataset != null) {
record.setRefDatasetId(((Long) refDataset.get("id")).intValue());
}
}
// Find layout id
if (record.getSamplePartitionFullPath() != null) {
PartitionPatternMatcher ppm = new PartitionPatternMatcher(PartitionLayoutDao.getPartitionLayouts());
record.setPartitionLayoutPatternId(ppm.analyze(record.getSamplePartitionFullPath()));
}
DatabaseWriter dw = new DatabaseWriter(JdbcUtil.wherehowsJdbcTemplate, "dict_dataset");
dw.update(record.toUpdateDatabaseValue(), record.getUrn());
dw.close();
}