com.clickzetta.platform.common.CommonSchemaConvert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clickzetta-java Show documentation
Show all versions of clickzetta-java Show documentation
The java SDK for clickzetta's Lakehouse
package com.clickzetta.platform.common;
import cz.proto.FieldSchema;
import cz.proto.MetadataEntity;
import java.util.ArrayList;
import java.util.List;
public class CommonSchemaConvert extends SchemaConvert {
@Override
public Schema convertToExternalSchema(MetadataEntity.Entity meta) {
List fields = meta.getTable().getTableSchema().getFieldsList();
List columns = new ArrayList<>();
List keyColumns = new ArrayList<>();
List sortColumns = new ArrayList<>();
columns.add(buildVirtualColumnSchema(Constant.VIRTUAL_NORMAL_KEY));
for (FieldSchema field : fields) {
columns.add(buildColumnSchema(field, false));
}
return new Schema(columns, keyColumns, sortColumns);
}
@Override
public Schema convertToExternalKeySchema(MetadataEntity.Entity meta) {
List fields = meta.getTable().getTableSchema().getFieldsList();
List columns = new ArrayList<>();
List keyColumns = new ArrayList<>();
List sortColumns = new ArrayList<>();
columns.add(buildVirtualColumnSchema(Constant.VIRTUAL_NORMAL_KEY));
return new Schema(columns, keyColumns, sortColumns);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy