columnstore_data_convert_status constants

These are the constants for the status values used in ColumnStoreBulkInsert.setColumn() and ColumnStoreBulkInsert.setNull() to signify the status of any data conversion that occurred during setting.
pymcsapi.CONVERT_STATUS_NONE

There was no problems during the conversion or no conversion.

pymcsapi.CONVERT_STATUS_SATURATED

The value was saturated during the conversion, the maximum/minimum was used instead.

pymcsapi.CONVERT_STATUS_INVALID

The value was invalid during the conversion, 0 or empty string was used instead.

pymcapi.CONVERT_STATUS_TRUNCATED

The value was truncated.

columnstore_data_type constants

These are the constants for the data types as returned by ColumnStoreSystemCatalogColumn.getType().
pymcsapi.DATA_TYPE_BIT

BIT data type

pymcsapi.DATA_TYPE_TINYINT

TINYINT data type

pymcsapi.DATA_TYPE_TIME

TIME data type

pymcsapi.DATA_TYPE_CHAR

CHAR data type

pymcsapi.DATA_TYPE_SMALLINT

SMALLINT data type

pymcsapi.DATA_TYPE_DECIMAL

DECIMAL data type

pymcsapi.DATA_TYPE_MEDINT

MEDIUMINT data type

pymcsapi.DATA_TYPE_INT

INT data type

pymcsapi.DATA_TYPE_FLOAT

FLOAT data type

pymcsapi.DATA_TYPE_DATE

DATE data type

pymcsapi.DATA_TYPE_BIGINT

BIGINT data type

pymcsapi.DATA_TYPE_DOUBLE

DOUBLE data type

pymcsapi.DATA_TYPE_DATETIME

DATETIME data type

pymcsapi.DATA_TYPE_VARCHAR

VARCHAR data type

pymcsapi.DATA_TYPE_VARBINARY

VARBINARY data type

pymcsapi.DATA_TYPE_CLOB

Unused

pymcsapi.DATA_TYPE_BLOB

BLOB data type

pymcsapi.DATA_TYPE_UTINYINT

UNSIGNED TINYINT data type

pymcsapi.DATA_TYPE_USMALLINT

UNSIGNED SMALLINT data type

pymcsapi.DATA_TYPE_UDECIMAL

UNSIGNED DECIMAL data type

pymcsapi.DATA_TYPE_UMEDINT

UNSIGNED MEDIUMINT data type

pymcsapi.DATA_TYPE_UINT

UNSIGNED INT data type

pymcsapi.DATA_TYPE_UFLOAT

UNSIGNED FLOAT data type

pymcsapi.DATA_TYPE_UBIGINT

UNSIGNED BIGINT data type

pymcsapi.DATA_TYPE_UDOUBLE

UNSIGNED DOUBLE data type

pymcsapi.DATA_TYPE_TEXT

TEXT data type

columnstore_lock_type constants

These are constants for the table locks as returned by TableLockInfo.state
pymcsapi.LOCK_TYPE_CLEANUP
pymcsapi.LOCK_TYPE_LOADING

TableLockInfo Class

class TableLockInfo

A struct containing table lock information

TableLockInfo::id
TableLockInfo::ownerName
TableLockInfo::ownerPID
TableLockInfo::ownerSessionID
TableLockInfo::ownerTxnID
TableLockInfo::state
TableLockInfo::creationTime
TableLockInfo::dbrootList

ColumnStoreDateTime Class

class ColumnStoreDateTime

A class which is used to contain a date/time used to set DATE or DATETIME columns using ColumnStoreBulkInsert.setColumn()

ColumnStoreDateTime()

pymcsapi.ColumnStoreDateTime()

Sets the date/time to 0000-00-00 00:00:00.

pymcsapi.ColumnStoreDateTime(time)

Sets the date/time the value of the input string.

Parameters:time – The date/time to set
Raises:RuntimeError – When an invalid date or time is supplied
pymcsapi.ColumnStoreDateTime(dateTime, format)

Sets the date/time based on a given string and format.

Parameters:
  • dateTime – A string containing the date/time to set
  • format – The format specifier for the date/time string. This uses the strptime format.
Raises:

RuntimeError – When an invalid date or time is supplied

pymcsapi.ColumnStoreDateTime(year, month, day, hour, minute, second, microsecond)

Sets the date/time based on a given set of intergers

Note

Microseconds are for future usage, they are not currently supported in ColumnStore.

