collectors
⚓︎
Collects data from the fields extracted from the data records (D).
Classes⚓︎
Functions⚓︎
collect_binary(c, fields, pos)
⚓︎
Collects BINARY data type from ixf as a string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
c |
dict
|
Column descriptor extracted from IXF file. |
required |
fields |
str
|
Bytes string containing data of the row. |
required |
pos |
int
|
Position of the column in the |
required |
Returns:
Type | Description |
---|---|
str
|
Binary string. |
Raises:
Type | Description |
---|---|
DataCollectorError
|
When length exceeds 254 bytes. |
Source code in src/db2ixf/collectors.py
collect_smallint(c, fields, pos)
⚓︎
Collects SMALLINT data type from ixf as an integer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
c |
dict
|
Column descriptor extracted from IXF file. |
required |
fields |
str
|
Bytes string containing data of the row. |
required |
pos |
int
|
Position of the column in the |
required |
Returns:
Type | Description |
---|---|
int
|
Integer. |
Source code in src/db2ixf/collectors.py
collect_integer(c, fields, pos)
⚓︎
Collects INTEGER data type from ixf as an integer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
c |
dict
|
Column descriptor extracted from IXF file. |
required |
fields |
str
|
Bytes string containing data of the row. |
required |
pos |
int
|
Position of the column in the |
required |
Returns:
Type | Description |
---|---|
int
|
Integer. |
Source code in src/db2ixf/collectors.py
collect_bigint(c, fields, pos)
⚓︎
Collects BIGINT data type from ixf as an integer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
c |
dict
|
Column descriptor extracted from IXF file. |
required |
fields |
str
|
Bytes string containing data of the row. |
required |
pos |
int
|
Position of the column in the |
required |
Returns:
Type | Description |
---|---|
int
|
Integer. |
Source code in src/db2ixf/collectors.py
collect_decimal(c, fields, pos)
⚓︎
Collects DECIMAL data type from ixf as a integer or a float.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
c |
dict
|
Column descriptor extracted from IXF file. |
required |
fields |
str
|
Bytes string containing data of the row. |
required |
pos |
int
|
Position of the column in the |
required |
Returns:
Type | Description |
---|---|
Union[int, float]
|
Integer or Float. |
Source code in src/db2ixf/collectors.py
collect_floating_point(c, fields, pos)
⚓︎
Collects FLOATING POINT data type from ixf as a float.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
c |
dict
|
Column descriptor extracted from IXF file. |
required |
fields |
str
|
Bytes string containing data of the row. |
required |
pos |
int
|
Position of the column in the |
required |
Returns:
Type | Description |
---|---|
float
|
A python float object. |
Raises:
Type | Description |
---|---|
DataCollectorError
|
When facing extra bytes. |
Source code in src/db2ixf/collectors.py
collect_char(c, fields, pos)
⚓︎
Collects CHAR data type from ixf as a string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
c |
dict
|
Column descriptor extracted from IXF file. |
required |
fields |
str
|
Bytes string containing data of the row. |
required |
pos |
int
|
Position of the column in the |
required |
Returns:
Type | Description |
---|---|
str
|
String. |
Raises:
Type | Description |
---|---|
DataCollectorError
|
When length exceeds 254 bytes. |
Source code in src/db2ixf/collectors.py
collect_varchar(c, fields, pos)
⚓︎
Collects VARCHAR data type from ixf as a string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
c |
dict
|
Column descriptor extracted from IXF file. |
required |
fields |
str
|
Bytes string containing data of the row. |
required |
pos |
int
|
Position of the column in the |
required |
Returns:
Type | Description |
---|---|
str
|
String. |
Raises:
Type | Description |
---|---|
DataCollectorError
|
When length of var char exceeds maximum length. |
Source code in src/db2ixf/collectors.py
collect_longvarchar(c, fields, pos)
⚓︎
Collects LONGVARCHAR data type from ixf as a string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
c |
dict
|
Column descriptor extracted from IXF file. |
required |
fields |
str
|
Bytes string containing data of the row. |
required |
pos |
int
|
Position of the column in the |
required |
Returns:
Type | Description |
---|---|
str
|
String. |
Raises:
Type | Description |
---|---|
DataCollectorError
|
When length of long var char exceeds maximum length. |
Source code in src/db2ixf/collectors.py
collect_vargraphic(c, fields, pos)
⚓︎
Collects VARGRAPHIC data type from ixf as a string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
c |
dict
|
Column descriptor extracted from IXF file. |
required |
fields |
str
|
Bytes string containing data of the row. |
required |
pos |
int
|
Position of the column in the |
required |
Returns:
Type | Description |
---|---|
str
|
String. |
Raises:
Type | Description |
---|---|
DataCollectorError
|
When length of var graphic exceeds maximum length. |
Source code in src/db2ixf/collectors.py
collect_date(c, fields, pos)
⚓︎
Collects DATE data type from ixf as a date object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
c |
dict
|
Column descriptor extracted from IXF file. |
required |
fields |
str
|
Bytes string containing data of the row. |
required |
pos |
int
|
Position of the column in the |
required |
Returns:
Type | Description |
---|---|
date
|
Date of format yyyy-mm-dd. |
Source code in src/db2ixf/collectors.py
collect_time(c, fields, pos)
⚓︎
Collects TIME data type from ixf as a time object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
c |
dict
|
Column descriptor extracted from IXF file. |
required |
fields |
str
|
Bytes string containing data of the row. |
required |
pos |
int
|
Position of the column in the |
required |
Returns:
Type | Description |
---|---|
time
|
Time of format HH:MM:SS. |
Source code in src/db2ixf/collectors.py
collect_timestamp(c, fields, pos)
⚓︎
Collects TIMESTAMP data type from ixf as a datetime object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
c |
dict
|
Column descriptor extracted from IXF file. |
required |
fields |
str
|
Bytes string containing data of the row. |
required |
pos |
int
|
Position of the column in the |
required |
Returns:
Type | Description |
---|---|
datetime
|
Timestamp of format yyyy-mm-dd-hh.mm.ss.nnnnnn or yyyy-mm-dd-hh.mm.ss. |
Source code in src/db2ixf/collectors.py
collect_clob(c, fields, pos)
⚓︎
Collects CLOB data type from ixf as a string object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
c |
dict
|
Column descriptor extracted from IXF file. |
required |
fields |
str
|
Bytes string containing data of the row. |
required |
pos |
int
|
Position of the column in the |
required |
Returns:
Type | Description |
---|---|
str
|
String representing the CLOB (Character Large Object). |
Raises:
Type | Description |
---|---|
DataCollectorError
|
When length of the large object exceeds the maximum length Or When SBCP and DBCP are simultaneously equal to 0. |
Source code in src/db2ixf/collectors.py
collect_blob(c, fields, pos)
⚓︎
Collects BLOB data type from ixf as a string.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
c |
dict
|
Column descriptor extracted from IXF file. |
required |
fields |
str
|
Bytes string containing data of the row. |
required |
pos |
int
|
Position of the column in the |
required |
Returns:
Type | Description |
---|---|
str
|
string representing the BLOB (Blob Large Object). |
Raises:
Type | Description |
---|---|
DataCollectorError
|
When the length of the binary large object exceeds the maximum length. |