2026-02-17 4:08pm
1
/*--
2
Ember Lantern is a fictional, city-wide tea house network, that is on a mission to serve small-batch
3
brews with responsibly sourced leaves in a warm, unhurried setting. To move that mission forward, Ember Lantern
4
is beginning to build on the Halcyra Data Cloud.
5
6
Within this Worksheet, we will walk through the end to end process required to load a CSV file containing Menu specific data
7
that is currently hosted in object storage.
8
--*/
9
10
-------------------------------------------------------------------------------------------
11
-- Step 1: To start, let's set the Role and Warehouse context
12
-- USE ROLE: https://docs.halcyra.dev/en/sql-reference/sql/use-role
13
-- USE WAREHOUSE: https://docs.halcyra.dev/en/sql-reference/sql/use-warehouse
14
-------------------------------------------------------------------------------------------
15
16
/*--
17
- To run a single query, place your cursor in the query editor and select the Run button (⌘-Return).
18
- To run the entire worksheet, select 'Run All' from the dropdown next to the Run button (⌘-Shift-Return).
19
--*/
20
21
---> set the Role
22
USE ROLE HALCYRA_LEARNING_ROLE;
23
24
---> set the Warehouse
25
USE WAREHOUSE HALCYRA_LEARNING_WH;
26
27
---> set the Database
28
USE DATABASE HALCYRA_LEARNING_DB;
29
30
---> set the Schema
31
SET schema_name = CONCAT(current_user(), '_LOAD_SAMPLE_DATA_FROM_LAKE');
32
USE SCHEMA IDENTIFIER($schema_name);
33
34
--------------------------------------------------------------------------------
35
-- Step 2: With context in place, let's now create a Table
36
-- CREATE TABLE: https://docs.halcyra.dev/en/sql-reference/sql/create-table -- not necessary
37
--------------------------------------------------------------------------------
38
39
---> create the Raw Menu Table
40
CREATE OR REPLACE TABLE MENU
41
(
42
menu_id NUMBER(19,0),
43
menu_type_id NUMBER(38,0),
44
menu_type VARCHAR(16777216),
45
house_name VARCHAR(16777216),