com.vertica.sdk.ParamReader Class Reference

A wrapper around Parameters that have a name->value correspondence. More...

Inheritance diagram for com.vertica.sdk.ParamReader:

com.vertica.sdk.BlockReader com.vertica.sdk.VerticaBlock com.vertica.sdk.ParamWriter List of all members.

Public Member Functions

void addCol (ByteBuffer arg, ByteBuffer da, int colstride, VerticaType dt, String colName)
void addCol (ByteBuffer arg, ByteBuffer da, int colstride, VerticaType dt)
void addCol (ByteBuffer arg, int colstride, VerticaType dt)
void addCol (ByteBuffer arg, int colstride, VerticaType dt, String colName)
boolean containsParameter (String paramName)
 Function to see if the ParamReader has a value for the parameter.
boolean getBoolean (int idx)
 Get a BOOLEAN value from the input row.
boolean getBoolean (String paramName) throws UdfException
ByteBuffer getColDataAreaRef (int idx)
ByteBuffer getColRef (int idx)
java.sql.Date getDate (int idx)
 Get a DATE value from the input row.
java.sql.Date getDate (String paramName) throws UdfException
double getDouble (int idx)
 Get a DOUBLE value from the input row.
double getDouble (String paramName) throws UdfException
int getIndex (String paramName) throws UdfException
long getLong (int idx)
 Get a LONG INTEGER value from the input row.
long getLong (String paramName) throws UdfException
int getNumCols ()
int getNumRows ()
ArrayList< String > getParamNames ()
 Return all names of parameters stored in this ParamReader.
String getString (int idx)
 Get a reference to an VARCHAR/CHAR/VARBINARY/BINARY value from the input row.
String getString (String paramName) throws UdfException
int getStringLength (int idx)
 Get length of the String from the input row.
int getStringLength (String paramName) throws UdfException
int getStringLoc (int idx)
 Get 'location' of the String from the input row.
java.sql.Timestamp getTimestamp (int idx)
 Get a TIMESTAMP value from the input row.
java.sql.Timestamp getTimestamp (String paramName) throws UdfException
VerticaType getType (String paramName) throws UdfException
 Return the type of the given parameter.
SizedColumnTypes getTypeMetaData ()
VNumeric getVNumeric (int idx)
 Get a reference to a VNumeric value from the input row.
VNumeric getVNumeric (String paramName) throws UdfException
VString getVString (int idx)
 Get a reference from the input row to an VString value, which represents a SQL VARCHAR/CHAR/VARBINARY/BINARY value.
VString getVString (String paramName) throws UdfException
boolean isBooleanNull (int idx)
 Check whether a value from the input row is NULL in BOOLEAN type.
boolean isBooleanNull (String paramName) throws UdfException
boolean isDateNull (int idx)
 Check whether a value from the input row is NULL in DATE type.
boolean isDateNull (String paramName) throws UdfException
boolean isDoubleNull (int idx)
 Check whether a value from the input row is NULL in DOUBLE type.
boolean isDoubleNull (String paramName) throws UdfException
boolean isEmpty ()
 Returns true if there are no parameters.
boolean isLongNull (int idx)
 Check whether a value from the input row is NULL in LONG INTERGER type.
boolean isLongNull (String paramName) throws UdfException
boolean isStringNull (int idx)
 Check whether a value from the input row is NULL in SQL VARCHAR/CHAR/VARBINARY/BINARY type.
boolean isStringNull (String paramName) throws UdfException
boolean isTimestampInfinite (int idx)
 Check whether a TIMESTAMP value from the input row represents 'infinity'.
boolean isTimestampInfinite (String paramName) throws UdfException
boolean isTimestampInfiniteNeg (int idx)
 Check whether a TIMESTAMP value from the input row represents '-infinity'.
boolean isTimestampInfiniteNeg (String paramName) throws UdfException
boolean isTimestampInfinitePos (int idx)
 Check whether a TIMESTAMP value from the input row represents '+infinity'.
boolean isTimestampInfinitePos (String paramName) throws UdfException
boolean isTimestampNull (int idx)
 Check whether a value from the input row is NULL in TIMESTAMP type.
boolean isTimestampNull (String paramName) throws UdfException
boolean next () throws UdfException, DestroyInvocation
void resetBuffers ()

Public Attributes

int count
int index
int ncols
HashMap< String, Integer > paramNameToIndex
SizedColumnTypes typeMetaData

