Package org.apache.tajo.datum

Examples of org.apache.tajo.datum.Datum.asBool()


  @Override
  public boolean getBoolean(int fieldId) throws SQLException {
    Datum datum = cur.get(fieldId - 1);
    handleNull(datum);
    return datum.asBool();
  }

  @Override
  public boolean getBoolean(String colName) throws SQLException {
    Datum datum = cur.get(findColumn(colName));
View Full Code Here


  @Override
  public boolean getBoolean(String colName) throws SQLException {
    Datum datum = cur.get(findColumn(colName));
    handleNull(datum);
    return datum.asBool();
  }

  @Override
  public byte getByte(int fieldId) throws SQLException {
    Datum datum = cur.get(fieldId - 1);
View Full Code Here

    handleNull(d);

    TajoDataTypes.Type dataType = schema.getColumn(fieldId - 1).getDataType().getType();

    switch(dataType) {
      case BOOLEAN:  return d.asBool();
      case INT1:
      case INT2: return d.asInt2();
      case INT4: return d.asInt4();
      case INT8: return d.asInt8();
      case TEXT:
View Full Code Here

   */
  @Override
  public boolean getBoolean(int fieldId) throws SQLException {
    Datum datum = cur.get(fieldId - 1);
    handleNull(datum);
    return datum.asBool();
  }

  /*
   * (non-Javadoc)
   *
 
View Full Code Here

   */
  @Override
  public boolean getBoolean(String colName) throws SQLException {
    Datum datum = cur.get(findColumn(colName));
    handleNull(datum);
    return datum.asBool();
  }

  /*
   * (non-Javadoc)
   *
 
View Full Code Here

            case BOOLEAN: {
              datum = tuple.get(i);
              if (datum instanceof NullDatum) {
                //null datum is zero length byte array
              } else {
                outputStream.write(datum.asBool() ? trueBytes : falseBytes);   //Compatibility with Apache Hive
              }
              break;
            }
            case NULL:
              break;
View Full Code Here

  }

  @Override
  public Datum eval(Schema schema, Tuple tuple) {
    Datum datum = childEval.eval(schema, tuple);
    return !datum.isNull() ? DatumFactory.createBool(!datum.asBool()) : datum;
  }

  @Override
  public String toString() {
    return "NOT " + childEval.toString();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.