com.datastax.driver.core.Row.getDecimal()方法的使用及代码示例

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

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

Row.getDecimal介绍

[英]Returns the ith value of this row as a variable length decimal.
[中]以可变长度小数形式返回此行的第i个值。

代码示例

代码示例来源:origin: prestodb/presto

@Override
public double getDouble(int i)
{
  switch (getCassandraType(i)) {
    case DOUBLE:
      return currentRow.getDouble(i);
    case FLOAT:
      return currentRow.getFloat(i);
    case DECIMAL:
      return currentRow.getDecimal(i).doubleValue();
    default:
      throw new IllegalStateException("Cannot retrieve double for " + getCassandraType(i));
  }
}

代码示例来源:origin: prestodb/presto

return Float.toString(row.getFloat(i));
case DECIMAL:
  return row.getDecimal(i).toString();
case UUID:
case TIMEUUID:

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

return row.getDecimal(col);

代码示例来源:origin: prestodb/presto

return NullableValue.of(nativeType, (long) floatToRawIntBits(row.getFloat(i)));
case DECIMAL:
  return NullableValue.of(nativeType, row.getDecimal(i).doubleValue());
case UUID:
case TIMEUUID:

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

private void assertRow(Row row) {
  assertThat(row.getInt(0)).isEqualTo(n_int);
  assertThat(row.getLong(1)).isEqualTo(n_bigint);
  assertThat(row.getFloat(2)).isEqualTo(n_float);
  assertThat(row.getDouble(3)).isEqualTo(n_double);
  assertThat(row.getVarint(4)).isEqualTo(n_varint);
  assertThat(row.getDecimal(5)).isEqualTo(n_decimal);
  // with getObject
  assertThat(row.getObject(0)).isEqualTo(n_int);
  assertThat(row.getObject(1)).isEqualTo(n_bigint);
  assertThat(row.getObject(2)).isEqualTo(n_float);
  assertThat(row.getObject(3)).isEqualTo(n_double);
  assertThat(row.getObject(4)).isEqualTo(n_varint);
  assertThat(row.getObject(5)).isEqualTo(n_decimal);
  // with get + type
  assertThat(row.get(0, Integer.class)).isEqualTo(n_int);
  assertThat(row.get(1, Long.class)).isEqualTo(n_bigint);
  assertThat(row.get(2, Float.class)).isEqualTo(n_float);
  assertThat(row.get(3, Double.class)).isEqualTo(n_double);
  assertThat(row.get(4, BigInteger.class)).isEqualTo(n_varint);
  assertThat(row.get(5, BigDecimal.class)).isEqualTo(n_decimal);
 }
}

代码示例来源:origin: Impetus/Kundera

retVal = row.getDecimal(columnName);
setFieldValue(entity, member, retVal);
break;

代码示例来源:origin: org.apache.cassandra/cassandra-all

@Override
public BigDecimal getDecimal(int i)
{
  return row.getDecimal(i);
}

代码示例来源:origin: jsevellec/cassandra-unit

@Override
public BigDecimal getDecimal(int i)
{
  return row.getDecimal(i);
}

代码示例来源:origin: jsevellec/cassandra-unit

@Override
public BigDecimal getDecimal(String name)
{
  return row.getDecimal(name);
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

@Override
public BigDecimal getDecimal(int i)
{
  return row.getDecimal(i);
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

@Override
public BigDecimal getDecimal(int i)
{
  return row.getDecimal(i);
}

代码示例来源:origin: org.apache.cassandra/cassandra-all

@Override
public BigDecimal getDecimal(String name)
{
  return row.getDecimal(name);
}

代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server

@Override
public BigDecimal getDecimal(String name)
{
  return row.getDecimal(name);
}

代码示例来源:origin: com.tuplejump/calliope-core

@Override
public BigDecimal getDecimal(int i) {
  return row.getDecimal(i);
}

代码示例来源:origin: com.strapdata.cassandra/cassandra-all

@Override
public BigDecimal getDecimal(String name)
{
  return row.getDecimal(name);
}

代码示例来源:origin: com.datastax.cassandra/cassandra-driver-core

assertThat(row.getDouble(3)).isEqualTo(n_double);
assertThat(row.getVarint(4)).isEqualTo(n_varint);
assertThat(row.getDecimal(5)).isEqualTo(n_decimal);

代码示例来源:origin: adejanovski/cassandra-jdbc-wrapper

public BigDecimal getBigDecimal(String name) throws SQLException
{
  checkName(name);
  return currentRow.getDecimal(name);
}

代码示例来源:origin: adejanovski/cassandra-jdbc-wrapper

/** @deprecated */
public BigDecimal getBigDecimal(String name, int scale) throws SQLException
{
  checkName(name);
  return currentRow.getDecimal(name).setScale(scale);
}

代码示例来源:origin: boneill42/spark-on-cassandra-quickstart

@Override
  public Summary read(Row row, String[] columnNames) {
    Summary summary = new Summary();
    summary.setProduct(row.getInt(0));
    summary.setSummary(row.getDecimal(1));
    return summary;
  }
}

代码示例来源:origin: boneill42/spark-on-cassandra-quickstart

@Override
  public Sale read(Row row, String[] columnNames) {
    Sale sale = new Sale();
    sale.setId(row.getUUID(0));
    sale.setPrice(row.getDecimal(1));
    sale.setProduct(row.getInt(2));
    return sale;
  }
}

相关文章