use of org.hsqldb_voltpatches.types.BinaryData in project voltdb by VoltDB.
the class RowInputText method readBinary.
protected BinaryData readBinary() throws IOException {
String s = readString();
if (s == null) {
return null;
}
BinaryData data = scanner.convertToBinary(s);
return data;
}
use of org.hsqldb_voltpatches.types.BinaryData in project voltdb by VoltDB.
the class ExpressionValue method voltMutateToBigintType.
// A VoltDB extension to allow X'..' as numeric literals
/**
* Given a ExpressionValue that is a VARBINARY constant,
* convert it to a BIGINT constant. Returns true for a
* successful conversion and false otherwise.
*
* For more details on how the conversion is performed, see BinaryData.toLong().
*
* @param parent Reference of parent expression
* @param childIndex Index of this node in parent
* @return true for a successful conversion and false otherwise.
*/
public static boolean voltMutateToBigintType(Expression maybeConstantNode, Expression parent, int childIndex) {
if (maybeConstantNode.opType == OpTypes.VALUE && maybeConstantNode.dataType != null && maybeConstantNode.dataType.isBinaryType()) {
ExpressionValue exprVal = (ExpressionValue) maybeConstantNode;
if (exprVal.valueData == null) {
return false;
}
BinaryData data = (BinaryData) exprVal.valueData;
parent.nodes[childIndex] = new ExpressionValue(data.toLong(), Type.SQL_BIGINT);
return true;
}
return false;
}
Aggregations