Skip to main content

IBM Db2

You can connect to IBM Db2 databases. IBM Db2 for Linux, UNIX, and Windows are supported.

Connect to IBM Db2

  1. In the Dremio console, click Add Data on the Home page.
  2. In the Add Data dialog, select IBM Db2.
  3. Configure the connection using the sections below, then click Save.

General Options

  1. In the Name field, specify the name of the connection. The name cannot include the following special characters: /, :, [, or ].
  2. Under Connection, follow these steps:
    1. In the Host field, specify the hostname or IP address of the database to connect to.
    2. In the Port field, specify the port to use when connecting. The default is 50000.
    3. In the Database field, specify the name of the database.
  3. Under Authentication, follow these steps:
    • For Username, enter your database username.
    • For Password, enter your database password.

Advanced Options

On the Advanced Options page, you can set values for these optional settings:

OptionDescription
Record fetch sizeNumber of records to fetch at once. Set to 0 (zero) to have Dremio decide automatically. By default, this is set to 200.
Maximum idle connectionsThe total number of connections allowed to be idle at a given time. The default number of maximum idle connections is 8.
Connection idle timeThe amount of time (in seconds) allowed for a connection to remain idle before the connection is terminated. The default connection idle time is 60 seconds.
Query timeoutThe amount of time (in seconds) allowed to wait for the results of a query. If this time expires, the connection being used is returned to an idle state.
Enable external authorization pluginWhen enabled, authorizes an external plugin.
Connection propertiesConnection properties and values.

Reflection Refresh Options

On the Reflection Refresh page, set the policy that controls how often Reflections are scheduled to be refreshed automatically, as well as the time limit after which Reflections expire and are removed.

OptionDescription
Never refreshSelect to prevent automatic Reflection refresh, default is to automatically refresh.
Refresh everyHow often to refresh Reflections, specified in hours, days or weeks. This option is ignored if Never refresh is selected.
Never expireSelect to prevent Reflections from expiring, default is to automatically expire after the time limit below.
Expire afterThe time limit after which Reflections expire and are removed from Dremio, specified in hours, days or weeks. This option is ignored if Never expire is selected.

Metadata Options

On the Metadata page, you can configure settings to refresh metadata and handle datasets.

Dataset Handling

These are the optional Dataset Handling parameters:

ParameterDescription
Remove dataset definitions if underlying data is unavailableBy default, Dremio removes dataset definitions if underlying data is unavailable. Useful when files are temporarily deleted and added back in the same location with new sets of files.

Metadata Refresh

These are the optional Metadata Refresh parameters:

  • Dataset Discovery: The refresh interval for fetching top-level object names such as databases and tables. Set the time interval using this parameter.

    ParameterDescription
    (Optional) Fetch everyYou can choose to set the frequency to fetch object names in minutes, hours, days, or weeks. The default frequency to fetch object names is 1 hour.
  • Dataset Details: The metadata that Dremio needs for query planning, such as information required for fields, types, shards, statistics, and locality. These are the parameters to fetch the dataset information.

    ParameterDescription
    Fetch modeYou can choose to fetch only from queried datasets, which is set by default. Dremio updates details for previously queried objects. Fetching from all datasets is deprecated.
    Fetch everyYou can choose to set the frequency to fetch dataset details in minutes, hours, days, or weeks. The default frequency to fetch dataset details is 1 hour.
    Expire afterYou can choose to set the expiry time of dataset details in minutes, hours, days, or weeks. The default expiry time of dataset details is 3 hours.

Privileges

This connection inherits privileges from Project settings. To grant specific users or roles additional privileges in this connection:

  1. Enter the username or role name that you want to grant access to and click the Add to Privileges button. The added user or role is displayed in the USERS/ROLES table.
  2. For the users or roles in the USERS/ROLES table, toggle the checkmark for each privilege you want to grant on the Dremio source that is being created.
  3. Click Save after setting the configuration.

See Privileges for additional information about privileges.

Edit an IBM Db2 Connection

  1. On the Open Catalog page, under Connections, right-click the connection and select Settings.
  2. Update the connection configuration as needed.
  3. Click Save.

Delete an IBM Db2 Connection

note

If the source is in a bad state (for example, Dremio cannot authenticate to the source or the source is otherwise unavailable), only users who belong to the ADMIN role can delete the source.

  1. On the Open Catalog page, under Connections, right-click the connection and select Delete.
  2. Click Delete to confirm.

Predicate Pushdowns

Dremio delegates the execution of these expressions and functions to the database being queried, often dramatically improving query performance. It can also offload entire SQL queries that include one or more of these expressions and functions.

||, AND, OR
=, +, -, /, *
<=, <, >, >=, =, <>, !=
ABS
ADD_MONTHS
AVG
BETWEEN
CASE
CAST
CEIL
CEILING
CHAR_LENGTH
CHARACTER_LENGTH
COALESCE
CONCAT
DATE_ADD
DATE_DIFF
DATE_TRUNC
DATE_TRUNC_CENTURY
DATE_TRUNC_DAY
DATE_TRUNC_DECADE
DATE_TRUNC_HOUR
DATE_TRUNC_MICROSECOND
DATE_TRUNC_MILLENNIUM
DATE_TRUNC_MILLISECOND
DATE_TRUNC_MINUTE
DATE_TRUNC_MONTH
DATE_TRUNC_QUARTER
DATE_TRUNC_SECOND
DATE_TRUNC_WEEK
DATE_TRUNC_YEAR
DAYOFMONTH
DAYOFWEEK
DAYOFYEAR
EXTRACT
FLOOR
ILIKE
IN
IS DISTINCT FROM
IS NOT DISTINCT FROM
IS NOT NULL
IS NULL
LAST_DAY
LEFT
LENGTH
LIKE
LOCATE
LOWER
LPAD
LTRIM
MAX
MIN
MOD
NOT
OR
PERCENT_RANK
POSITION
REPLACE
RIGHT
ROUND
RPAD
RTRIM
SIGN
SQRT
STDDEV
STDDEV_POP
STDDEV_SAMP
SUBSTR
SUBSTRING
SUM
TO_CHAR
TO_DATE
TRIM
TRUNC
TRUNCATE
UPPER

Data Type Map

The following table shows the mappings from Db2 to Dremio data types.

note

If a type is not present in the table, it is not currently supported.

Db2 Database TypeDremio Type
BIGINTBIGINT
BLOBVARCHAR
BOOLEANBOOLEAN
CHARVARCHAR
CHAR () FOR BIT DATAVARCHAR
CLOBVARCHAR
DATEDATE
DBCLOBVARCHAR
DECFLOATDECIMAL
DECIMALDECIMAL
DOUBLEDOUBLE
GRAPHICVARCHAR
INTEGERINTEGER
LONG VARCHARVARCHAR
LONG VARCHAR FOR BIT DATAVARCHAR
LONG VARGRAPHICVARCHAR
REALDOUBLE
SMALLINTINTEGER
TIMETIME
TIMESTAMPTIMESTAMP
VARCHARVARCHAR
VARCHAR () FOR BIT DATAVARCHAR
VARGRAPHICVARCHAR