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; } }
if (DataTypes.isArrayType(type)) { ArrayList array = (ArrayList) childObject; if (array.size() == 0) {
private Object jsonToCarbonObject(Map<String, Object> jsonNodeMap, CarbonColumn column) { DataType type = column.getDataType(); if (DataTypes.isArrayType(type)) { CarbonDimension carbonDimension = (CarbonDimension) column; ArrayList array = (ArrayList) jsonNodeMap.get(extractChildColumnName(column));
if (DataTypes.isArrayType(dataType)) { List<StructField> arrayFields = new ArrayList<>(); StructField arrayField = prepareSubFields(fieldName, ((ArrayType) dataType).getElementType());
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); }
true, Metadata.empty())); } else if (org.apache.carbondata.core.metadata.datatype.DataTypes.isArrayType(dataType)) { fields.add( new StructField(
for (int i = 0; i < dimension.getNumberOfChild(); i++) { DataType dataType = dimension.getListOfChildDimensions().get(i).getDataType(); if (DataTypes.isArrayType(dataType)) { parentQueryType.addChildren( new ArrayQueryType(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(); } } }
String nullFormat, int depth) { DataType dataType = carbonColumn.getDataType(); if (DataTypes.isArrayType(dataType) || DataTypes.isMapType(dataType)) { List<CarbonDimension> listOfChildDimensions = ((CarbonDimension) carbonColumn).getListOfChildDimensions();
.setEncodingList(createEncoding(field.getDataType(), isInvertedIdxColumn, isComplexChild)); if (field.getDataType().isComplexType()) { if (DataTypes.isArrayType(field.getDataType()) || DataTypes.isMapType(field.getDataType())) { newColumn.setNumberOfChild(1); } else { measures.add(newColumn); } else if (DataTypes.isStructType(field.getDataType()) || DataTypes .isArrayType(field.getDataType()) || DataTypes.isMapType(field.getDataType()) || isComplexChild) { complex.add(newColumn); if (DataTypes.isArrayType(field.getDataType())) { String colName = getColNameForArray(valIndex); addColumn(new StructField(colName, ((ArrayType) field.getDataType()).getElementType()),
DataType dataType = child.getDataType(); GenericQueryType queryType = null; if (DataTypes.isArrayType(dataType)) { queryType = new ArrayQueryType(child.getColName(), dimension.getColName(), ++parentBlockIndex);
Map<Object, Integer> localCache, int index, String nullFormat, Boolean isEmptyBadRecords) { DataType dataType = carbonColumn.getDataType(); if (DataTypes.isArrayType(dataType) || DataTypes.isMapType(dataType)) { List<CarbonDimension> listOfChildDimensions = ((CarbonDimension) carbonColumn).getListOfChildDimensions();
} else if (dataType.getId() == DataTypes.TIMESTAMP.getId()) { return org.apache.carbondata.format.DataType.TIMESTAMP; } else if (DataTypes.isArrayType(dataType)) { return org.apache.carbondata.format.DataType.ARRAY; } else if (DataTypes.isStructType(dataType)) {