Package cascading.tuple

Examples of cascading.tuple.Fields


      throw new IllegalArgumentException("may only have one key field, found: " + keyField.print());
    }
  }

  private void setSourceSink(Fields keyFields, Fields[] columnFields) {
    Fields allFields = keyFields;

    if (columnFields.length != 0) {
      allFields = Fields.join(keyFields, Fields.join(columnFields)); // prepend
    }
View Full Code Here


    result.add(keyWritable.get());

    for (int i = 0; i < this.familyNames.length; i++) {
      String familyName = this.familyNames[i];
      byte[] familyNameBytes = Bytes.toBytes(familyName);
      Fields fields = this.valueFields[i];
      for (int k = 0; k < fields.size(); k++) {
        String fieldName = (String) fields.get(k);
        byte[] fieldNameBytes = Bytes.toBytes(fieldName);
        byte[] cellValue = row.getValue(familyNameBytes, fieldNameBytes);
        result.add(cellValue);
      }
    }
View Full Code Here

    Tuple key = tupleEntry.selectTuple(keyField);
    byte[] keyBytes = Bytes.toBytes(key.getString(0));
    Put put = new Put(keyBytes);

    for (int i = 0; i < valueFields.length; i++) {
      Fields fieldSelector = valueFields[i];
      TupleEntry values = tupleEntry.selectEntry(fieldSelector);
     
      for (int j = 0; j < values.getFields().size(); j++) {
        Fields fields = values.getFields();
        Tuple tuple = values.getTuple();

        String value = tuple.getString(j);
        byte[] asBytes = value == null ? null : Bytes.toBytes(value);
        put.add(Bytes.toBytes(familyNames[i]), Bytes.toBytes((String) fields.get(j)), asBytes);
      }
    }

    outputCollector.collect(null, put);
  }
View Full Code Here

    columns = new String[size];

    int count = 0;

    for (int i = 0; i < fieldsArray.length; i++) {
      Fields fields = fieldsArray[i];

      for (int j = 0; j < fields.size(); j++) {
        if (familyNames == null) { columns[count++] = hbaseColumn((String) fields.get(j)); } else {
          columns[count++] = hbaseColumn(familyNames[i]) + (String) fields.get(j);
        }
      }
    }

    return columns;
View Full Code Here

     * @param limit             of type long
     * @param updateBy          of type String[]
     */
    public JDBCScheme( Class<? extends DBInputFormat> inputFormatClass, Class<? extends DBOutputFormat> outputFormatClass, String[] columns, String[] orderBy, String conditions, long limit, String[] updateBy )
    {
        this( inputFormatClass, outputFormatClass, new Fields( columns ), columns, orderBy, conditions, limit, updateBy != null ? new Fields( updateBy ) : null, updateBy );
    }
View Full Code Here

     *
     * @param columns of type String[]
     */
    public JDBCScheme( String[] columns )
    {
        this( null, null, new Fields( columns ), columns, null, null, null );
    }
View Full Code Here

     * @param countQuery       of type String
     * @param limit            of type long
     */
    public JDBCScheme( Class<? extends DBInputFormat> inputFormatClass, String[] columns, String selectQuery, String countQuery, long limit )
    {
        this( inputFormatClass, new Fields( columns ), columns, selectQuery, countQuery, limit );
    }
View Full Code Here

     * @param countQuery  of type String
     * @param limit       of type long
     */
    public JDBCScheme( String[] columns, String selectQuery, String countQuery, long limit )
    {
        this( null, new Fields( columns ), columns, selectQuery, countQuery, limit );
    }
View Full Code Here

     * @param selectQuery of type String
     * @param countQuery  of type String
     */
    public JDBCScheme( String[] columns, String selectQuery, String countQuery )
    {
        this( null, new Fields( columns ), columns, selectQuery, countQuery, -1 );
    }
View Full Code Here

        }
    }
   
    protected void testSchemeChecksMissingConf() throws Exception {
        try {
            makeScheme(new Fields("a", "b"), "bogus-directory");
            fail("Should have thrown exception");
        } catch (Exception e) {
        }
    }
View Full Code Here

TOP

Related Classes of cascading.tuple.Fields

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.