newColumnDesc.init(ret); expandedColumns.add(newColumnDesc);
public TableDesc(TableDesc other) { this.uuid = other.uuid; this.lastModified = other.lastModified; this.name = other.name; this.sourceType = other.sourceType; this.tableType = other.tableType; this.dataGen = other.dataGen; this.columns = new ColumnDesc[other.columns.length]; for (int i = 0; i < other.columns.length; i++) { this.columns[i] = new ColumnDesc(other.columns[i]); this.columns[i].init(this); } this.project = other.project; this.config = other.config; this.database.setName(other.getDatabase()); this.identity = other.identity; }
public void init(KylinConfig config, String project) { this.project = project; this.config = config; if (name != null) name = name.toUpperCase(Locale.ROOT); if (getDatabase() != null) setDatabase(getDatabase().toUpperCase(Locale.ROOT)); if (columns != null) { Arrays.parallelSort(columns, new Comparator<ColumnDesc>() { @Override public int compare(ColumnDesc col1, ColumnDesc col2) { Integer id1 = Integer.parseInt(col1.getId()); Integer id2 = Integer.parseInt(col2.getId()); return id1.compareTo(id2); } }); for (ColumnDesc col : columns) { col.init(this); } } }
public static ColumnDesc mockup(TableDesc table, int oneBasedColumnIndex, String name, String datatype) { ColumnDesc desc = new ColumnDesc(); String id = "" + oneBasedColumnIndex; desc.setId(id); desc.setName(name); desc.setDatatype(datatype); desc.init(table); return desc; }
public static TblColRef mockup(TableDesc table, int oneBasedColumnIndex, String name, String datatype, String comment) { ColumnDesc desc = new ColumnDesc(); String id = "" + oneBasedColumnIndex; desc.setId(id); desc.setName(name); desc.setDatatype(datatype); desc.init(table); desc.setComment(comment); return new TblColRef(desc); }
public ColumnDesc newFakeRewriteColumn(TableDesc sourceTable) { ColumnDesc fakeCol = new ColumnDesc(); fakeCol.setName(getRewriteFieldName()); fakeCol.setDatatype(getRewriteFieldType().toString()); if (isCount()) fakeCol.setNullable(false); fakeCol.init(sourceTable); return fakeCol; }
column.setName(BytesUtil.readUTFString(buffer)); column.setDatatype(BytesUtil.readUTFString(buffer)); column.init(tableDesc);
@Override public void deserialize(IFilterCodeSystem<?> cs, ByteBuffer buffer) { String tableName = BytesUtil.readUTFString(buffer); if (_QUALIFIED_.equals(tableName)) { // qualified column (from model) String model = BytesUtil.readUTFString(buffer); String alias = BytesUtil.readUTFString(buffer); String col = BytesUtil.readUTFString(buffer); KylinConfig config = KylinConfig.getInstanceFromEnv(); DataModelDesc modelDesc = DataModelManager.getInstance(config).getDataModelDesc(model); this.columnRef = modelDesc.findColumn(alias, col); } else { // un-qualified column TableDesc tableDesc = null; if (tableName != null) { tableDesc = new TableDesc(); tableDesc.setName(tableName); } ColumnDesc column = new ColumnDesc(); column.setId(BytesUtil.readUTFString(buffer)); column.setName(BytesUtil.readUTFString(buffer)); column.setDatatype(BytesUtil.readUTFString(buffer)); column.init(tableDesc); this.columnRef = column.getRef(); } }
@Override public CoprocessorRowType deserialize(ByteBuffer in) { int n = BytesUtil.readVInt(in); int bodyOffset = BytesUtil.readVInt(in); TblColRef[] cols = new TblColRef[n]; int[] colSizes = new int[n]; for (int i = 0; i < n; i++) { String tableName = BytesUtil.readAsciiString(in); String colName = BytesUtil.readAsciiString(in); String datatype = BytesUtil.readAsciiString(in); TableDesc table = new TableDesc(); table.setName(tableName); ColumnDesc col = new ColumnDesc(); col.setTable(table); col.setName(colName); col.setDatatype(datatype); col.init(table); cols[i] = col.getRef(); int colSize = BytesUtil.readVInt(in); colSizes[i] = colSize; } return new CoprocessorRowType(cols, colSizes, bodyOffset); } };
public void init() { if (name != null) name = name.toUpperCase(); if (getDatabase() != null) setDatabase(getDatabase().toUpperCase()); if (columns != null) { Arrays.sort(columns, new Comparator<ColumnDesc>() { @Override public int compare(ColumnDesc col1, ColumnDesc col2) { Integer id1 = Integer.parseInt(col1.getId()); Integer id2 = Integer.parseInt(col2.getId()); return id1.compareTo(id2); } }); for (ColumnDesc col : columns) { col.init(this); } } }
public void init() { if (name != null) name = name.toUpperCase(); if (getDatabase() != null) setDatabase(getDatabase().toUpperCase()); if (columns != null) { Arrays.sort(columns, new Comparator<ColumnDesc>() { @Override public int compare(ColumnDesc col1, ColumnDesc col2) { Integer id1 = Integer.parseInt(col1.getId()); Integer id2 = Integer.parseInt(col2.getId()); return id1.compareTo(id2); } }); for (ColumnDesc col : columns) { col.init(this); } } }
public TableDesc(TableDesc other) { this.uuid = other.uuid; this.lastModified = other.lastModified; this.name = other.name; this.sourceType = other.sourceType; this.tableType = other.tableType; this.dataGen = other.dataGen; this.columns = new ColumnDesc[other.columns.length]; for (int i = 0; i < other.columns.length; i++) { this.columns[i] = new ColumnDesc(other.columns[i]); this.columns[i].init(this); } this.project = other.project; this.config = other.config; this.database.setName(other.getDatabase()); this.identity = other.identity; }
public void init(KylinConfig config, String project) { this.project = project; this.config = config; if (name != null) name = name.toUpperCase(Locale.ROOT); if (getDatabase() != null) setDatabase(getDatabase().toUpperCase(Locale.ROOT)); if (columns != null) { Arrays.parallelSort(columns, new Comparator<ColumnDesc>() { @Override public int compare(ColumnDesc col1, ColumnDesc col2) { Integer id1 = Integer.parseInt(col1.getId()); Integer id2 = Integer.parseInt(col2.getId()); return id1.compareTo(id2); } }); for (ColumnDesc col : columns) { col.init(this); } } }
newColumnDesc.init(ret); expandedColumns.add(newColumnDesc);
public static ColumnDesc mockup(TableDesc table, int oneBasedColumnIndex, String name, String datatype) { ColumnDesc desc = new ColumnDesc(); String id = "" + oneBasedColumnIndex; desc.setId(id); desc.setName(name); desc.setDatatype(datatype); desc.init(table); return desc; }
public static TblColRef mockup(TableDesc table, int oneBasedColumnIndex, String name, String datatype, String comment) { ColumnDesc desc = new ColumnDesc(); String id = "" + oneBasedColumnIndex; desc.setId(id); desc.setName(name); desc.setDatatype(datatype); desc.init(table); desc.setComment(comment); return new TblColRef(desc); }
public ColumnDesc newFakeRewriteColumn(TableDesc sourceTable) { ColumnDesc fakeCol = new ColumnDesc(); fakeCol.setName(getRewriteFieldName()); fakeCol.setDatatype(getRewriteFieldType().toString()); if (isCount()) fakeCol.setNullable(false); fakeCol.init(sourceTable); return fakeCol; }
@Override public void deserialize(IFilterCodeSystem<?> cs, ByteBuffer buffer) { String tableName = BytesUtil.readUTFString(buffer); if (_QUALIFIED_.equals(tableName)) { // qualified column (from model) String model = BytesUtil.readUTFString(buffer); String alias = BytesUtil.readUTFString(buffer); String col = BytesUtil.readUTFString(buffer); KylinConfig config = KylinConfig.getInstanceFromEnv(); DataModelDesc modelDesc = DataModelManager.getInstance(config).getDataModelDesc(model); this.columnRef = modelDesc.findColumn(alias, col); } else { // un-qualified column TableDesc tableDesc = null; if (tableName != null) { tableDesc = new TableDesc(); tableDesc.setName(tableName); } ColumnDesc column = new ColumnDesc(); column.setId(BytesUtil.readUTFString(buffer)); column.setName(BytesUtil.readUTFString(buffer)); column.setDatatype(BytesUtil.readUTFString(buffer)); column.init(tableDesc); this.columnRef = column.getRef(); } }
column.setName(BytesUtil.readUTFString(buffer)); column.setDatatype(BytesUtil.readUTFString(buffer)); column.init(tableDesc);
@Override public CoprocessorRowType deserialize(ByteBuffer in) { int n = BytesUtil.readVInt(in); int bodyOffset = BytesUtil.readVInt(in); TblColRef[] cols = new TblColRef[n]; int[] colSizes = new int[n]; for (int i = 0; i < n; i++) { String tableName = BytesUtil.readAsciiString(in); String colName = BytesUtil.readAsciiString(in); String datatype = BytesUtil.readAsciiString(in); TableDesc table = new TableDesc(); table.setName(tableName); ColumnDesc col = new ColumnDesc(); col.setTable(table); col.setName(colName); col.setDatatype(datatype); col.init(table); cols[i] = col.getRef(); int colSize = BytesUtil.readVInt(in); colSizes[i] = colSize; } return new CoprocessorRowType(cols, colSizes, bodyOffset); } };