On this page

    MySQL

    MySQL is a managed database service for deploying cloud-native applications, and this topic describes how to configure a MySQL database as a Dremio Sonar source.

    Prerequisites

    Ensure that you have the following details before configuring MySQL as a source:

    • Hostname or IP address
    • Port

    Dremio MySQL Configuration

    Perform these steps to configure MySQL as a source:

    1. In the Datasets UI, you can see a truncated list of Sources at the bottom-left of the page. Click + Add Source.

      This is a screenshot showing how to add a source.

      Alternatively, click Databases. The page displays all database sources. Click the Add database button at the top-right of that page.

    2. In the Add Data Source dialog, click MySQL.

      The following section describes the source configuration tabs.

    General

    The General tab contains the required fields to create a MySQL source.

    This is a screenshot showing the General tab.

    Perform these steps in the General tab:

    1. In the General tab, for Name, enter a name.
    2. For Host, enter the MySQL host name.
    3. For Port, enter the MySQL port number. The default port is 3306.
    4. For Authentication, Master Authentication is the default and the only option. Provide the username and password of a master database user with permissions to read required objects:
    • For Username, enter your MySQL database username.
    • For Password, enter your MySQL database password.

    Advanced Options

    Click Advanced Options in the sidebar.

    This is a screenshot showing the Advanced Options tab.

    note:

    All advanced options are optional.

    Advanced OptionDescription
    Net write timeout (in seconds)Seconds to wait for data from the server before aborting the connection. The default timeout is 60 seconds.
    Record fetch sizeNumber of records to fetch at once. Set to 0 (zero) to have Sonar automatically decide. The default record fetch size is 200.
    Maximum Idle ConnectionsThe total number of connections allowed to be idle at a given time. The default 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.
    Connection PropertiesCustom key value pairs for the connection relevant to the source. To add a connection property, click Add property and add the property name and value.

    Reflection Refresh

    The Reflection Refresh tab in the sidebar allows you to set time intervals for reflections to refresh or expire.

    This is a screenshot showing the Reflection Refresh tab.

    Metadata

    You can configure settings to refresh metadata and handle datasets. Click Metadata in the sidebar.

    This is a screenshot showing the Metadata tab.

    You can configure Dataset Handling and Metadata Refresh parameters.

    Dataset Handling

    These are the Dataset Handling parameters.

    note:

    All Dataset Handling parameters are optional.

    ParameterDescription
    Remove dataset definitions if underlying data is unavailableBy default, Sonar 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 Metadata Refresh parameters:

    • Dataset Discovery: The refresh interval for fetching top-level source 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 Sonar needs for query planning such as information required for fields, types, shards, statistics, and locality. These are the parameters to fetch the dataset information.

    note:

    All Dataset Details parameters are optional.

    ParameterDescription
    Fetch modeYou can choose to fetch only from queried datasets that are set by default. Sonar updates details for previously queried objects in a source. 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

    You can grant privileges to specific users or roles.

    This is a screenshot showing the Privileges tab.

    1. (Optional) For Privileges, enter the user name 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 table.
    2. (Optional) For the users or roles in the Users table, toggle the green checkmark for each privilege you want to grant to the MySQL source that is being created.

    Click Save after setting the configuration.

    Editing a MySQL Source

    To edit a MySQL source:

    1. In the Datasets UI, click Databases. A list of databases is displayed.
    2. Under the Actions column, click the Settings (gear) icon for the source you want to edit. From the list of actions, click Edit Details.

    This is a screenshot showing how to edit details.

    1. In the Edit Source dialog, you cannot edit the name. Editing other parameters is optional.
    2. Click Save.

    Removing a MySQL Source

    To remove a MySQL source, perform these steps:

    1. In the Datasets UI, click Databases. A list of sources is displayed.
    2. Under the Actions column, click the Settings (gear) icon for the source that you want to remove.

    This is a screenshot showing how to remove a source.

    1. From the list of actions, click Remove Source. Confirm that you want to remove the source.

    warning:

    Removing a source causes all downstream views dependent on objects in this source to break.

    Predicate Pushdowns

    Dremio offloads these operations to MySQL.

    OperatorsOperatorsOperatorsOperators
    *, +, -, /, %DATE_TRUNC_SECONDLOGSUBSTRING
    <, <=, <>, =, >, >=, !=DATE_TRUNC_WEEKLOG10SUM
    AND, NOT, NOT LIKE, OR, ||DATE_TRUNC_YEARLOWERTAN
    ABSDEGREESLPADTIMESTAMPADD_DAY
    ACOSELTRIMTIMESTAMPADD_HOUR
    ASINEXPMAXTIMESTAMPADD_MINUTE
    ATANEXTRACT_DAYMINTIMESTAMPADD_MONTH
    ATAN2EXTRACT_DOWMODTIMESTAMPADD_QUARTER
    AVGEXTRACT_DOYPITIMESTAMPADD_SECOND
    CASTEXTRACT_HOURPOSITIONTIMESTAMPADD_YEAR
    CEILEXTRACT_MINUTEPOWTIMESTAMPDIFF_DAY
    CEILINGEXTRACT_MONTHPOWERTIMESTAMPDIFF_HOUR
    CHAR_LENGTHEXTRACT_QUARTERRADIANSTIMESTAMPDIFF_MINUTE
    CHARACTER_LENGTHEXTRACT_SECONDRANDTIMESTAMPDIFF_MONTH
    CONCATEXTRACT_WEEKREPLACETIMESTAMPDIFF_QUARTER
    COSEXTRACT_YEARREVERSETIMESTAMPDIFF_SECOND
    COTFLOORRIGHTTIMESTAMPDIFF_WEEK
    CURRENT_DATEIS DISTINCT FROMROUNDTIMESTAMPDIFF_YEAR
    CURRENT_TIMEIS NOT DISTINCT FROMRPADTO_DATE
    CURRENT_TIMESTAMPIS NOT NULLRTRIMTRIM
    DATE_ADDIS NULLSIGNTRUNC
    DATE_SUBLCASESINTRUNCATE
    DATE_TRUNC_DAYLEFTSQRTUCASE
    DATE_TRUNC_DECADELENGTHSTDDEVUPPER
    DATE_TRUNC_HOURLIKESTDDEV_POPVAR_POP
    DATE_TRUNC_MINUTELNSTDDEV_SAMPVAR_SAMP
    DATE_TRUNC_MONTHLOCATESUBSTR