本文整理了Java中org.apache.spark.sql.Row.getFloat
方法的一些代码示例,展示了Row.getFloat
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Row.getFloat
方法的具体详情如下:
包路径:org.apache.spark.sql.Row
类名称: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);
内容来源于网络,如有侵权,请联系作者删除!