Java SDK Documentation  11.0.1
com.vertica.sdk.ParamWriter Class Reference
Inheritance diagram for com.vertica.sdk.ParamWriter:
Inheritance graph
Collaboration diagram for com.vertica.sdk.ParamWriter:
Collaboration graph

Public Member Functions

 ParamWriter (ParamReader params)
 
void addCol (ByteBuffer arg, int colstride, VerticaType dt, String colName)
 
void addCol (ByteBuffer arg, int colstride, VerticaType dt)
 
void addCol (ByteBuffer arg, ByteBuffer da, int colstride, VerticaType dt)
 
void addCol (ByteBuffer arg, ByteBuffer da, int colstride, VerticaType dt, String colName)
 
boolean checkStringUserBlockInfo (int idx)
 
boolean checkTimeUserBlockInfo (int idx)
 
void clearParameter (String fieldName)
 
boolean containsParameter (String paramName)
 
boolean getBoolean (int idx)
 
boolean getBoolean (String paramName) throws UdfException
 
ByteBuffer getColDataAreaRef (int idx)
 
ByteBuffer getColRef (int idx)
 
java.sql.Date getDate (String paramName) throws UdfException
 
java.sql.Date getDate (int idx)
 
double getDouble (int idx)
 
double getDouble (String paramName) throws UdfException
 
int getIndex (String paramName) throws UdfException
 
long getLong (int idx)
 
long getLong (String paramName) throws UdfException
 
int getNumCols ()
 
int getNumRows ()
 
ArrayList< String > getParamNames ()
 
BaseDataOID getProcessBlockUserInfoVectorAt (int i)
 
String getString (String paramName) throws UdfException
 
String getString (int idx)
 
int getStringLength (String paramName) throws UdfException
 
int getStringLength (int idx)
 
int getStringLoc (int idx)
 
java.sql.Timestamp getTimestamp (String paramName) throws UdfException
 
java.sql.Timestamp getTimestamp (int idx)
 
VerticaType getType (String paramName) throws UdfException
 
SizedColumnTypes getTypeMetaData ()
 
VNumeric getVNumeric (String paramName) throws UdfException
 
VNumeric getVNumeric (int idx)
 
VString getVString (String paramName) throws UdfException
 
VString getVString (int idx)
 
boolean isBooleanNull (int idx)
 
boolean isBooleanNull (String paramName) throws UdfException
 
boolean isDateNull (String paramName) throws UdfException
 
boolean isDateNull (int idx)
 
boolean isDoubleNull (int idx)
 
boolean isDoubleNull (String paramName) throws UdfException
 
boolean isEmpty ()
 
boolean isLongNull (int idx)
 
boolean isLongNull (String paramName) throws UdfException
 
boolean isStringNull (String paramName) throws UdfException
 
boolean isStringNull (int idx)
 
boolean isTimestampInfinite (String paramName) throws UdfException
 
boolean isTimestampInfinite (int idx)
 
boolean isTimestampInfiniteNeg (String paramName) throws UdfException
 
boolean isTimestampInfiniteNeg (int idx)
 
boolean isTimestampInfinitePos (String paramName) throws UdfException
 
boolean isTimestampInfinitePos (int idx)
 
boolean isTimestampNull (String paramName) throws UdfException
 
boolean isTimestampNull (int idx)
 
boolean next () throws UdfException, DestroyInvocation
 
void resetBuffers ()
 
void setBool (String fieldName, boolean r) throws UdfException
 Adds a BOOLEAN value to the output row. More...
 
void setDate (String fieldName, java.sql.Date r) throws UdfException
 Adds a DATE value to the output row. More...
 
void setDouble (String fieldName, double r) throws UdfException
 Adds a FLOAT value to the output row. More...
 
void setLong (String fieldName, Long r) throws UdfException
 Adds a LONG INTEGER value to the output row. More...
 
void setLongString (String fieldName, String r) throws UdfException
 Adds a Long String value to the output row. More...
 
void setNumeric (String fieldName, BigDecimal bd)
 Allocate a new VNumeric object to use as output. More...
 
void setString (String fieldName, String r) throws UdfException
 Adds a String value to the output row. More...
 
void setTimestamp (String fieldName, java.sql.Timestamp r) throws UdfException
 Adds a TIMESTAMP value to the output row. More...
 
void setTimestampInfiniteNeg (String fieldName) throws UdfException
 
void setTimestampInfinitePos (String fieldName) throws UdfException
 

Public Attributes

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

Protected Member Functions

void clear ()
 
ByteBuffer getInlineColBuffer (int idx)
 

Protected Attributes

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

Detailed Description

Provides write access to a set of named parameters. This class extends ParamReader to add type-specific methods to write values.

Member Function Documentation

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

Add the location for reading a particular argument.

Parameters
argThe base location to find data.
colstrideThe stride between data instances.
dtThe type of input.
colNameName of the column

Referenced by com.vertica.sdk.VerticaBlock.addCol().

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

Add the location for reading a particular argument.

Parameters
argThe base location to find data.
colstrideThe stride between data instances.
dtThe type of input.
void com.vertica.sdk.VerticaBlock.addCol ( ByteBuffer  arg,
ByteBuffer  da,
int  colstride,
VerticaType  dt 
)
inherited

Add the location for reading a particular argument.

Parameters
argThe base location to find data.
daThe location to find out of band string data.
colstrideThe stride between data instances.
dtThe type of input.
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
argThe base location to find data.
daThe location to find out of band string data.
colstrideThe stride between data instances.
dtThe type of input.
colNameName of the column
boolean com.vertica.sdk.ParamReader.containsParameter ( String  paramName)
inherited

Function to see if the ParamReader has a value for the parameter

Parameters
paramNameparameter name to check
Returns
true if it does
boolean com.vertica.sdk.BlockReader.getBoolean ( int  idx)
inherited

Get a BOOLEAN value from the input row.

Parameters
idxThe 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
idxThe column number to retrieve from the input row.
Returns
the ByteBuffer

Referenced by com.vertica.sdk.BlockReader.getVString().

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

Example: ByteBuffer a = arg_reader.getColPtr(0);

Parameters
idxThe column number to retrieve from the input row.
Returns
a ByteBuffer to the idx'th argument, containing data for the column

Referenced by com.vertica.sdk.PartitionWriter.copyFromInput(), com.vertica.sdk.BlockReader.getBoolean(), com.vertica.sdk.BlockReader.getDouble(), com.vertica.sdk.VerticaBlock.getInlineColBuffer(), com.vertica.sdk.BlockReader.getLong(), com.vertica.sdk.BlockReader.getStringLength(), com.vertica.sdk.BlockReader.getStringLoc(), com.vertica.sdk.BlockReader.getVNumeric(), com.vertica.sdk.BlockReader.getVString(), com.vertica.sdk.BlockWriter.getVStringWriter(), com.vertica.sdk.BlockReader.isBooleanNull(), com.vertica.sdk.ParamWriter.setBool(), com.vertica.sdk.BlockWriter.setBoolean(), com.vertica.sdk.BlockWriter.setBooleanNull(), com.vertica.sdk.PartitionWriter.setBooleanValue(), com.vertica.sdk.BlockWriter.setDate(), com.vertica.sdk.BlockWriter.setDateNull(), com.vertica.sdk.PartitionWriter.setDateValue(), com.vertica.sdk.BlockWriter.setDouble(), com.vertica.sdk.ParamWriter.setDouble(), com.vertica.sdk.BlockWriter.setDoubleNull(), com.vertica.sdk.PartitionWriter.setDoubleValue(), com.vertica.sdk.BlockWriter.setLong(), com.vertica.sdk.ParamWriter.setLong(), com.vertica.sdk.BlockWriter.setLongNull(), com.vertica.sdk.ParamWriter.setLongString(), com.vertica.sdk.PartitionWriter.setLongValue(), com.vertica.sdk.ParamWriter.setNumeric(), com.vertica.sdk.BlockWriter.setNumeric(), com.vertica.sdk.ParamWriter.setString(), com.vertica.sdk.BlockWriter.setString(), com.vertica.sdk.BlockWriter.setStringNull(), com.vertica.sdk.BlockWriter.setTimestamp(), com.vertica.sdk.BlockWriter.setTimestampInfiniteNeg(), com.vertica.sdk.BlockWriter.setTimestampInfinitePos(), com.vertica.sdk.BlockWriter.setTimestampNull(), and com.vertica.sdk.PartitionWriter.setTimestampValue().

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

Get a DATE value from the input row.

Parameters
idxThe 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
idxThe column number to retrieve from the input row.
Returns
The value of the idx'th argument, cast as a DOUBLE.
ByteBuffer com.vertica.sdk.VerticaBlock.getInlineColBuffer ( int  idx)
protectedinherited

Give a ByteBuffer for the given column (inline storage only). Returns a buffer with position and limit bounding the data area for a single element of that column, given the current position in the column.

Parameters
idxThe column number to retrieve from the input row.
Returns
the ByteBuffer for the column

Referenced by com.vertica.sdk.PartitionWriter.setStringBytes(), and com.vertica.sdk.PartitionWriter.setStringValue().

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

Get a LONG INTEGER value from the input row.

Example: long a = arg_reader.getLong(0);

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

