public abstract class RecordBase extends Object implements Record
Record
. Derived classes must at a minimum implement the
Record.getType()
, Record.get(int)
, and Record.put(int, Object)
methods.Constructor and Description |
---|
RecordBase() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Object |
get(String name)
Returns the value of the specified field.
|
Object |
getArray(int index)
For string columns with array property, return a native Java array of the appropriate type:
Boolean[], Integer[], Long[], Float[], Double[], BigInteger[], or String[].
|
Object |
getArray(String name)
For string columns with array property, return a native Java array of the appropriate type:
Boolean[], Integer[], Long[], Float[], Double[], BigInteger[], or String[].
|
ByteBuffer |
getBytes(int index)
Returns the value of the specified field cast to a
ByteBuffer . |
ByteBuffer |
getBytes(String name)
Returns the value of the specified field cast to a
ByteBuffer . |
Map<String,Object> |
getDataMap()
Returns a
Map of field names to values that is bound to the
record (updates made to the map are reflected in the record and vice
versa). |
Double |
getDouble(int index)
Returns the value of the specified field cast to a
Double . |
Double |
getDouble(String name)
Returns the value of the specified field cast to a
Double . |
Float |
getFloat(int index)
Returns the value of the specified field cast to a
Float . |
Float |
getFloat(String name)
Returns the value of the specified field cast to a
Float . |
Integer |
getInt(int index)
Returns the value of the specified field cast to a
Integer . |
Integer |
getInt(String name)
Returns the value of the specified field cast to a
Integer . |
Map<String,Object> |
getJson(int index)
For string columns with JSON property, return a Java Map representing the JSON object.
|
Map<String,Object> |
getJson(String name)
For string columns with JSON property, return a Java Map representing the JSON object.
|
Long |
getLong(int index)
Returns the value of the specified field cast to a
Long . |
Long |
getLong(String name)
Returns the value of the specified field cast to a
Long . |
org.apache.avro.Schema |
getSchema()
Returns the Avro record schema of the record.
|
String |
getString(int index)
Returns the value of the specified field cast to a
String . |
String |
getString(String name)
Returns the value of the specified field cast to a
String . |
float[] |
getVector(int index)
For byte columns with a vector property, return a native Java array of float.
|
float[] |
getVector(String name)
For byte columns with a vector property, return a native Java array of float.
|
int |
hashCode() |
void |
put(String name,
Object value)
Sets the value of the specified field.
|
void |
putArray(int index,
Object value)
For string columns with array property, parse the value parameter which may be a
String, List
|
void |
putArray(String name,
Object value)
For string columns with array property, parse the value parameter which may be a
String, List
|
void |
putBytes(int index,
Object value)
For Byte columns, parse the value parameter which may be a
ByteBuffer or byte[].
|
void |
putBytes(String name,
Object value)
For Byte columns, parse the value parameter which may be a
ByteBuffer or byte[].
|
void |
putDateTime(int index,
Object value)
For string columns with date, time, or datetime property, parse the
string and convert to the appropriate Kinetica format using the system
timezone.
|
void |
putDateTime(int index,
Object value,
TimeZone timezone)
For string columns with date, time, or datetime property, parse the
string and convert to the appropriate Kinetica format using the given
timezone (system timezone if none given).
|
void |
putDateTime(String name,
Object value)
For string columns with date, time, or datetime property, parse the
string and convert to the appropriate Kinetica format using the system
timezone.
|
void |
putDateTime(String name,
Object value,
TimeZone timezone)
For string columns with date, time, or datetime property, parse the
string and convert to the appropriate Kinetica format using the given
timezone (system timezone if none given).
|
void |
putJson(int index,
Object value)
For String columns with json property, parse the value parameter which may be a
String, or Map
|
void |
putJson(String name,
Object value)
For String columns with json property, parse the value parameter which may be a
String, or Map
|
void |
putVector(int index,
Object value)
For bytes columns with vector property, parse the value parameter which may be a
string, float[], Float[] or List
|
void |
putVector(String name,
Object value)
For bytes columns with vector property, parse the value property which may be a
string, float[], Float[] or List
|
String |
toString() |
public org.apache.avro.Schema getSchema()
Record
public Object get(String name)
Record
public Object getArray(String name) throws Exception
name
- The name of the column.GPUdbException
- If an error occurs during the operation.com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.databind.JsonMappingException
Exception
public Object getArray(int index) throws Exception
index
- The index of the column.GPUdbException
- If an error occurs during the operation.com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.databind.JsonMappingException
Exception
public ByteBuffer getBytes(int index)
Record
ByteBuffer
.
If the field is not of the correct type an exception will be thrown.public ByteBuffer getBytes(String name)
Record
ByteBuffer
.
If the field is not of the correct type an exception will be thrown.public Double getDouble(int index)
Record
Double
.
If the field is not of the correct type an exception will be thrown.public Double getDouble(String name)
Record
Double
.
If the field is not of the correct type an exception will be thrown.public Float getFloat(int index)
Record
Float
.
If the field is not of the correct type an exception will be thrown.public Float getFloat(String name)
Record
Float
.
If the field is not of the correct type an exception will be thrown.public Integer getInt(int index)
Record
Integer
.
If the field is not of the correct type an exception will be thrown.public Integer getInt(String name)
Record
Integer
.
If the field is not of the correct type an exception will be thrown.public Map<String,Object> getJson(String name) throws Exception
name
- The name of the column.GPUdbException
- If an error occurs during the operation.com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.databind.JsonMappingException
Exception
public Map<String,Object> getJson(int index) throws Exception
index
- The index of the column.GPUdbException
- If an error occurs during the operation.com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.databind.JsonMappingException
Exception
public Long getLong(int index)
Record
Long
.
If the field is not of the correct type an exception will be thrown.public Long getLong(String name)
Record
Long
.
If the field is not of the correct type an exception will be thrown.public String getString(int index)
Record
String
.
If the field is not of the correct type an exception will be thrown.public String getString(String name)
Record
String
.
If the field is not of the correct type an exception will be thrown.public float[] getVector(String name) throws Exception
name
- The name of the column.GPUdbException
- If an error occurs during the operation.com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.databind.JsonMappingException
Exception
public float[] getVector(int index) throws Exception
index
- The index of the column.GPUdbException
- If an error occurs during the operation.com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.databind.JsonMappingException
Exception
public void put(String name, Object value)
Record
public void putArray(String name, Object value) throws GPUdbException
name
- The name of the column.value
- The value to be parsed (based on the given column's type).GPUdbException
- if an error occurs during the operation.public void putArray(int index, Object value) throws GPUdbException
index
- The index of the column.value
- The value to be parsed (based on the given column's type).GPUdbException
- if an error occurs during the operation.public void putBytes(String name, Object value) throws GPUdbException
name
- The name of the column.value
- The value to be set.GPUdbException
- if an error occurs during the operation.public void putBytes(int index, Object value) throws GPUdbException
index
- The index of the column.value
- The value to be set.GPUdbException
- if an error occurs during the operation.public void putDateTime(String name, Object value) throws GPUdbException
put(java.lang.String, java.lang.Object)
. So, use this method only if you know that a
non-Kinetica date/time/datetime format is being used.name
- The name of the column.value
- The value to be parsed (based on the given column's type).GPUdbException
- if an error occurs during the operation.public void putDateTime(String name, Object value, TimeZone timezone) throws GPUdbException
put(java.lang.String, java.lang.Object)
. So, use this method only if you know that a
non-Kinetica date/time/datetime format is being used.name
- The name of the column.value
- The value to be parsed (based on the given column's type).timezone
- Optional parameter specifying the timezone to use for
parsing the given value. If null, the system timezone is
used.GPUdbException
- if an error occurs during the operation.public void putDateTime(int index, Object value) throws GPUdbException
put(java.lang.String, java.lang.Object)
. So, use this method only if you know that a
non-Kinetica date/time/datetime format is being used.index
- The index of the column.value
- The value to be parsed (based on the given column's type).GPUdbException
- if an error occurs during the operation.public void putDateTime(int index, Object value, TimeZone timezone) throws GPUdbException
put(java.lang.String, java.lang.Object)
. So, use this method only if you know that a
non-Kinetica date/time/datetime format is being used.
The following patterns are accepted for date and datetime columns:
1) yyyy[-][/][.]MM[-][/][.]dd[ ]['T'][HH:mm[:ss][.S[S][S][S][S][S]][ ][XXX][Z][z][VV][x]]
2) MM[-][/][.]dd[-][/][.]yyyy[ ]['T'][HH:mm[:ss][.S[S][S][S][S][S]][ ][XXX][Z][z][VV][x]]
3) dd[-][/][.]MM[-][/][.]yyyy[ ]['T'][HH:mm[:ss][.S[S][S][S][S][S]][ ][XXX][Z][z][VV][x]]
The following pattern is accepted by time-type columns:
HH:mm[:ss][.S[S][S][S][S][S]][ ][XXX][Z][z][VV][x]
In other words, the date component can be any of YMD, MDY, or DMY pattern
withh '-', '.', or '/' as the separator. And, the time component must have
hours and minutes, but can optionally have seconds, fraction of a second
(up to six digits) and some form of a timezone identifier.index
- The index of the column.value
- The value to be parsed (based on the given column's type).timezone
- Optional parameter specifying the timezone to use for
parsing the given value. If null, the system timezone is
used.GPUdbException
- if an error occurs during the operation.public void putJson(String name, Object value) throws GPUdbException
name
- The name of the column.value
- The value to be parsed (based on the given column's type).GPUdbException
- if an error occurs during the operation.public void putJson(int index, Object value) throws GPUdbException
index
- The index of the column.value
- The value to be parsed (based on the given column's type).GPUdbException
- if an error occurs during the operation.public void putVector(String name, Object value) throws GPUdbException
name
- The name of the column.value
- The value to be parsed (based on the given column's type).GPUdbException
- if an error occurs during the operation.public void putVector(int index, Object value) throws GPUdbException
index
- The index of the column.value
- The value to be parsed (based on the given column's type).GPUdbException
- if an error occurs during the operation.public Map<String,Object> getDataMap()
Record
Map
of field names to values that is bound to the
record (updates made to the map are reflected in the record and vice
versa).getDataMap
in interface Record
Copyright © 2025. All rights reserved.