Creates a pre-populated {@link com.google.cloud.spanner.ResultSet}

@param type row type of the rows in the returned {@link com.google.cloud.spanner.ResultSet}
@param rows the rows in the returned {@link com.google.cloud.spanner.ResultSet}.
555978
public static ResultSet forRows(Type type, Iterable<Struct> rows) {
    return new PrePopulatedResultSet(type, rows);
  }
900847
public ENTITY mapFromRow(Row row) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(format("Map row %s back to entity of type %s", row, entityClass.getCanonicalName()));
        }

        validateNotNull(row, "Row object should not be null");
        final String tableName = row.getColumnDefinitions().asList().get(0).getTable();
        final String entityTableName = meta_internal.getTableOrViewName();
        validateTableTrue(entityTableName.equals(tableName),
                "CQL row is from table '%s', it cannot be mapped to entity '%s' associated to table '%s'",
                tableName, entityClass.getCanonicalName(), entityTableName);
        return meta_internal.createEntityFrom(row);
    }
285882
public static void populate(WritableColumnVector col, InternalRow row, int fieldIdx) {
    int capacity = col.capacity;
    DataType t = col.dataType();

    if (row.isNullAt(fieldIdx)) {
      col.putNulls(0, capacity);
    } else {
      if (t == DataTypes.BooleanType) {
        col.putBooleans(0, capacity, row.getBoolean(fieldIdx));
      } else if (t == DataTypes.ByteType) {
        col.putBytes(0, capacity, row.getByte(fieldIdx));
      } else if (t == DataTypes.ShortType) {
        col.putShorts(0, capacity, row.getShort(fieldIdx));
      } else if (t == DataTypes.IntegerType) {
        col.putInts(0, capacity, row.getInt(fieldIdx));
      } else if (t == DataTypes.LongType) {
        col.putLongs(0, capacity, row.getLong(fieldIdx));
      } else if (t == DataTypes.FloatType) {
        col.putFloats(0, capacity, row.getFloat(fieldIdx));
      } else if (t == DataTypes.DoubleType) {
        col.putDoubles(0, capacity, row.getDouble(fieldIdx));
      } else if (t == DataTypes.StringType) {
        UTF8String v = row.getUTF8String(fieldIdx);
        byte[] bytes = v.getBytes();
        for (int i = 0; i < capacity; i++) {
          col.putByteArray(i, bytes);
        }
      } else if (t instanceof DecimalType) {
        DecimalType dt = (DecimalType)t;
        Decimal d = row.getDecimal(fieldIdx, dt.precision(), dt.scale());
        if (dt.precision() <= Decimal.MAX_INT_DIGITS()) {
          col.putInts(0, capacity, (int)d.toUnscaledLong());
        } else if (dt.precision() <= Decimal.MAX_LONG_DIGITS()) {
          col.putLongs(0, capacity, d.toUnscaledLong());
        } else {
          final BigInteger integer = d.toJavaBigDecimal().unscaledValue();
          byte[] bytes = integer.toByteArray();
          for (int i = 0; i < capacity; i++) {
            col.putByteArray(i, bytes, 0, bytes.length);
          }
        }
      } else if (t instanceof CalendarIntervalType) {
        CalendarInterval c = (CalendarInterval)row.get(fieldIdx, t);
        col.getChild(0).putInts(0, capacity, c.months);
        col.getChild(1).putLongs(0, capacity, c.microseconds);
      } else if (t instanceof DateType) {
        col.putInts(0, capacity, row.getInt(fieldIdx));
      } else if (t instanceof TimestampType) {
        col.putLongs(0, capacity, row.getLong(fieldIdx));
      }
    }
  }
448204
public void setRows(com.google.api.ads.admanager.axis.v201808.Row[] rows) {
        this.rows = rows;
    }
72202
@Override
    public List<V> row(int row) {
        Preconditions.checkElementIndex(row, rowCount(), "Row index");
        int base = row * rowCount;
        return new Inner<V>(this, base, columnCount, 1);
    }