Protected Member Functions

void clear ()

Protected Attributes

ArrayList< ByteBuffer > coldataareas
ArrayList< ByteBuffer > cols
ArrayList< Integer > colstrides
ArrayList< Integer > currentPos

Package Functions

void addParameter (String paramName, ByteBuffer arg, VerticaType dt)

Detailed Description

A wrapper around Parameters that have a name->value correspondence.


Member Function Documentation

void com.vertica.sdk.VerticaBlock.addCol ( ByteBuffer  arg,
ByteBuffer  da,
int  colstride,
VerticaType  dt,
String  colName 
) [inherited]

Add the location for reading a particular argument.

Parameters:
arg The base location to find data.
da The location to find out of band string data.
colstride The stride between data instances.
dt The type of input.
colName Name of the column

void com.vertica.sdk.VerticaBlock.addCol ( ByteBuffer  arg,
ByteBuffer  da,
int  colstride,
VerticaType  dt 
) [inherited]

Add the location for reading a particular argument.

Parameters:
arg The base location to find data.
da The location to find out of band string data.
colstride The stride between data instances.
dt The type of input.

void com.vertica.sdk.VerticaBlock.addCol ( ByteBuffer  arg,
int  colstride,
VerticaType  dt 
) [inherited]

Add the location for reading a particular argument.

Parameters:
arg The base location to find data.
colstride The stride between data instances.
dt The type of input.

void com.vertica.sdk.VerticaBlock.addCol ( ByteBuffer  arg,
int  colstride,
VerticaType  dt,
String  colName 
) [inherited]

Add the location for reading a particular argument.

Parameters:
arg The base location to find data.
colstride The stride between data instances.
dt The type of input.
colName Name of the column

void com.vertica.sdk.ParamReader.addParameter ( String  paramName,
ByteBuffer  arg,
VerticaType  dt 
) [package]

Add a parameter to the block and stores it name and corresponding index in the paramNameToIndex map

boolean com.vertica.sdk.BlockReader.getBoolean ( int  idx  )  [inherited]

Get a BOOLEAN value from the input row.

Parameters:
idx The column number to retrieve from the input row.
Returns:
The value of the idx'th argument, cast as a BOOLEAN.

ByteBuffer com.vertica.sdk.VerticaBlock.getColDataAreaRef ( int  idx  )  [inherited]

Get the ByteBuffer that stores out of line string data (Data Area) for the idx'th argument

Parameters:
idx 
Returns:

ByteBuffer com.vertica.sdk.VerticaBlock.getColRef ( int  idx  )  [inherited]

Returns:
a ByteBuffer to the idx'th argument, containing data for the column
Example:

 ByteBuffer a = arg_reader.getColPtr(0);

java.sql.Date com.vertica.sdk.BlockReader.getDate ( int  idx  )  [inherited]

Get a DATE value from the input row.

Parameters:
idx The column number to retrieve from the input row.
Returns:
The value of the idx'th argument, cast as a DATE; null if the column is NULL.

double com.vertica.sdk.BlockReader.getDouble ( int  idx  )  [inherited]

Get a DOUBLE value from the input row.

Parameters:
idx The column number to retrieve from the input row.
Returns:
The value of the idx'th argument, cast as a DOUBLE.

long com.vertica.sdk.BlockReader.getLong ( int  idx  )  [inherited]

Get a LONG INTEGER value from the input row.

Parameters:
idx The column number to retrieve from the input row.
Returns:
The value of the idx'th argument, cast as a LONG INTEGER.
Example:

 long a = arg_reader.getLong(0);

int com.vertica.sdk.VerticaBlock.getNumCols (  )  [inherited]

Returns:
the number of arguments held by this reader.

int com.vertica.sdk.VerticaBlock.getNumRows (  )  [inherited]

Returns:
the number of rows held by this block.

String com.vertica.sdk.BlockReader.getString ( int  idx  )  [inherited]

Get a reference to an VARCHAR/CHAR/VARBINARY/BINARY value from the input row.

Parameters:
idx The column number to retrieve from the input row.
Returns:
a reference to the idx'th argument, cast as an String.

int com.vertica.sdk.BlockReader.getStringLength ( int  idx  )  [inherited]

Get length of the String from the input row.

Parameters:
idx The column number to retrieve from the input row.
Returns:
The length of the String in specified column.

int com.vertica.sdk.BlockReader.getStringLoc ( int  idx  )  [inherited]

