@Override public void setRow(DataMapRow row, int ordinal) { assert (DataTypes.isStructType(schemas[ordinal].getDataType())); data[ordinal] = row; }
private boolean isColumnPageBasedOnDataType(int columnPageIndex) { DataType dataType = complexColumnInfoList.get(columnPageIndex).getColumnDataTypes(); if ((complexColumnInfoList.get(columnPageIndex).isNoDictionary() && !((DataTypes.isStructType(dataType) || DataTypes.isArrayType(dataType) || DataTypes.isMapType(dataType) || (dataType == DataTypes.STRING) || (dataType == DataTypes.VARCHAR) || (dataType == DataTypes.DATE) || DataTypes.isDecimal(dataType))))) { // For all these above condition the ColumnPage should be Taken as BYTE_ARRAY // for all other cases make Column Page Based on each DataType. return true; } else { return false; } }
} else if (DataTypes.isStructType(type)) { Map<String, Object> childFieldsMap = (Map<String, Object>) childObject; int size = column.getNumberOfChild();
} else if (DataTypes.isStructType(type)) { CarbonDimension carbonDimension = (CarbonDimension) column; int size = carbonDimension.getNumberOfChild();
return new StructField(fieldName, DataTypes.createArrayType(arrayField.getDataType()), arrayFields); } else if (DataTypes.isStructType(dataType)) { List<StructField> structFields = new ArrayList<>(); List<StructField> fields = ((StructType) dataType).getFields();
private static void fillParentDetails(Map<Integer, Integer> dimensionToBlockIndexMap, CarbonDimension dimension, Map<Integer, GenericQueryType> complexTypeMap, int[] eachComplexColumnValueSize, Map<String, Dictionary> columnIdToDictionaryMap) { int parentBlockIndex = dimensionToBlockIndexMap.get(dimension.getOrdinal()); GenericQueryType parentQueryType; if (DataTypes.isArrayType(dimension.getDataType())) { parentQueryType = new ArrayQueryType(dimension.getColName(), dimension.getColName(), parentBlockIndex); } else if (DataTypes.isStructType(dimension.getDataType())) { parentQueryType = new StructQueryType(dimension.getColName(), dimension.getColName(), dimensionToBlockIndexMap.get(dimension.getOrdinal())); } else if (DataTypes.isMapType(dimension.getDataType())) { parentQueryType = new MapQueryType(dimension.getColName(), dimension.getColName(), parentBlockIndex); } else { throw new UnsupportedOperationException(dimension.getDataType().getName() + " is not supported"); } complexTypeMap.put(dimension.getOrdinal(), parentQueryType); fillChildrenDetails(eachComplexColumnValueSize, columnIdToDictionaryMap, parentBlockIndex, dimension, parentQueryType); }
new DecimalType(carbonColumn.getPrecision(), carbonColumn.getScale()), true, Metadata.empty())); } else if (org.apache.carbondata.core.metadata.datatype.DataTypes.isStructType(dataType)) { fields.add( new StructField(
new ArrayQueryType(dimension.getListOfChildDimensions().get(i).getColName(), dimension.getColName(), ++parentBlockIndex)); } else if (DataTypes.isStructType(dataType)) { parentQueryType.addChildren( new StructQueryType(dimension.getListOfChildDimensions().get(i).getColName(),
public static GenericQueryType[] getComplexDimensions(CarbonTable carbontable, CarbonColumn[] carbonColumns, Cache<DictionaryColumnUniqueIdentifier, Dictionary> cache) throws IOException { GenericQueryType[] queryTypes = new GenericQueryType[carbonColumns.length]; for (int i = 0; i < carbonColumns.length; i++) { if (carbonColumns[i].isComplex()) { if (DataTypes.isArrayType(carbonColumns[i].getDataType())) { queryTypes[i] = new ArrayQueryType(carbonColumns[i].getColName(), carbonColumns[i].getColName(), i); } else if (DataTypes.isStructType(carbonColumns[i].getDataType())) { queryTypes[i] = new StructQueryType(carbonColumns[i].getColName(), carbonColumns[i].getColName(), i); } else { throw new UnsupportedOperationException( carbonColumns[i].getDataType().getName() + " is not supported"); } fillChildren(carbontable, queryTypes[i], (CarbonDimension) carbonColumns[i], i, cache); } } return queryTypes; }
private void initComplexTypeChildren() { if (getDataType().isComplexType()) { StructField subFields = prepareSubFields(getFieldName(), getDataType()); if (DataTypes.isArrayType(getDataType()) || DataTypes.isMapType(getDataType())) { children = subFields.getChildren(); } else if (DataTypes.isStructType(getDataType())) { children = ((StructType) subFields.getDataType()).getFields(); } } }
} else if (DataTypes.isStructType(dataType)) { List<CarbonDimension> dimensions = ((CarbonDimension) carbonColumn).getListOfChildDimensions();
if (!newColumn.isDimensionColumn()) { measures.add(newColumn); } else if (DataTypes.isStructType(field.getDataType()) || DataTypes .isArrayType(field.getDataType()) || DataTypes.isMapType(field.getDataType()) || isComplexChild) { addColumn(new StructField(colName, ((ArrayType) field.getDataType()).getElementType()), field.getFieldName(), valIndex, false, true, isInvertedIdxColumn); } else if (DataTypes.isStructType(field.getDataType()) && ((StructType) field.getDataType()).getFields().size() > 0) {
new ArrayQueryType(child.getColName(), dimension.getColName(), ++parentBlockIndex); } else if (DataTypes.isStructType(dataType)) { queryType = new StructQueryType(child.getColName(), dimension.getColName(), ++parentBlockIndex);
} else if (DataTypes.isStructType(dataType)) { List<CarbonDimension> dimensions = ((CarbonDimension) carbonColumn).getListOfChildDimensions();
} else if (DataTypes.isArrayType(dataType)) { return org.apache.carbondata.format.DataType.ARRAY; } else if (DataTypes.isStructType(dataType)) { return org.apache.carbondata.format.DataType.STRUCT; } else if (DataTypes.isMapType(dataType)) {