1218537
public TerminalSize withRows(int rows) {
        if(this.rows == rows) {
            return this;
        }
        if(rows == 0 && this.columns == 0) {
            return ZERO;
        }
        return new TerminalSize(this.columns, rows);
    }
970831
@NonNull
    Collection<TObj> getRowItems(int row) {
        Collection<TObj> result = new LinkedList<>();
        SparseArrayCompat<TObj> array = mData.get(row);
        for (int count = array.size(), i = 0; i < count; i++) {
            int key = array.keyAt(i);
            TObj columnObj = array.get(key);
            if (columnObj != null) {
                result.add(columnObj);
            }

        }
        return result;
    }
575781
public <T> T get(int row, int col, DataType dataType)
	{
		List<String> rowList = row(row);
		
		if(rowList == null || rowList.isEmpty() || col >= rowList.size())
			return nullFor(dataType);
		
	
		String cell = rowList.get(col);
		
		
		
		T results = toType(cell,dataType);
		return results;
	}
1344559
@InternalApi
  public static Row create(ByteString key, List<RowCell> cells) {
    return new AutoValue_Row(key, cells);
  }
939549
function Row(columnSpecs, row) {
  var i, col, type, val, cols = [];
  for (i = 0; i < columnSpecs.length; i++) {
    col = columnSpecs[i];
    type = types.fromType(col.type);
    if (col.subtype) {
      type = type(col.subtype);
    } else if (col.keytype) {
      type = type(col.keytype, col.valuetype);
    }
    val = type.deserialize(row[i]);
    this[col.name] = val;
    cols.push(val);
  }
  Object.defineProperty(this, 'columns', {
    value: cols,
    enumerable: false
  });
}
1015759
public final List<Element> mapRowToList(final ResultSet rs, final String columnNameArray) throws SQLException {
        if (rs == null) {
            return Collections.emptyList();
        }

        final Array sqlArray = rs.getArray(columnNameArray);

        if (sqlArray == null) {
            return Collections.emptyList();
        } else {
            final ResultSet resultSet = sqlArray.getResultSet();
            final List<String> l = new ArrayList<String>();
            while (resultSet.next()) {
                String test = resultSet.getString(2);
                l.add(test);
            }

            List<Element> elements = new ArrayList<Element>(l.size());
            for (String s : l) {
                try {
                    List<String> resultList = ParseUtils.postgresROW2StringList(s);
                    Element element = new Element();
                    element.setRowList(resultList);
                    elements.add(element);
                } catch (Exception e) {
                    LOG.error("Problem parsing received ROW value [{}]: {}", new Object[] {s, e.getMessage(), e});
                }
            }

            return elements;
        }

    }
1285868
private static RowMapper getMapper(Class<? extends RowMapper> rowMapper, ResultSet rs, Class returnType, Calendar cal)
    {
        Constructor c = null;
        try {
            c = rowMapper.getDeclaredConstructor(_params);
            return (RowMapper) c.newInstance(new Object[]{rs, returnType, cal});
        } catch (NoSuchMethodException e) {
            throw new ControlException("Failure creating new instance of RowMapper, " + e.toString(), e);
        } catch (InstantiationException e) {
            throw new ControlException("Failure creating new instance of RowMapper, " + e.toString(), e);
        } catch (IllegalAccessException e) {
            throw new ControlException("Failure creating new instance of RowMapper, " + e.toString(), e);
        } catch (InvocationTargetException e) {
            throw new ControlException("Failure creating new instance of RowMapper, " + e.getCause().toString(), e);
        }
    }