Parameters:
  • year – The year
  • month – The month of year
  • day – The day of month
  • hour – The hour
  • minute – The minute
  • second – The second
  • microsecond – The microseconds
Raises:

RuntimeError – When an invalid date or time is supplied

set()

ColumnStoreDateTime.set(time)

Sets the date/time using the value of the input string.

Parameters:time – The date/time to set
Returns:True if the date/time is valid, False if it is not
ColumnStoreDateTime.set(dateTime, format)

Sets the date/time based on a given string and format.

Parameters:
  • dateTime – A string containing the date/time to set
  • format

    The format specifier for the date/time string. This uses the strptime format.

Returns:

True if the date/time is valid, False if it is not

ColumnStoreTime Class

A class which is used to contain a time used to set TIME columns using ColumnStoreBulkInsert.setColumn()
pymcsapi.ColumnStoreTime()

Sets the time to 00:00:00.

pymcsapi.ColumnStoreTime(time)

Sets the time the value of the input string.

Parameters:time – The time to set
Raises:RuntimeError – When an invalid time is supplied
pymcsapi.ColumnStoreTime(time, format)

Sets the time based on a given string and format.

Parameters:
  • time – A string containing the time to set
  • format

    The format specifier for the time string. This uses the strptime format.

Raises:

RuntimeError – When an invalid time is supplied

pymcsapi.ColumnStoreTime(hour, minute, second, microsecond, is_negative)

Sets the time based on a given set of intergers

Note

If the the time is a negative and the hours are zero then is_negative should be set. Otherwise the driver will automatically set this for you.

Parameters:
  • hour – The hour
  • minute – The minute
  • second – The second
  • microsecond – The microseconds
  • is_negative – A zero hour time that is negative
Raises:

RuntimeError – When an invalid time is supplied

set()

ColumnStoreTime.set(time)

Sets the time using the value of the input string.

Parameters:time – The time to set
Returns:True if the time is valid, False if it is not
ColumnStoreTime.set(time, format)

Sets the time based on a given string and format.

Parameters:
  • time – A string containing the time to set
  • format

    The format specifier for the time string. This uses the strptime format.

Returns:

True if the time is valid, False if it is not

ColumnStoreDecimal Class

class ColumnStoreDecimal

A class which is used to contain a non-lossy decimal format used to set DECIMAL columns using ColumnStoreBulkInsert.setColumn().

ColumnStoreDecimal()

pymcsapi.ColumnStoreDecimal()

Sets the decimal to 0.

pymcsapi.ColumnStoreDecimal(value)

Sets the decimal to an supplied integer value.

Parameters:value – The value to set
Raises:RuntimeError – When an invalid value is supplied
pymcsapi.ColumnStoreDecimal(value)

Sets the decimal to the contents of a supplied string value (such as "3.14159").

Parameters:value – The value to set
Raises:RuntimeError – When an invalid value is supplied
pymcsapi.ColumnStoreDecimal(value)

Sets the decimal to the contents of a supplied double value.

Note

In the internally this uses the string method so the performance may be lower than expected.

Parameters:value – The value to set
Raises:RuntimeError – When an invalid value is supplied
pymcsapi.ColumnStoreDecimal(number, scale)

Sets the decimal to a given number and scale. For example for the value 3.14159 you would set the number to 314159 and the scale to 5.

Parameters:
  • number – The number to set
  • scale – The scale for the number
Raises:

RuntimeError – When an invalid number/scale is supplied

set()

ColumnStoreDecimal.set(value)

Sets the decimal to an supplied integer value.

Parameters:value – The value to set
Returns:Always returns True
ColumnStoreDecimal.set(value)

Sets the decimal to the contents of a supplied string value (such as "3.14159").

Parameters:value – The value to set
Returns:True if the conversion was successful or False if it failed
ColumnStoreDecimal.set(value)

Sets the decimal to the contents of a supplied double value.

Note

In the internally this uses the string method so the performance may be lower than expected.

Parameters:value – The value to set
Returns:True if the conversion was successful or False if it failed
ColumnStoreDecimal.set(number, scale)

Sets the decimal to a given number and scale. For example for the value 3.14159 you would set the number to 314159 and the scale to 5.

Parameters:
  • number – The number to set
  • scale – The scale for the number
Returns:

True if the conversion was successful or False if it failed

ColumnStoreSystemCatalog Class

class ColumnStoreSystemCatalog

A class which contains the ColumnStore system catalog of tables and columns. It should be instantiated using ColumnStoreDriver.getSystemCatalog().

Note

The system catalog stores schema, table and column names as lower case and therefore the functions only return lower case names. Since version 1.1.4 we make case insensitive matches.

getTable()

ColumnStoreSystemCatalog.getTable(schemaName, tableName)

Gets the table information for a specific table.

Parameters:
  • schemaName – The schema the table is in
  • tableName – The name of the table
Returns:

The table information

Raises:

RuntimeError – If the table is not found in the system catalog

ColumnStoreSystemCatalogTable Class

class ColumnStoreSystemCatalogTable

A class which contains the system catalog information for a specific table. It should be instantiated using ColumnStoreSystemCatalog.getTable().

Note

The system catalog stores schema, table and column names as lower case and therefore the functions only return lower case names. Since version 1.1.4 we make case insensitive matches.

getSchemaName()

ColumnStoreSystemCatalogTable.getSchemaName()

Retrieves the database schema name for the table

Returns:The schema name

getTableName()

ColumnStoreSystemCatalogTable.getTableName()

Retrieves the table name for the table

Returns:The table name

getOID()

ColumnStoreSystemCatalogTable::getOID()

Retrieves the ColumnStore object ID for the table.

Returns:The object ID for the table

getColumnCount()

ColumnStoreSystemCatalogTable.getColumnCount()

Retrieves the number of columns in the table

Returns:The number of columns in the table

getColumn()

ColumnStoreSystemCatalogTable.getColumn(columnName)

Retrieves the column information for a specified column by name

Parameters:columnName – The name of the column to retrieve
Returns:The column information
Raises:RuntimeError – If the column is not found
ColumnStoreSystemCatalogTable.getColumn(columnNumber)

Retrieves the column information for a specified column by number starting at zero

Parameters:columnNumber – The number of the column to retrieve starting at 0
Returns:The column information
Raises:RuntimeError – If the column is not found

ColumnStoreSystemCatalogColumn Class

class ColumnStoreSystemCatalogColumn

A class containing information about a specific column in the system catalog. Should be instantiated using ColumnStoreSystemCatalogTable.getColumn().

Note

The system catalog stores schema, table and column names as lower case and therefore the functions only return lower case names. Since version 1.1.4 we make case insensitive matches.

getOID()

ColumnStoreSystemCatalogColumn.getOID()

Retrieves the ColumnStore object ID for the column

Returns:The column object ID

getColumnName()

ColumnStoreSystemCatalogColumn.getColumnName()

Retrieves the name of the column

Returns:The column name

getDictionaryOID()

ColumnStoreSystemCatalogColumn.getDictionaryOID()

Retrieves the dictionary object ID for the column (or 0 if there is no dictionary)

Returns:The dictionary object ID or 0 for no dictionary

getType()

ColumnStoreSystemCatalogColumn.getType()

Retrieves the data type for the column

Returns:The data type for the column

getWidth()

ColumnStoreSystemCatalogColumn.getWidth()

Retrieves the width in bytes for the column

Returns:The width in bytes

getPosition()

ColumnStoreSystemCatalogColumn.getPosition()

Retrieves the column’s position in the table. The sequence of columns in the table is sorted on object ID, columns may be out-of-order if an ALTER TABLE has inserted one in the middle of the table.

Returns:The column’s position in the table

getDefaultValue()

ColumnStoreSystemCatalogColumn.getDefaultValue()

Retrieves the default value for the column in text. The value is empty for no default.

Returns:The column’s default value

isAutoincrement()

ColumnStoreSystemCatalogColumn.isAutoincrement()

Retrieves whether or not this column is an autoincrement column.

Returns:true if this column is autoincrement, false if it isn’t

getPrecision()

ColumnStoreSystemCatalogColumn.getPrecision()

Retrieves the decimal precision for the column.

Returns:The decimal precision

getScale()

ColumnStoreSystemCatalogColumn.getScale()

Retrieves the decimal scale for the column.

Returns:The decimal scale

isNullable()

ColumnStoreSystemCatalogColumn.isNullable()

Retrieves whether or not the column can be set to NULL

Returns:True if the column can be NULL or False if it can not

compressionType()

ColumnStoreSystemCatalogColumn.compressionType()

Retrieves the compression type for the column. 0 means no compression and 2 means Snappy compression

Returns:The compression type for the column