func randRow()

in go/utils.go [444:485]


func randRow(columns []*athena.ColumnInfo) *athena.Row {
	colLen := len(columns)
	row := &athena.Row{
		Data: make([]*athena.Datum, colLen),
	}
	for j := 0; j < colLen; j++ {
		if columns[j].Type == nil {
			s := "a\tb"
			row.Data[j] = &athena.Datum{VarCharValue: &s}
			continue
		}
		switch *columns[j].Type {
		case "tinyint":
			row.Data[j] = &athena.Datum{VarCharValue: randInt8()}
		case "smallint":
			row.Data[j] = &athena.Datum{VarCharValue: randInt16()}
		case "integer":
			row.Data[j] = &athena.Datum{VarCharValue: randInt()}
		case "bigint":
			row.Data[j] = &athena.Datum{VarCharValue: randUInt64()}
		case "float", "real":
			row.Data[j] = &athena.Datum{VarCharValue: randFloat32()}
		case "double":
			row.Data[j] = &athena.Datum{VarCharValue: randFloat64()}
		case "json", "char", "varchar", "varbinary", "row", "string", "binary",
			"struct", "interval year to month", "interval day to second", "decimal",
			"ipaddress", "array", "map", "unknown":
			row.Data[j] = &athena.Datum{VarCharValue: randStr()}
		case "boolean":
			row.Data[j] = &athena.Datum{VarCharValue: randBool()}
		case "date":
			row.Data[j] = &athena.Datum{VarCharValue: randDate()}
		case "time", "time with time zone", "timestamp with time zone":
			row.Data[j] = &athena.Datum{VarCharValue: randTimeStamp()}
		case "timestamp":
			row.Data[j] = &athena.Datum{VarCharValue: randTimeStamp()}
		default:
			row.Data[j] = &athena.Datum{VarCharValue: randStr()}
		}
	}
	return row
}