use of com.amazonaws.services.timestreamquery.model.Type in project amazon-timestream-tools by awslabs.
the class QueryExample method parseDatum.
private String parseDatum(ColumnInfo info, Datum datum) {
if (datum.isNullValue() != null && datum.isNullValue()) {
return info.getName() + "=" + "NULL";
}
Type columnType = info.getType();
// If the column is of TimeSeries Type
if (columnType.getTimeSeriesMeasureValueColumnInfo() != null) {
return parseTimeSeries(info, datum);
} else // If the column is of Array Type
if (columnType.getArrayColumnInfo() != null) {
List<Datum> arrayValues = datum.getArrayValue();
return info.getName() + "=" + parseArray(info.getType().getArrayColumnInfo(), arrayValues);
} else // If the column is of Row Type
if (columnType.getRowColumnInfo() != null) {
List<ColumnInfo> rowColumnInfo = info.getType().getRowColumnInfo();
Row rowValues = datum.getRowValue();
return parseRow(rowColumnInfo, rowValues);
} else // If the column is of Scalar Type
{
return parseScalarType(info, datum);
}
}
Aggregations