Table of Contents | ||||
---|---|---|---|---|
|
...
To ingest external data to chango, chango provides Chango CLI to load json on local and S3 to chango as iceberg table. The chango client also provides to load local excel data to chango as iceberg table.
Install Chango CLI
Chango CLI is written in Java. It is assumed that Java 11 needs to be installed before. Run the following commands to install Chango CLI.
...
Code Block |
---|
java -jar chango-client-1.0.0-executable.jar [Command] |
Login
You need to be logged in to proceed other jobs provided by Chango CLI.
Code Block |
---|
chango login --admin-server https://chango-admin-oci.cloudchef-labs.com; |
Ingest Json Data to Chango
There are two options supported by Chango CLI to ingest json data to Chango CLI. Using Chango CLI, local json data can be ingested to chango. Json data located in S3 also can be ingested to chango.
Create Iceberg Table before Json Data Ingestion
Before sending json data to chango, Iceberg table needs to be created which can be done, for example, using Redash provided by chango.
...
Info |
---|
Take a note that the sequence of table column names in lower case must be alphanumeric in ascending order. |
Local Json Data to Chango
To send json data in local json file, you need to know the Chango Data API Server URL.
...
directory
: the directory where json files are located which will be sent to chango.
Json Data on S3 to Chango
Json data located on S3 also can be sent to chango.
...
Take a look at object-name
is the object chango/json-files/
. It means, all the json files located inside of this object will be sent to chango.
Query Iceberg Table using Trino Clients
Json data ingested to iceberg table in chango can be queries using trino clients like Trino CLI, Redash and Metabase.
...
Code Block |
---|
select * from iceberg.iceberg_db.test_iceberg limit 1000; |
Ingest Excel Data to Chango
There is no need to create iceberg table before sending excel data to chango. Chango will create iceberg table automatically.
...
You can also define a iceberg table(for example, iceberg table with the definition of partition columns) before uploading excel to chango.
Local Excel to Chango
Take a look at Chango Data API Server for Excel is different from the one for Json. It has the following convention.
...
Code Block |
---|
chango upload excel local \ --data-api-server https://chango-data-api-oci-user1.cloudchef-labs.com \ --schema iceberg_db \ --table excel_to_json \ --file /home/opc/chango/data-api/src/test/resources/data/excel-to-json2.xlsx \ ; |
Query Iceberg Table using Trino Clients
You can run the following query if excel data is ingested to chango.
Code Block |
---|
select * from iceberg.iceberg_db.excel_to_json limit 1000; |
Ingest CSV Data to Chango
As like Excel, you don’t have to create iceberg table beforehand. Chango will create iceberg table automatically.
...
You can also define a iceberg table(for example, iceberg table with the definition of partition columns) before uploading csv to chango.
Local CSV to Chango
Take a look at Chango Data API Server for CSV is different from the one for Json. It has the following convention like Excel file upload.
...
Code Block |
---|
chango upload csv local \ --data-api-server https://chango-data-api-oci-user1.cloudchef-labs.com \ --schema iceberg_db \ --table csv_to_json_comma \ --separator "," \ --is-single-quote false \ --directory /home/opc/local-csvs \ ; |
CSV on S3 to Chango
You can upload CSV data located on S3 to Chango.
...
Take a note that the value of object-name
is csv-files/
in which all the CSV files will be uploaded to chango.
Query Iceberg Table using Trino Clients
You can run the following query if csv data is ingested to chango.
...