Convert a given Row to a list of writables, given the specified Schema

@param schema Schema for the data
@param row    Row of data
499101
public static List<Writable> rowToWritables(Schema schema, Row row) {
        List<Writable> ret = new ArrayList<>();
        for (int i = 0; i < row.size(); i++) {
            switch (schema.getType(i)) {
                case Double:
                    ret.add(new DoubleWritable(row.getDouble(i)));
                    break;
                case Float:
                    ret.add(new FloatWritable(row.getFloat(i)));
                    break;
                case Integer:
                    ret.add(new IntWritable(row.getInt(i)));
                    break;
                case Long:
                    ret.add(new LongWritable(row.getLong(i)));
                    break;
                case String:
                    ret.add(new Text(row.getString(i)));
                    break;
                default:
                    throw new IllegalStateException("Illegal type");
            }
        }
        return ret;
    }
955000
public TableResult listTableDataSchema(
      String datasetName, String tableName, Schema schema, String field) {
    // [START ]
    TableResult tableData = bigquery.listTableData(datasetName, tableName, schema);
    for (FieldValueList row : tableData.iterateAll()) {
      row.get(field);
    }
    // [END ]
    return tableData;
  }
323027
public void setSchema(java.util.Collection<SchemaAttributeType> schema) {
        if (schema == null) {
            this.schema = null;
            return;
        }

        this.schema = new java.util.ArrayList<SchemaAttributeType>(schema);
    }
326574
@Override
    public void describe(Schema schema) {
        pojoBinding.describe(schema.createTable(tableName), schema);
    }
804461
public void putTableSchema(String key, TableSchema schema) {
		checkNotNull(key);
		checkNotNull(schema);

		final String[] fieldNames = schema.getFieldNames();
		final TypeInformation<?>[] fieldTypes = schema.getFieldTypes();

		final List<List<String>> values = new ArrayList<>();
		for (int i = 0; i < schema.getFieldCount(); i++) {
			values.add(Arrays.asList(fieldNames[i], TypeStringUtils.writeTypeInfo(fieldTypes[i])));
		}

		putIndexedFixedProperties(
			key,
			Arrays.asList(TABLE_SCHEMA_NAME, TABLE_SCHEMA_TYPE),
			values);
	}
73594
@Override
    public final void write(final Map<String, Object> row) throws IOException {
        Map<String, Object> filteredRow = applyFilters(row);

        writeToOutput(filteredRow);
    }
523649
public static void writeRecordBatchTo(List<List<Writable>> recordBatch, Schema inputSchema,OutputStream outputStream) {
        BufferAllocator bufferAllocator = new RootAllocator(Long.MAX_VALUE);
        writeRecordBatchTo(bufferAllocator,recordBatch,inputSchema,outputStream);
    }
1066684
function (schema) {
            if (!this.rowConfig.options) { this.rowConfig.options = {}; }
            this.rowConfig.options.schema = schema || this.options.rowSchema || this.rowSchema;
            return this;
        }
456775
private void addOps(Map<Key, List<TableOperation>> operations, Table schemaTable, Row row)
    {
        Key key = ((TableImpl) schemaTable).createKey(row, false);

        TableOperation ops = tableAPI.getTableOperationFactory().createPut(row, Choice.NONE, true);

        if (operations.containsKey(key))
        {
            operations.get(key).add(ops);

        }
        else
        {
            List<TableOperation> operation = new ArrayList<TableOperation>();
            operation.add(ops);
            operations.put(key, operation);
        }
    }
133429
public static List<String> getRowStringValues(Row row) {
    return Lists.transform(Lists.newArrayList(row.getValues()), new Function<Value, String>() {
      public String apply(Value input) {
        return Pql.toString(input);
      }
    });
  }
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);
    }
919053
def convert_row(self, keyed_row, schema, fallbacks):
        
        for key, value in list(keyed_row.items()):
            field = schema.get_field(key)
            if not field:
                del keyed_row[key]
            if key in fallbacks:
                value = _uncast_value(value, field=field)
            else:
                value = field.cast_value(value)
            keyed_row[key] = value
        return keyed_row
389376
public final void delete(Row row) {

        for (int i = indexList.length - 1; i >= 0; i--) {
            indexList[i].delete(this, row);
        }

        remove(row.getPos());
    }
123026
@Override
    protected void writeToOutput(final Map<String, Object> row)
            throws IOException {
        if (generator == null) {
            ObjectMapper mapper = new ObjectMapper();
            JsonFactory factory = new JsonFactory(mapper);
            generator = factory.createGenerator(getWriter());
            generator.writeStartArray(); // [
        }

        // Convert the row into a map
        generator.writeObject(row);
    }
900562
private RecordList loadData(AbstractDataTable table, DataSchema schema) {
        RecordListBuilder recordListBuilder = new RecordListBuilder(RecordListBuilder.CompressionMode.CANONICAL, schema);
        // simple check to ensure schema and table definitions are aligned
        if(schema.size()!= table.getNumberOfColumns()){
            final IllegalArgumentException illegalArgumentException = new IllegalArgumentException("schema row definition do not match table supplied");
            logger.log(SEVERE,"Warning:", illegalArgumentException);
        }
        int columnLength = table.getNumberOfColumns();

        // for each row
        for (int rowIndex = 0; rowIndex < table.getNumberOfRows(); rowIndex++) {
            //for each column
            String[] fields = new String[columnLength];
            for (int columnIndex = 0; columnIndex < columnLength; columnIndex++) {
                if(table.getColumnType(columnIndex) == AbstractDataTable.ColumnType.DATE){
                    Date valueDate = table.getValueDate(rowIndex, columnIndex);
                    if(valueDate == null){ continue; }
                    String dateFormatted = DateTimeFormat.getFormat(DateTimeFormat.PredefinedFormat.ISO_8601).format(valueDate);
                    fields[columnIndex] = dateFormatted;
                }else{
                    fields[columnIndex] = table.getFormattedValue(rowIndex, columnIndex);
                }
            }
            recordListBuilder.addRecord((fields));
        }
        String dataSourceHash = "";
        return recordListBuilder.createRecordList(dataSourceHash);
    }
264096
private void writeCellValue(Object value, Map<String, Integer> schema, String column, Row row) {
        if (column == null || value == null) {
            return;
        }
        Cell cell = row.getCell(schema.get(column), Row.CREATE_NULL_AS_BLANK);
        if (NumberUtils.isNumber(value.toString())) {
            cell.setCellValue(Double.parseDouble(value.toString()));
        } else {
            if (value.toString().contains("\n")) {
                cell.getCellStyle().setWrapText(true);
            }
            cell.setCellValue(value.toString());
        }
    }
1029661
def restore_row(self, row, schema, pk):
        
        result = []
        for field in schema.fields:
            if schema.primary_key and schema.primary_key[0] == field.name:
                if field.type == 'number' and np.isnan(pk):
                    pk = None
                if pk and field.type == 'integer':
                    pk = int(pk)
                result.append(field.cast_value(pk))
            else:
                value = row[field.name]
                if field.type == 'number' and np.isnan(value):
                    value = None
                if value and field.type == 'integer':
                    value = int(value)
                elif field.type == 'datetime':
                    value = value.to_pydatetime()
                result.append(field.cast_value(value))
        return result