### Start Dremio Service Source: https://docs.dremio.com/25.x/get-started/standalone-quickstart Execute this command to start the Dremio service after installation. Ensure you have the necessary permissions. ```bash sudo service dremio start ``` -------------------------------- ### Start Dremio Service (Tarball Install) Source: https://docs.dremio.com/25.x/get-started/cluster-deployments/deployment-models/standalone/dremio-config Command to start the Dremio service when installed via a tarball. Assumes Dremio is configured as a service. ```bash $ sudo /bin/dremio start ``` -------------------------------- ### Start Dremio Service (RPM Install) Source: https://docs.dremio.com/25.x/get-started/cluster-deployments/deployment-models/standalone/dremio-config Command to start the Dremio service when installed via RPM. Assumes Dremio is configured as a service. ```bash $ sudo service dremio start ``` -------------------------------- ### Configure Google Cloud Storage Parameters Source: https://docs.dremio.com/25.x/reference/api/catalog/source/container-source-config Examples of individual configuration values for GCS source setup. ```text dremio-4321 ``` ```text AUTO ``` ```text 70 ``` ```json [{"name": "dremio.gcs.clientEmail","value": "exampleuser@dremio-project.iam.gserviceaccount.com"}] ``` -------------------------------- ### Describe a pipe example Source: https://docs.dremio.com/25.x/reference/sql/commands/describe-pipe Example command to retrieve information for a pipe named Example_pipe. ```sql DESCRIBE PIPE Example_pipe ``` -------------------------------- ### Example Dremio API Request (No Query Parameters) Source: https://docs.dremio.com/25.x/reference/api/reflections/reflection-summary This example shows a basic GET request to the reflection summary endpoint without any specific query parameters. Ensure you replace `{hostname}` with your Dremio instance hostname and `` with your actual token. ```bash curl -X GET 'https://{hostname}/api/v3/reflection-summary' --header 'Authorization: Bearer ' \ --header "Content-Type: application/json" ``` -------------------------------- ### CREATE PIPE Examples Source: https://docs.dremio.com/25.x/reference/sql/commands/create-pipe Examples demonstrating how to create an autoingest pipe. ```APIDOC ## Examples ### Create an autoingest pipe from an Amazon S3 source ```sql CREATE PIPE Example_pipe NOTIFICATION_PROVIDER AWS_SQS NOTIFICATION_QUEUE_REFERENCE "arn:aws:sqs:us-east-2:444455556666:queue1" AS COPY INTO Table_one FROM '@s3_source/folder' FILE_FORMAT 'csv' ``` ### Create an autoingest pipe with a custom lookback period ```sql CREATE PIPE Example_pipe DEDUPE_LOOKBACK_PERIOD 5 NOTIFICATION_PROVIDER AWS_SQS NOTIFICATION_QUEUE_REFERENCE "arn:aws:sqs:us-east-2:444455556666:queue1" AS COPY INTO Table_one FROM '@/files' FILE_FORMAT 'csv' ``` ``` -------------------------------- ### Create Function Examples Source: https://docs.dremio.com/25.x/reference/sql/commands/functions Examples of creating scalar functions with and without parameters. ```SQL CREATE FUNCTION hello() RETURNS VARCHAR RETURN SELECT 'Hello World!'; ``` ```SQL CREATE FUNCTION multiply (x INT, y INT) RETURNS INT RETURN SELECT x * y; ``` -------------------------------- ### Elasticsearch Configuration Examples Source: https://docs.dremio.com/25.x/reference/api/catalog/source/container-source-config Examples of various configuration values for Elasticsearch source settings. ```text true ``` ```text false ``` ```text 60000 ``` ```text 300000 ``` ```text 4000 ``` ```text CERTIFICATE_AND_HOSTNAME_VALIDATION ``` ```json [{"hostname": "172.25.0.208","port": 9200}] ``` ```text ANONYMOUS ``` ```text exampleuser ``` ```text 172.25.0.208 ``` ```text 9200 ``` -------------------------------- ### SHOW BRANCHES Examples Source: https://docs.dremio.com/25.x/reference/sql/commands/nessie/show-branches Examples of listing branches from the current context or a specific source. ```SQL SHOW BRANCHES ``` ```SQL SHOW BRANCHES in mySource ``` -------------------------------- ### Show Functions Examples Source: https://docs.dremio.com/25.x/reference/sql/commands/functions Examples of listing functions, including filtering by name patterns. ```SQL SHOW FUNCTIONS; ``` ```SQL SHOW FUNCTIONS LIKE 'protect_ssn'; ``` ```SQL SHOW FUNCTIONS LIKE 'protect_%'; ``` -------------------------------- ### Example URI with Password Authentication Source: https://docs.dremio.com/25.x/sonar/client-applications/clients/superset A concrete example of a connection URI using username and password. ```text dremio+flight://myUserID:myPassword@myHost:32010/Samples?UseEncryption=false ``` -------------------------------- ### ASCII Function Examples Source: https://docs.dremio.com/25.x/reference/sql/sql-functions/functions/ASCII Examples demonstrating the ASCII function with various string inputs. ```sql SELECT ASCII ('DREMIO') -- 68 ``` ```sql SELECT ASCII ('D') -- 68 ``` ```sql SELECT ASCII ('') -- 0 ``` -------------------------------- ### Describe Function Example Source: https://docs.dremio.com/25.x/reference/sql/commands/functions Example of displaying metadata for a specific function. ```SQL DESCRIBE FUNCTION protect_ssn; ``` -------------------------------- ### Start Docker Containers Source: https://docs.dremio.com/25.x/security/rbac/integrations/lake-formation/lake-formation-demo Starts the Docker services defined in the docker-compose.yaml file. ```bash docker compose up -d ``` -------------------------------- ### MySQL Source Configuration Example Source: https://docs.dremio.com/25.x/reference/api/catalog/source/container-source-config Example configuration object for a MySQL data source in Dremio. ```APIDOC ## MySQL Source Config Object ### Description Represents the configuration for a MySQL data source. ### Request Body Example ```json { "config": { "hostname": "rdbms-linux-20231031.c.company-4321.internal", "port": "3306", "username": "exampleuser", "password": "$DREMIO_EXISTING_VALUE$", "authenticationType": "MASTER", "fetchSize": 200, "netWriteTimeout": 60, "maxIdleConns": 8, "idleTimeSec": 60, "propertyList": [ { "name": "DataSource", "value": "sales2021" } ], "queryTimeoutSec": 0 } } ``` ``` -------------------------------- ### Privileges Attributes Examples Source: https://docs.dremio.com/25.x/reference/api/catalog/privileges Examples of the availablePrivileges array, grantType string, and privileges array. ```json [{"grantType": "SPACE","privileges": ["ALTER","ALTER_REFLECTION","MANAGE_GRANTS","MODIFY","SELECT","VIEW_REFLECTION"]},{"grantType": "SOURCE","privileges": ["ALTER","ALTER_REFLECTION","MANAGE_GRANTS","MODIFY","SELECT","VIEW_REFLECTION"]},{"grantType": "MUTABLE_SOURCE","privileges": ["ALTER","ALTER_REFLECTION","CREATE_TABLE","DELETE","DROP","INSERT","MANAGE_GRANTS","MODIFY","SELECT","TRUNCATE","UPDATE","VIEW_REFLECTION"]},{"grantType": "ARP_SOURCE","privileges": ["ALTER","ALTER_REFLECTION","EXTERNAL_QUERY","MANAGE_GRANTS","MODIFY","SELECT","VIEW_REFLECTION"]},{"grantType": "FOLDER_IN_MUTABLE_SOURCE","privileges": ["ALTER","ALTER_REFLECTION","CREATE_TABLE","DELETE","DROP","INSERT","MANAGE_GRANTS","SELECT","TRUNCATE","UPDATE","VIEW_REFLECTION"]},{"grantType": "FOLDER","privileges": ["ALTER","ALTER_REFLECTION","MANAGE_GRANTS","SELECT","VIEW_REFLECTION"]},{"grantType": "PDS","privileges": ["ALTER","DELETE","INSERT","MANAGE_GRANTS","SELECT","TRUNCATE","UPDATE"]},{"grantType": "VDS","privileges": ["ALTER","MANAGE_GRANTS","SELECT"]},{"grantType": "FUNCTION","privileges": ["ALTER","EXECUTE","MANAGE_GRANTS","MODIFY"]}] ``` ```text SPACE ``` ```json ["ALTER","ALTER_REFLECTION","MANAGE_GRANTS","MODIFY","SELECT","VIEW_REFLECTION"] ``` -------------------------------- ### Enable dremio to start at boot Source: https://docs.dremio.com/25.x/get-started/cluster-deployments/deployment-models/standalone/standalone-tarball Configures the dremio service to start automatically on system boot. ```bash sudo systemctl enable dremio ``` -------------------------------- ### Connection Property Name Example Source: https://docs.dremio.com/25.x/reference/api/catalog/source/container-source-config Example of a connection property name. Used for storage authentication. ```string fs.s3a.aws.credentials.provider ``` -------------------------------- ### MongoDB hostList Example Source: https://docs.dremio.com/25.x/reference/api/catalog/source/container-source-config An example of the hostList array format for specifying MongoDB hostnames and ports. ```json [{"hostname": "172.23.0.208","port": 27017}] ``` -------------------------------- ### Example URI with PAT Authentication Source: https://docs.dremio.com/25.x/sonar/client-applications/clients/superset A concrete example of a connection URI using a personal access token. ```text dremio+flight://myUserID:myPAT@myHost:32010/Samples?UseEncryption=false ``` -------------------------------- ### Teradata Source Configuration Example Source: https://docs.dremio.com/25.x/reference/api/catalog/source/container-source-config An example JSON object demonstrating the configuration for a Teradata data source. ```APIDOC ## Teradata Source Configuration ### Request Body Example ```json { "config": { "hostname": "teradata.drem.io", "port": "1025", "database": "dremio_source", "username": "dremio", "password": "$DREMIO_EXISTING_VALUE$", "fetchSize": 200, "showOnlyConnectionDatabase": false, "useSsl": false, "maxIdleConns": 8, "idleTimeSec": 60, "queryTimeoutSec": 0, "propertyList": [ { "name": "maxPoolSize", "value": "10" } ] } } ``` ### Parameters - **config** (Object) - Required - The configuration object for the Teradata source. - **hostname** (String) - Required - The hostname of the Teradata server. - **port** (String) - Required - The port number for the Teradata connection. Example: `1025` - **database** (String) - Required - The default database to use. Example: `dremio_source` - **username** (String) - Required - Username for authentication. Example: `dremio` - **password** (String) - Required - Password for authentication. Can be `$DREMIO_EXISTING_VALUE$` if the password is managed by Dremio. Example: `$DREMIO_EXISTING_VALUE$` - **fetchSize** (Integer) - Optional - The number of records to fetch per request. Default is `2000`. Example: `200` - **showOnlyConnectionDatabase** (Boolean) - Optional - If true, only the connection database is shown. Default is `false`. Example: `false` - **useSsl** (Boolean) - Optional - Whether to use SSL for the connection. Default is `false`. Example: `false` - **maxIdleConns** (Integer) - Optional - Maximum number of idle connections. Default is `8`. Example: `8` - **idleTimeSec** (Integer) - Optional - Maximum idle time for a connection in seconds. Default is `60`. Example: `60` - **queryTimeoutSec** (Integer) - Optional - Maximum time for query execution in seconds. Default is `0`. Example: `0` - **propertyList** (Array of Object) - Optional - Additional connection properties. - **name** (String) - Optional - Name of the property. Example: `maxPoolSize` - **value** (String) - Optional - Value of the property. Example: `10` ``` -------------------------------- ### Create a Folder Source: https://docs.dremio.com/25.x/reference/sql/commands/nessie/create-folder This example demonstrates the simplest way to create a folder named 'myFolder' in the current context. ```sql CREATE FOLDER myFolder ``` -------------------------------- ### Example Flight SQL URL for DataGrip Source: https://docs.dremio.com/25.x/sonar/client-applications/clients/datagrip Use this URL format when connecting DataGrip to a local Dremio installation that does not use an encrypted flight port. Ensure the host and port are correct for your Dremio setup. ```sql jdbc:arrow-flight-sql://localhost:32010?useEncryption=false ``` -------------------------------- ### Create Wiki Request Example (curl) Source: https://docs.dremio.com/25.x/reference/api/catalog/wiki Example using curl to create a wiki for a catalog object. Ensure to replace placeholders like {hostname} and . ```bash curl -X POST 'https://{hostname}/api/v3/catalog/1bcab7b3-ee82-44c1-abcc-e86d56078d4d/collaboration/wiki' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' \ --data-raw '{ \ "text": "# Testspace Wiki\nThis is an example wiki for a catalog object in Dremio. Here is some text in **bold**. Here is some text in *italics*.\n\nHere is an example excerpt with quotation formatting:\n\n> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n\n\n## Heading Level 2\n\nHere is a bulleted list:\n* An item in a bulleted list\n* A second item in a bulleted list\n* A third item in a bulleted list\n\n\n### Heading Level 3\n\nHere is a numbered list:\n1. An item in a numbered list\n1. A second item in a numbered list\n1. A third item in a numbered list\n\n\nHere is a sentence that includes an [external link to https://dremio.com](https://dremio.com).\n\nHere is an image:\n\n![](https://www.dremio.com/wp-content/uploads/2022/03/Dremio-logo.png)\n\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." \ }' ``` -------------------------------- ### Enable Dremio to Start at Boot (Optional) Source: https://docs.dremio.com/25.x/get-started/cluster-deployments/deployment-models/standalone/standalone-rpm Configure the Dremio service to automatically start when the system boots up. This is an optional step. ```bash sudo chkconfig --level 3456 dremio on ``` -------------------------------- ### Start Dremio Service Source: https://docs.dremio.com/25.x/get-started/yarn-quickstart Command to start the Dremio service after installation via RPM. ```bash sudo service dremio start ``` -------------------------------- ### Example Folder Creation Response Source: https://docs.dremio.com/25.x/reference/api/catalog/container-folder This is a sample response when a folder is successfully created with the specified access control list. ```json { "entityType": "folder", "id": "598697c2-8be0-4050-9731-53563977a17d", "path": [ "Example-Space", "First-Folder", "New-Folder" ], "tag": "R7COubQq8KE=", "accessControlList": { "users": [ { "id": "737a038f-c6cd-4fd3-a77a-59f692727ba5", "permissions": [ "SELECT", "ALTER" ] } ], "roles": [ { "id": "0f2d94e0-bb5e-4c03-8c6f-62d379d10889", "permissions": [ "SELECT" ] } ] }, "permissions": [], "owner": { "ownerId": "d01585a2-b267-4d56-9154-31762ab65a43", "ownerType": "USER" } } ``` -------------------------------- ### Retrieve Script by ID Request Source: https://docs.dremio.com/25.x/reference/api/scripts Example of a GET request to retrieve a script by its UUID. ```bash curl -X GET 'https://{hostname}/api/v3/scripts/74cfddfd-cb0b-4b2f-b555-cb8b827fec1e' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' ``` -------------------------------- ### Create Wiki Response Example Source: https://docs.dremio.com/25.x/reference/api/catalog/wiki Example response after successfully creating a wiki. The 'version' field indicates the current wiki version. ```json { "text": "# Testspace Wiki\nThis is an example wiki for a catalog object in Dremio. Here is some text in **bold**. Here is some text in *italics*.\n\nHere is an example excerpt with quotation formatting:\n\n> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n\n\n## Heading Level 2\n\nHere is a bulleted list:\n* An item in a bulleted list\n* A second item in a bulleted list\n* A third item in a bulleted list\n\n\n### Heading Level 3\n\nHere is a numbered list:\n1. An item in a numbered list\n1. A second item in a numbered list\n1. A third item in a numbered list\n\n\nHere is a sentence that includes an [external link to https://dremio.com](https://dremio.com).\n\nHere is an image:\n\n![](https://www.dremio.com/wp-content/uploads/2022/03/Dremio-logo.png)\n\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", "version": 0 } ``` -------------------------------- ### Sample Client Command Syntax Source: https://docs.dremio.com/25.x/sonar/developing-client-apps/arrow-flight-sql Syntax and available arguments for the Arrow Flight SQL sample client application. ```bash Usage: java -jar flight-sql-sample-client-application.jar -host localhost -port 32010 ... -command,--command Method to run -dsv,--disableServerVerification Disable TLS server verification. Defaults to false. -host,--hostname Dremio co-ordinator hostname. Defaults to "localhost". -kstpass,--keyStorePassword The jks keystore password. -kstpath,--keyStorePath Path to the jks keystore. -pass,---password Dremio password. -pat,--personalAccessToken Personal Access Token -port,--flightport Dremio flight server port. Defaults to 32010. -query,--query Query -schema,--schema Schema -sp,--sessionProperty Key value pairs of SessionProperty, example: -sp schema='Samples."samples.dremio. com"' -sp key=value -table,--table Table -tls,--tls Enable encrypted connection. Defaults to false. -user,---username Dremio username. ``` -------------------------------- ### API Request with Filter Parameter Source: https://docs.dremio.com/25.x/reference/api Example of a GET request using a URL-encoded JSON string for the filter parameter. ```bash curl -X GET 'https://{hostname}/api/v3/reflection-summary?filter=%7B%0A%20%20%22reflectionType%22%3A%20%5B%22RAW%22%5D%2C%0A%20%20%22refreshStatus%22%3A%20%5B%22MANUAL%22%2C%22SCHEDULED%22%5D%2C%0A%20%20%22enabledFlag%22%3A%20true%2C%0A%20%20%22reflectionNameOrDatasetPath%22%3A%20%22samples.dremio.com%22%0A%7D' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' ``` -------------------------------- ### Create Raw Reflection for Line Items Source: https://docs.dremio.com/25.x/reference/sql/commands/acceleration This example demonstrates creating a raw reflection for line item data, partitioning by username and sorting by outcome. Verify the table name and columns. ```sql ALTER TABLE TAMV2."outcome_category_line_item" CREATE RAW REFLECTION outcome_category_line_item_raw USING DISPLAY (dir0,dir1,queryId,queryText,"start",finish,outcome,username) PARTITION BY (username) LOCALSORT BY (outcome); ``` -------------------------------- ### Sample dremio.conf for Coordinator Source: https://docs.dremio.com/25.x/get-started/cluster-deployments/deployment-models/yarn-deployment Example configuration for a coordinator node, specifying local and distributed storage paths, Zookeeper nodes, and service roles. ```text paths: { # the local path for dremio to store data. local: "/var/lib/dremio" # the distributed path Dremio data including job results, downloads, uploads, etc dist: "maprfs:///dremio/pdfs" } zookeeper: ":5181,:5181" services: { coordinator.enabled: true, coordinator.master.enabled: true, executor.enabled: false } ``` -------------------------------- ### Policies with Multiple Arguments Limitation Source: https://docs.dremio.com/25.x/security/rbac/row-column-policies-udf A Reflection created on a view containing a policy with multiple arguments on an anchor dataset will fail. This example demonstrates the setup leading to this limitation. ```sql -- Create tables CREATE TABLE employees ( id INT, hire_date DATE, ssn VARCHAR(11), name VARCHAR, country VARCHAR, salary FLOAT, job_id INT); CREATE TABLE jobs ( id INT, title VARCHAR, is_good BOOLEAN); -- Create a view CREATE VIEW job_salary_in_the_usa AS SELECT job_id, salary FROM employees WHERE country = 'USA'; -- Create a UDF CREATE OR REPLACE FUNCTION hide_salary_on_bad_job(salary FLOAT, job_id_in INT) RETURNS BOOLEAN RETURN SELECT CASE WHEN IS_MEMBER('public') AND ( SELECT is_good FROM jobs j WHERE job_id_in = j.id) THEN NULL ELSE salary END; -- Add a column-masking policy ALTER TABLE employees MODIFY COLUMN salary SET MASKING POLICY hide_salary_on_bad_job(salary, job_id); -- Create a raw Reflection on the view ALTER DATASET job_salary_in_the_usa CREATE RAW Reflection job_salary_drr USING DISPLAY(job_id, salary); ``` -------------------------------- ### Example Config for Local Dremio Instance Source: https://docs.dremio.com/25.x/sonar/client-applications/clients/python Configuration file example for connecting to a local Dremio instance. Uncomment and set `username`, `password`, and `query` as needed. ```yaml username: my_username password: my_password query: SELECT 1 ``` -------------------------------- ### APPROX_COUNT_DISTINCT Example Source: https://docs.dremio.com/25.x/reference/sql/sql-functions/functions/APPROX_COUNT_DISTINCT Use APPROX_COUNT_DISTINCT to get an approximate count of unique non-null values in a specified column. This function is useful for large datasets where an exact count is computationally expensive. ```sql SELECT APPROX_COUNT_DISTINCT(IncidntNum) FROM Samples."samples.dremio.com"."SF_incidents2016.json" -- 116696 ``` -------------------------------- ### Retrieve First 10 Results with Limit Source: https://docs.dremio.com/25.x/reference/api Use the `limit` query parameter to specify the maximum number of results to retrieve. This example shows how to get the first 10 results. ```curl curl -X GET 'https://{hostname}/api/v3/job/{id}/results?limit=10' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json' ``` -------------------------------- ### GET /api/v3/scripts with ownedBy parameter Source: https://docs.dremio.com/25.x/reference/api Use the `ownedBy` query parameter to limit the request to objects owned by a specific user. This example retrieves only scripts owned by a given user ID. ```APIDOC ## GET /api/v3/scripts ### Description Retrieves scripts owned by a specific user. ### Method GET ### Endpoint /api/v3/scripts ### Query Parameters - **ownedBy** (string) - Required - The ID of the user whose owned objects are to be retrieved. ### Request Example ```json { "example": "curl -X GET 'https://{hostname}/api/v3/scripts?ownedBy=8be516f3-04c4-4d19-824d-5a70b3c4442e' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json'" } ``` ### Response #### Success Response (200) - **scripts** (array) - A list of script objects. - **nextPageToken** (string) - Token for the next page of results. #### Response Example ```json { "example": "{...}" } ``` ``` -------------------------------- ### Show Create View Example Source: https://docs.dremio.com/25.x/reference/sql/commands/show-create-view Example of how to show the definition of a view named 'offices_by_region' located in the 'company_data.Locations' schema, specifically from the 'myBranch' reference. ```sql SHOW CREATE VIEW "company_data".Locations."offices_by_region" AT REF "myBranch" ``` -------------------------------- ### GET /api/v3/catalog/{id} with maxChildren parameter Source: https://docs.dremio.com/25.x/reference/api The `maxChildren` query parameter allows you to specify the maximum number of child objects to include in each response. This example sets `maxChildren` to 25 for a specific catalog item. ```APIDOC ## GET /api/v3/catalog/{id} ### Description Retrieves catalog items with a specified maximum number of child objects. ### Method GET ### Endpoint /api/v3/catalog/{id} ### Path Parameters - **id** (string) - Required - The ID of the catalog item. ### Query Parameters - **maxChildren** (integer) - Optional - The maximum number of child objects to include in the response. - **pageToken** (string) - Optional - Token for the next page of results, used in conjunction with `maxChildren` for pagination. ### Request Example ```json { "example": "curl -X GET 'https://{hostname}/api/v3/catalog/2b1be882-7012-4a99-8d6c-82e32e4562e4?maxChildren=25' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json'" } ``` ### Response #### Success Response (200) - **catalogItem** (object) - The catalog item details. - **children** (array) - A list of child objects, limited by `maxChildren`. - **nextPageToken** (string) - Token for the next page of results. #### Response Example ```json { "example": "{...}" } ``` ``` -------------------------------- ### Basic Dremio Backup Example Source: https://docs.dremio.com/25.x/admin/cli/backup This example demonstrates how to perform a basic backup of Dremio to the specified directory. A confirmation message will appear upon completion. ```bash /dremio-admin backup -u dremio -p dremio123 -d /tmp/backup ``` -------------------------------- ### MAX Aggregate Function Example Source: https://docs.dremio.com/25.x/reference/sql/sql-functions/functions/MAX Use the MAX aggregate function to find the maximum value of a numeric column across all rows in a table. No specific setup is required beyond standard SQL syntax. ```sql SELECT MAX("total_amount") FROM "Samples"."samples.dremio.com"."NYC-taxi-trips"; -- 685908.1 ``` -------------------------------- ### MIN Aggregate Function Example Source: https://docs.dremio.com/25.x/reference/sql/sql-functions/functions/MIN Use the MIN function as an aggregate to find the minimum value of a numeric column across all rows in a table. No specific setup is required beyond standard SQL syntax. ```sql SELECT MIN("total_amount") FROM "Samples"."samples.dremio.com"."NYC-taxi-trips"; -- -1430.0 ``` -------------------------------- ### GET /api/v3/scripts with search parameter Source: https://docs.dremio.com/25.x/reference/api Use the `search` query parameter to limit the request to objects that contain values that include the search string. This example searches for scripts whose name attribute includes 'dev'. ```APIDOC ## GET /api/v3/scripts ### Description Retrieves scripts that match a search string in their name attribute. ### Method GET ### Endpoint /api/v3/scripts ### Query Parameters - **search** (string) - Required - The search string to filter objects by. ### Request Example ```json { "example": "curl -X GET 'https://{hostname}/api/v3/scripts?search=dev' \ --header 'Authorization: Bearer ' \ --header 'Content-Type: application/json'" } ``` ### Response #### Success Response (200) - **scripts** (array) - A list of script objects matching the search criteria. - **nextPageToken** (string) - Token for the next page of results. #### Response Example ```json { "example": "{...}" } ``` ``` -------------------------------- ### Move Existing Dremio Installation Source: https://docs.dremio.com/25.x/get-started/cluster-deployments/deployment-models/standalone/standalone-tarball Move the current installation directory to a backup location before installing the new version. ```bash mv /opt/dremio /opt/dremio_bak ``` -------------------------------- ### Sample service configuration Source: https://docs.dremio.com/25.x/get-started/cluster-deployments/deployment-models/standalone/standalone-tarball Example content for the dremio.service file used to manage the Dremio daemon. ```ini # # Installation is assumed to be under /opt/dremio # [Unit] Description=Dremio Daemon Server Documentation=https://docs.dremio.com Wants=network-online.target After=network-online.target [Service] User=dremio Group=dremio RuntimeDirectory=dremio ExecStart=/opt/dremio/bin/dremio start-fg Restart=on-failure # Set maximum number of file descriptors Dremio can open. # Dremio requires a large number to work correctly. LimitNOFILE=65536 [Install] WantedBy=multi-user.target ``` -------------------------------- ### Install Dremio using RPM Source: https://docs.dremio.com/25.x/get-started/standalone-quickstart Use this command to install the Dremio Linux RPM package. Replace `` with the specific Dremio version you are installing. ```bash sudo yum localinstall dremio-.rpm ``` -------------------------------- ### Convert VARCHAR to BINARY Source: https://docs.dremio.com/25.x/reference/sql/sql-functions/functions/BINARY_STRING Examples demonstrating the conversion of string literals to binary format. ```sql SELECT BINARY_STRING('DREMIO') -- RFJFTUlP ``` ```sql SELECT BINARY_STRING('000') -- MDAw ``` -------------------------------- ### Create and Load Tables for MERGE Example Source: https://docs.dremio.com/25.x/reference/sql/commands/apache-iceberg-tables/apache-iceberg-merge This SQL code sets up two tables, 'target_table' and 'source_table', and populates them with initial data. This is a prerequisite for demonstrating the MERGE statement. ```sql CREATE TABLE target_table (ID INTEGER, description VARCHAR); CREATE TABLE source_table (ID INTEGER, description_1 VARCHAR, description_2 VARCHAR); INSERT INTO target_table (ID, description ) VALUES (1, 'Original value'), (2, 'Original value'); INSERT INTO source_table (ID, description_1, description_2) VALUES (1, 'Value 1', 'Value 2'), (3, 'Value 1', 'Value 2'); ``` -------------------------------- ### Install dbt-dremio Package Source: https://docs.dremio.com/25.x/sonar/client-applications/clients/dbt Install the dbt-dremio package using pip. Ensure Python 3.9.x or later is installed. This package is compatible with dbt-core versions 1.8 and 1.9. ```bash pip install dbt-dremio ``` -------------------------------- ### Create dremio directories Source: https://docs.dremio.com/25.x/get-started/cluster-deployments/deployment-models/standalone/standalone-tarball Sets up the necessary directories for Dremio installation, logs, and runtime data with appropriate ownership. ```bash sudo mkdir /opt/dremio sudo mkdir /var/run/dremio && sudo chown dremio:dremio /var/run/dremio sudo mkdir /var/log/dremio && sudo chown dremio:dremio /var/log/dremio sudo mkdir /var/lib/dremio && sudo chown dremio:dremio /var/lib/dremio ``` -------------------------------- ### Start Dremio Service Source: https://docs.dremio.com/25.x/get-started/cluster-deployments/deployment-models/standalone/standalone-tarball Start the Dremio service after the upgrade is complete. ```bash /bin/dremio start ``` -------------------------------- ### Copy and Move Dremio Installation for Backup Source: https://docs.dremio.com/25.x/get-started/cluster-deployments/deployment-models/standalone/standalone-rpm Before upgrading, back up your current Dremio installation by copying the installation directory and the data directory to a backup location. This is crucial for rollback if needed. ```bash cp -rL /var/lib/dremio /var/lib/dremio_bak cp -rL /opt/dremio /opt/dremio_bak ``` -------------------------------- ### Show Create View Syntax Source: https://docs.dremio.com/25.x/reference/sql/commands/show-create-view This is the general syntax for the SHOW CREATE VIEW command. It allows specifying a reference point for the view definition. ```sql SHOW CREATE VIEW [ AT { REF[ERENCE] | BRANCH | TAG | COMMIT } ] ``` -------------------------------- ### Unset a Column-Masking Policy Example Source: https://docs.dremio.com/25.x/reference/sql/commands/row-column-policies Example of removing a masking policy from a column. ```SQL ALTER TABLE e.employees MODIFY COLUMN ssn_col UNSET MASKING POLICY protect_ssn; ```