Get 'location' of the String from the input row.

Parameters:
idx The column number to retrieve from the input row.
Returns:
The location of the String in specified column. If zero, data is inlined immediately after the header, otherwise data is at offset loc within the data area.

java.sql.Timestamp com.vertica.sdk.BlockReader.getTimestamp ( int  idx  )  [inherited]

Get a TIMESTAMP value from the input row.

Parameters:
idx The column number to retrieve from the input row.
Returns:
The value of the idx'th argument, cast as a TIMESTAMP; null if the column is NULL or represents 'infinity'.

VerticaType com.vertica.sdk.ParamReader.getType ( String  paramName  )  throws UdfException

Return the type of the given parameter.

Exceptions:
UdfException 

SizedColumnTypes com.vertica.sdk.VerticaBlock.getTypeMetaData (  )  [inherited]

Returns:
information about the types and numbers of arguments

VNumeric com.vertica.sdk.BlockReader.getVNumeric ( int  idx  )  [inherited]

Get a reference to a VNumeric value from the input row.

Parameters:
idx The column number to retrieve from the input row.
Returns:
A reference to the retrieved value cast as a Numeric.

VString com.vertica.sdk.BlockReader.getVString ( int  idx  )  [inherited]

Get a reference from the input row to an VString value, which represents a SQL VARCHAR/CHAR/VARBINARY/BINARY value.

Parameters:
idx The column number to retrieve from the input row.
Returns:
a reference to the idx'th argument, cast as an VString.

boolean com.vertica.sdk.BlockReader.isBooleanNull ( int  idx  )  [inherited]

Check whether a value from the input row is NULL in BOOLEAN type.

Parameters:
idx The column number to retrieve from the input row.
Returns:
true if the value is NULL, false otherwise.

boolean com.vertica.sdk.BlockReader.isDateNull ( int  idx  )  [inherited]

Check whether a value from the input row is NULL in DATE type.

Parameters:
idx The column number to retrieve from the input row.
Returns:
true if the value is NULL, false otherwise.

boolean com.vertica.sdk.BlockReader.isDoubleNull ( int  idx  )  [inherited]

Check whether a value from the input row is NULL in DOUBLE type.

Parameters:
idx The column number to retrieve from the input row.
Returns:
true if the value is NULL, false otherwise.

boolean com.vertica.sdk.BlockReader.isLongNull ( int  idx  )  [inherited]

Check whether a value from the input row is NULL in LONG INTERGER type.

Parameters:
idx The column number to retrieve from the input row.
Returns:
true if the value is NULL, false otherwise.

boolean com.vertica.sdk.BlockReader.isStringNull ( int  idx  )  [inherited]

Check whether a value from the input row is NULL in SQL VARCHAR/CHAR/VARBINARY/BINARY type.

Parameters:
idx The column number to retrieve from the input row.
Returns:
true if the value is NULL, false otherwise.

boolean com.vertica.sdk.BlockReader.isTimestampInfinite ( int  idx  )  [inherited]

Check whether a TIMESTAMP value from the input row represents 'infinity'.

Parameters:
idx The column number to retrieve from the input row.
Returns:
true if the TIMESTAMP value is '+infinity' or '-infinity', false otherwise.

boolean com.vertica.sdk.BlockReader.isTimestampInfiniteNeg ( int  idx  )  [inherited]

Check whether a TIMESTAMP value from the input row represents '-infinity'.

Parameters:
idx The column number to retrieve from the input row.
Returns:
true if the TIMESTAMP value is '-infinity', false otherwise.

boolean com.vertica.sdk.BlockReader.isTimestampInfinitePos ( int  idx  )  [inherited]

Check whether a TIMESTAMP value from the input row represents '+infinity'.

Parameters:
idx The column number to retrieve from the input row.
Returns:
true if the TIMESTAMP value is '+infinity', false otherwise.

boolean com.vertica.sdk.BlockReader.isTimestampNull ( int  idx  )  [inherited]

Check whether a value from the input row is NULL in TIMESTAMP type.

Parameters:
idx The column number to retrieve from the input row.
Returns:
true if the value is NULL, false otherwise.

boolean com.vertica.sdk.BlockReader.next (  )  throws UdfException, DestroyInvocation [inherited]

Advance to the next record.

Returns:
true if there are more rows to read, false otherwise.

Reimplemented in com.vertica.sdk.PartitionReader.