1368172
@Override
    protected List<Row> rows(List<SearchResult> searchResults, long timestamp, boolean usesRelevance) {
        // Initialize result
        List<Row> rows = new ArrayList<>(searchResults.size());

        // Group key queries by partition keys
        Map<CellName, Float> scoresByClusteringKey = new HashMap<>(searchResults.size());
        Map<DecoratedKey, List<CellName>> keys = new HashMap<>();
        for (SearchResult searchResult : searchResults) {
            DecoratedKey partitionKey = searchResult.getPartitionKey();
            CellName clusteringKey = searchResult.getClusteringKey();
            Float score = searchResult.getScore();
            scoresByClusteringKey.put(clusteringKey, score);
            List<CellName> clusteringKeys = keys.get(partitionKey);
            if (clusteringKeys == null) {
                clusteringKeys = new ArrayList<>();
                keys.put(partitionKey, clusteringKeys);
            }
            clusteringKeys.add(clusteringKey);
        }

        for (Map.Entry<DecoratedKey, List<CellName>> entry : keys.entrySet()) {
            DecoratedKey partitionKey = entry.getKey();
            for (List<CellName> clusteringKeys : Lists.partition(entry.getValue(), 1000)) {
                Map<CellName, Row> partitionRows = rows(partitionKey, clusteringKeys, timestamp);
                for (Map.Entry<CellName, Row> entry1 : partitionRows.entrySet()) {
                    Row row = entry1.getValue();
                    if (usesRelevance) {
                        CellName clusteringKey = entry1.getKey();
                        Float score = scoresByClusteringKey.get(clusteringKey);
                        Row scoredRow = addScoreColumn(row, timestamp, score);
                        rows.add(scoredRow);
                    } else {
                        rows.add(row);
                    }
                }
            }
        }
        return rows;
    }
1019331
@InternalApi
  public Row createRowFromProto(com.google.bigtable.v2.Row row) {
    RowBuilder<Row> builder = createRowBuilder();
    builder.startRow(row.getKey());

    for (Family family : row.getFamiliesList()) {
      for (Column column : family.getColumnsList()) {
        for (Cell cell : column.getCellsList()) {
          builder.startCell(
              family.getName(),
              column.getQualifier(),
              cell.getTimestampMicros(),
              cell.getLabelsList(),
              cell.getValue().size());
          builder.cellValue(cell.getValue());
          builder.finishCell();
        }
      }
    }

    return builder.finishRow();
  }
794832
@VisibleForTesting
  RangeSet<RowKeyWrapper> rowSetToRangeSet(RowSet btRowSet) {
    RangeSet<RowKeyWrapper> rangeSet = TreeRangeSet.create();
    for (RowRange btRowRange : btRowSet.getRowRangesList()) {
      rangeSet.add(rowRangeToRange(btRowRange));
    }
    for (ByteString key : btRowSet.getRowKeysList()) {
      rangeSet.add(Range.singleton(new RowKeyWrapper(key)));
    }
    return rangeSet;
  }
136503
public static List<PersonBean> createExampleData(final int rows, final int documents) {
		List<PersonBean> data = new ArrayList<>(rows);

		Date date1 = DateUtilities.createDate(1, 2, 1973);
		Date date2 = DateUtilities.createDate(2, 3, 1985);
		Date date3 = DateUtilities.createDate(3, 4, 2004);

		for (int i = 1; i <= rows; i++) {
			PersonBean bean = new PersonBean("P" + i, "Joe" + i, "Bloggs" + i, date1);

			List<TravelDoc> docs = new ArrayList<>(documents);
			for (int j = 1; j <= documents; j++) {
				String prefix = i + "-" + j;
				TravelDoc doc = new TravelDoc("DOC" + prefix, "Canada" + prefix, "Ottawa" + prefix,
						date2, date3);
				docs.add(doc);
			}

			bean.setDocuments(docs);

			data.add(bean);
		}

		return data;
	}
294877
public void delete(Set<HBeanRow> rows) {
        final List<Row> delete = new ArrayList<>();
        try {
            for (HBeanRow row : rows) {
                delete.add(new Delete(row.getRowKey()));
            }
            table.batch(delete);
            table.flushCommits();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }