public final class GenericRecord extends RecordBase implements Serializable
Record
data based on a GPUdb Type
specified at runtime. GPUdb functions that return non-dynamic data will use
generic records by default in the absence of a specified type descriptor or
known type.Constructor and Description |
---|
GenericRecord(Type type)
Creates a new generic record based on the specified GPUdb
Type . |
Modifier and Type | Method and Description |
---|---|
Object |
get(int index)
Returns the value of the specified field.
|
Type |
getType()
Returns the GPUdb
Type of the record. |
void |
put(int index,
Object value)
Sets the value of the specified field.
|
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).
|
public GenericRecord(Type type)
Type
.
Note that generic records can also be created using Type.newInstance()
.type
- the GPUdb typepublic Type getType()
Record
Type
of the record.public Object get(int index)
Record
public void put(int index, Object value)
Record
public void putDateTime(String name, Object value) throws GPUdbException
put(int, 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(int, 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(int, 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(int, 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.Copyright © 2020. All rights reserved.