org.apache.spark.sql.Row.getFloat()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中org.apache.spark.sql.Row.getFloat方法的一些代码示例,展示了Row.getFloat的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Row.getFloat方法的具体详情如下:
包路径:org.apache.spark.sql.Row
类名称:Row
方法名:getFloat

Row.getFloat介绍

暂无

代码示例

代码示例来源:origin: apache/phoenix

@Override
public float getFloat(int columnIndex) throws SQLException {
  wasNull = getCurrentRow().isNullAt(columnIndex-1);
  return wasNull ? 0 : getCurrentRow().getFloat(columnIndex-1);
}

代码示例来源:origin: cloudera-labs/envelope

@Override
public float getFloat(int arg0) {
 return internalRow.getFloat(arg0);
}

代码示例来源:origin: org.apache.spark/spark-sql_2.10

Assert.assertEquals(floatValue, simpleRow.getFloat(8), 0);
Assert.assertEquals(floatValue, simpleRow.get(8));
Assert.assertEquals(floatValue, simpleRow.getFloat(9), 0);
Assert.assertEquals(floatValue, simpleRow.get(9));
Assert.assertEquals(doubleValue, simpleRow.getDouble(10), 0);

代码示例来源:origin: org.apache.spark/spark-sql

Assert.assertEquals(floatValue, simpleRow.getFloat(8), 0);
Assert.assertEquals(floatValue, simpleRow.get(8));
Assert.assertEquals(floatValue, simpleRow.getFloat(9), 0);
Assert.assertEquals(floatValue, simpleRow.get(9));
Assert.assertEquals(doubleValue, simpleRow.getDouble(10), 0);

代码示例来源:origin: org.apache.spark/spark-sql_2.11

Assert.assertEquals(floatValue, simpleRow.getFloat(8), 0);
Assert.assertEquals(floatValue, simpleRow.get(8));
Assert.assertEquals(floatValue, simpleRow.getFloat(9), 0);
Assert.assertEquals(floatValue, simpleRow.get(9));
Assert.assertEquals(doubleValue, simpleRow.getDouble(10), 0);

代码示例来源:origin: org.datavec/datavec-spark_2.11

break;
case Float:
  ret.add(new FloatWritable(row.getFloat(i)));
  break;
case Integer:

代码示例来源:origin: org.datavec/datavec-spark

break;
case Float:
  ret.add(new FloatWritable(row.getFloat(i)));
  break;
case Integer:

代码示例来源:origin: org.datavec/datavec-spark_2.11

@Override
  public List<Writable> call(Row v1) throws Exception {
    List<Writable> ret = new ArrayList<>();
    if (v1.size() != schema.numColumns())
      throw new IllegalArgumentException("Invalid number of columns for row " + v1.size()
              + " should have matched schema columns " + schema.numColumns());
    for (int i = 0; i < v1.size(); i++) {
      if (v1.get(i) == null)
        throw new IllegalStateException("Row item " + i + " is null");
      switch (schema.getType(i)) {
        case Double:
          ret.add(new DoubleWritable(v1.getDouble(i)));
          break;
        case Float:
          ret.add(new FloatWritable(v1.getFloat(i)));
          break;
        case Integer:
          ret.add(new IntWritable(v1.getInt(i)));
          break;
        case Long:
          ret.add(new LongWritable(v1.getLong(i)));
          break;
        default:
          throw new IllegalStateException("Illegal type");
      }

    }
    return ret;
  }
}

代码示例来源:origin: org.datavec/datavec-spark

@Override
  public List<Writable> call(Row v1) throws Exception {
    List<Writable> ret = new ArrayList<>();
    if (v1.size() != schema.numColumns())
      throw new IllegalArgumentException("Invalid number of columns for row " + v1.size()
              + " should have matched schema columns " + schema.numColumns());
    for (int i = 0; i < v1.size(); i++) {
      if (v1.get(i) == null)
        throw new IllegalStateException("Row item " + i + " is null");
      switch (schema.getType(i)) {
        case Double:
          ret.add(new DoubleWritable(v1.getDouble(i)));
          break;
        case Float:
          ret.add(new FloatWritable(v1.getFloat(i)));
          break;
        case Integer:
          ret.add(new IntWritable(v1.getInt(i)));
          break;
        case Long:
          ret.add(new LongWritable(v1.getLong(i)));
          break;
        default:
          throw new IllegalStateException("Illegal type");
      }

    }
    return ret;
  }
}

代码示例来源:origin: cloudera-labs/envelope

break;
case FLOAT:
 kuduRow.addFloat(fieldName, plan.getFloat(fieldIndex));
 break;
case INT8:

代码示例来源:origin: Netflix/iceberg

return row.getLong(ord);
case FLOAT:
 return row.getFloat(ord);
case DOUBLE:
 return row.getDouble(ord);

相关文章