Referenced by com.vertica.sdk.BlockReader.getDate(), com.vertica.sdk.BlockReader.getTimestamp(), com.vertica.sdk.BlockReader.isDoubleNull(), com.vertica.sdk.BlockReader.isLongNull(), com.vertica.sdk.BlockReader.isTimestampInfiniteNeg(), and com.vertica.sdk.BlockReader.isTimestampInfinitePos().

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.
ArrayList<String> com.vertica.sdk.ParamReader.getParamNames ( )
inherited
Returns
all names of parameters stored in this ParamReader
String com.vertica.sdk.BlockReader.getString ( int  idx)
inherited

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

Parameters
idxThe 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
idxThe column number to retrieve from the input row.
Returns
The length of the String in specified column.

Referenced by com.vertica.sdk.BlockReader.getVString(), and com.vertica.sdk.BlockReader.isStringNull().

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

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

Parameters
idxThe 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.

Referenced by com.vertica.sdk.BlockReader.getVString().

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

Get a TIMESTAMP value from the input row.

Parameters
idxThe 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
inherited
Parameters
paramNameparameter name
Returns
the type of the given parameter
Exceptions
UdfExceptionUDF problem
SizedColumnTypes com.vertica.sdk.VerticaBlock.getTypeMetaData ( )
inherited
Returns
information about the types and numbers of arguments

Referenced by com.vertica.sdk.ParamReader.getType(), com.vertica.sdk.PartitionWriter.setRowFromMap(), and com.vertica.sdk.PartitionWriter.setValue().

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

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

Parameters
idxThe 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
idxThe column number to retrieve from the input row.
Returns
a reference to the idx'th argument, cast as an VString.

Referenced by com.vertica.sdk.BlockReader.getString().

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

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

Parameters
idxThe 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
idxThe column number to retrieve from the input row.
Returns
true if the value is NULL, false otherwise.

Referenced by com.vertica.sdk.BlockReader.getDate().

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

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

Parameters
idxThe column number to retrieve from the input row.
Returns
true if the value is NULL, false otherwise.
boolean com.vertica.sdk.ParamReader.isEmpty ( )
inherited
Returns
true if there are no parameters
boolean com.vertica.sdk.BlockReader.isLongNull ( int  idx)
inherited

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

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

Referenced by com.vertica.sdk.BlockReader.isDateNull(), and com.vertica.sdk.BlockReader.isTimestampNull().

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
idxThe column number to retrieve from the input row.
Returns
true if the value is NULL, false otherwise.

Referenced by com.vertica.sdk.BlockReader.getString().

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

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

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

Referenced by com.vertica.sdk.BlockReader.getTimestamp().

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

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

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

Referenced by com.vertica.sdk.BlockReader.isTimestampInfinite().

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

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

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

Referenced by com.vertica.sdk.BlockReader.isTimestampInfinite().

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

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

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

Referenced by com.vertica.sdk.BlockReader.getTimestamp().

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.
Exceptions
UdfExceptionUDF problem
DestroyInvocationInvocation needed to be destroyed
void com.vertica.sdk.ParamWriter.setBool ( String  fieldName,
boolean  r 
) throws UdfException

Adds a BOOLEAN value to the output row.

Parameters
rThe BOOLEAN value to insert into the output row.
void com.vertica.sdk.ParamWriter.setDate ( String  fieldName,
java.sql.Date  r 
) throws UdfException

Adds a DATE value to the output row.

Parameters
rThe DATE value to insert into the output row.
void com.vertica.sdk.ParamWriter.setDouble ( String  fieldName,
double  r 
) throws UdfException

Adds a FLOAT value to the output row.

Parameters
rThe FLOAT value to insert into the output row.
void com.vertica.sdk.ParamWriter.setLong ( String  fieldName,
Long  r 
) throws UdfException

Adds a LONG INTEGER value to the output row.

Parameters
rThe LONG INTEGER value to insert into the output row.

Referenced by com.vertica.sdk.ParamWriter.setDate(), and com.vertica.sdk.ParamWriter.setTimestamp().

void com.vertica.sdk.ParamWriter.setLongString ( String  fieldName,
String  r 
) throws UdfException

Adds a Long String value to the output row.

Parameters
rThe Long String value to insert into the output row.
void com.vertica.sdk.ParamWriter.setNumeric ( String  fieldName,
BigDecimal  bd 
)

Allocate a new VNumeric object to use as output.

Returns
A new VNumeric object to hold output. This object automatically added to the output row.
void com.vertica.sdk.ParamWriter.setString ( String  fieldName,
String  r 
) throws UdfException

Adds a String value to the output row.

Parameters
rThe String value to insert into the output row.
void com.vertica.sdk.ParamWriter.setTimestamp ( String  fieldName,
java.sql.Timestamp  r 
) throws UdfException

Adds a TIMESTAMP value to the output row.

Parameters
rThe TIMESTAMP value to insert into the output row.